3

After upgrading our chain to polkadot 0.9.38 I managed to build the benchmarking using cargo build --release --features runtime-benchmarks but when I try to benchmark any pallet after the build I always get the following error

Builder finished with `build_or_panic`; The panic is expected if runtime weights are not correct:

Error: Input("Did not find the benchmarking metadata. This could mean that you either did not build the node correctly with the `--features runtime-benchmarks` flag, or the chain spec that you are using was not created by a node that was compiled with the flag:

Any guidance on how to fix that error?

Link to code here

1 Answer 1

0

The error was coming from setting the MAXIMUM_BLOCK_WEIGHT value using Weight::from_ref_time instead of Weight::from_parts using polkadot_primitives::MAX_POV_SIZE as u64 as proof size value

The correct value is

pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
    WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
    polkadot_primitives::MAX_POV_SIZE as u64,
);

Found the solution to the problem through the answer of a question I asked here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.