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

Merged
merged 4 commits into from
Nov 29, 2024

Conversation

AurevoirXavier
Copy link
Contributor

@AurevoirXavier AurevoirXavier requested a review from a team as a code owner October 29, 2024 15:37
#[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.

@re-gius re-gius enabled auto-merge November 29, 2024 10:47
@re-gius re-gius added this pull request to the merge queue Nov 29, 2024
Merged via the queue into paritytech:master with commit b3ab312 Nov 29, 2024
193 of 198 checks passed
@re-gius
Copy link
Contributor

re-gius commented Nov 29, 2024

/tip small

Copy link

@re-gius A referendum for a small (20 DOT) tip was successfully submitted for @AurevoirXavier (156HGo9setPcU2qhFMVWLkcmtCEGySLwNqa3DaEiYSWtte4Y on polkadot).

Referendum number: 1323.
tip

Copy link

The referendum has appeared on Polkassembly.

@AurevoirXavier AurevoirXavier deleted the x/benchmarkv2-preimage branch December 10, 2024 15:37
Krayt78 pushed a commit to Krayt78/polkadot-sdk that referenced this pull request Dec 18, 2024
Part of:

- paritytech#6202.

---------

Co-authored-by: Giuseppe Re <[email protected]>
Co-authored-by: command-bot <>
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