Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoOp Impl Polling Trait #5311

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Doordashcon
Copy link
Contributor

updates the Polling trait implementation in tests.

@Doordashcon Doordashcon marked this pull request as ready for review September 3, 2024 09:30
@Doordashcon Doordashcon requested a review from a team as a code owner September 3, 2024 09:30
@bkchr
Copy link
Member

bkchr commented Sep 3, 2024

@Doordashcon do you have any reasoning for this?

@Doordashcon
Copy link
Contributor Author

Doordashcon commented Sep 3, 2024

@bkchr just a follow up on this?
polkadot-fellows/runtimes#347 (comment)

@bkchr
Copy link
Member

bkchr commented Sep 10, 2024

@bkchr just a follow up on this?
polkadot-fellows/runtimes#347 (comment)

The comment is saying that this no-op should be implemented on () or some special NoOp struct.

@Doordashcon Doordashcon changed the title No-op Impl Polling Trait NoOp Impl Polling Trait Sep 10, 2024
@Doordashcon
Copy link
Contributor Author

Doordashcon commented Sep 10, 2024

Implemented Polling for () and updated the tests where we have methods unimplemented!().

@bkchr bkchr requested a review from muharem September 10, 2024 20:40
@bkchr bkchr added the T2-pallets This PR/Issue is related to a particular pallet. label Sep 10, 2024
@@ -126,7 +126,7 @@ benchmarks_instance_pallet! {
}

vote {
let class = T::Polls::classes().into_iter().next().unwrap();
let class = T::Polls::classes().into_iter().next().ok_or(BenchmarkError::Skip)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what weight Skip will result?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Secretary Collective requires skipping these extrinsics to generate weights for the ranked_collective pallet instance which uses this NoOp implementation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I have not checked the actual code, what we need to do here if classes() returns nothing, we need to pass some invalid poll index. The function is still trying to access the storage etc.

@@ -126,7 +126,7 @@ benchmarks_instance_pallet! {
}

vote {
let class = T::Polls::classes().into_iter().next().unwrap();
let class = T::Polls::classes().into_iter().next().ok_or(BenchmarkError::Skip)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I have not checked the actual code, what we need to do here if classes() returns nothing, we need to pass some invalid poll index. The function is still trying to access the storage etc.

@paritytech-review-bot paritytech-review-bot bot requested a review from a team September 13, 2024 17:56
@Doordashcon
Copy link
Contributor Author

Added Default bound.

please review @muharem @bkchr

@bkchr
Copy link
Member

bkchr commented Sep 14, 2024

@Doordashcon can you please fix it as done in this pr #3049?

@Doordashcon
Copy link
Contributor Author

@Doordashcon can you please fix it as done in this pr #3049?

updated other benchmarks as well, hopefully ready for review @muharem @bkchr 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants