Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Fix benchmarks set_code for frame_system pallet for all SP runtimes #2765

@bkontur

Description

@bkontur

here was added benchmark for set_code paritytech/substrate#13373
but it does not work with Cumulus runtimes which uses:

type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;

because it ends here, where some data are expected
https://github.com/paritytech/cumulus/blob/master/pallets/parachain-system/src/lib.rs#L986-L1008

so the fix should be to add some T::BenchmarkHelper::prepare_data() to the set_code benchmark here

something like:

        set_code {
		let runtime_blob = include_bytes!("../res/kitchensink_runtime.compact.compressed.wasm").to_vec();
                T::BenchmarkHelper::prepare_data();
	}: _(RawOrigin::Root, runtime_blob)
	verify {
		System::<T>::assert_last_event(frame_system::Event::<T>::CodeUpdated.into());
	}

and then configure BenchmarkHelper in every runtime (or close to ParachainSetCode)

Example of failed job: https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3035163

./target/production/polkadot-parachain benchmark pallet --chain=asset-hub-kusama-dev --execution=wasm --wasm-execution=compiled --pallet=frame_system --no-storage-info --no-median-slopes --no-min-squares '--extrinsic=*' --steps=50 --repeat=20 --json --header=./file_header.txt --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/
Error: Input("Benchmark frame_system::set_code failed: ValidationDataNotAvailable")

Metadata

Metadata

Assignees

No one assigned

    Labels

    I3-bugThe node fails to follow expected behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions