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

Migrate pallet-preimage to benchmark v2 #6277

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

Conversation

AurevoirXavier
Copy link
Contributor

#[benchmark]
fn request_preimage() {
let o = T::ManagerOrigin::try_successful_origin()
.expect("ManagerOrigin has no successful origin required for the benchmark");
Copy link
Member

Choose a reason for hiding this comment

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

Why is this an expect now? The pallet is also usable without manager origin.
It returned BenchmarkError::Weightless before.

Copy link
Contributor Author

@AurevoirXavier AurevoirXavier Oct 30, 2024

Choose a reason for hiding this comment

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

I think that error is meaningless.

Same as:

let origin =
T::SpendOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
let beneficiary = T::Lookup::lookup(beneficiary_lookup.clone()).unwrap();
#[extrinsic_call]
_(origin as T::RuntimeOrigin, value, beneficiary_lookup);

It was not part of the benchmark(#[extrinsic_call]) code block. Additionally, I believe the original .expect message is more readable. So I reuse it.

What do you suggest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also can be found here

.expect("ManagerOrigin has no successful origin required for the benchmark");

@re-gius re-gius added R0-silent Changes should not be mentioned in any release notes T2-pallets This PR/Issue is related to a particular pallet. T12-benchmarks This PR/Issue is related to benchmarking and weights. labels Nov 28, 2024
@re-gius
Copy link
Contributor

re-gius commented Nov 28, 2024

bot bench substrate-pallet --features=runtime-benchmarks --pallet=pallet_preimage

@command-bot
Copy link

command-bot bot commented Nov 28, 2024

@re-gius https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7837857 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --features=runtime-benchmarks --pallet=pallet_preimage. Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 7-91700d0f-b543-4f26-b92d-ad7c4657bcf1 to cancel this command or bot cancel to cancel all commands in this pull request.

…=dev --target_dir=substrate --features=runtime-benchmarks --pallet=pallet_preimage
@command-bot
Copy link

command-bot bot commented Nov 28, 2024

@re-gius Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --features=runtime-benchmarks --pallet=pallet_preimage has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7837857 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7837857/artifacts/download.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T2-pallets This PR/Issue is related to a particular pallet. T12-benchmarks This PR/Issue is related to benchmarking and weights.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants