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

benchmarking: complete automatic weight sanity check PR #4020

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0ceee42
Draft benchmark sanity weight test
Daanvdplas Sep 5, 2023
81165e3
error || warning
Daanvdplas Oct 17, 2023
8fc1fca
allow enable, warning & ignore + output improvement
Daanvdplas Oct 18, 2023
7d64b60
Merge master
Daanvdplas Oct 18, 2023
d476d7f
fmt
Daanvdplas Oct 18, 2023
a698258
spelling & ci tests
Daanvdplas Oct 18, 2023
6081db0
fix failing ci tests
Daanvdplas Oct 18, 2023
540ce57
more ci tests
Daanvdplas Oct 18, 2023
df4f1c4
more...
Daanvdplas Oct 19, 2023
ac0bc11
Merge branch 'master' into daan/built_in_weight_test
Daanvdplas Oct 25, 2023
d64188f
add to gitlab pipeline
Daanvdplas Oct 25, 2023
eace65b
fix: unused import
Daanvdplas Oct 25, 2023
98485c5
fmt
Daanvdplas Oct 25, 2023
8795558
improve based on first comments (1/2)
Daanvdplas Oct 27, 2023
741329f
add Cargo.lock
Daanvdplas Oct 27, 2023
0f76c55
Master.into()
kianenigma Feb 5, 2024
1d35a4c
Resolve comments and add prdoc
dastansam Apr 8, 2024
759ddbb
Temp rename prdoc
dastansam Apr 8, 2024
85ff553
Remove bump
dastansam Apr 8, 2024
6b353d2
Add runtime version check, rename `BenchmarkInfo`
dastansam Apr 11, 2024
340b03d
Merge branch 'master' of github-dastansam:paritytech/polkadot-sdk int…
dastansam Apr 12, 2024
d9920b5
Resolve comments
dastansam Apr 12, 2024
9e93395
Fix failing benchmarks
dastansam Apr 12, 2024
c13ecf7
Merge branch 'master' into complete-weight-sanity-check
dastansam Apr 15, 2024
6a24466
Update prdoc/pr_4020.prdoc
dastansam Apr 15, 2024
10e759f
Resolve comments
dastansam Apr 15, 2024
1f225d1
More log fixes
dastansam Apr 15, 2024
15cb72d
Merge branch 'master' into complete-weight-sanity-check
dastansam Apr 15, 2024
e12b45f
Merge branch 'master' into complete-weight-sanity-check
dastansam Apr 17, 2024
d9efe90
Apply suggestions from code review
dastansam Apr 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitlab/pipeline/short-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ short-benchmark-westend: &short-bench
tags:
- benchmark
script:
- ./artifacts/polkadot benchmark pallet --chain $RUNTIME-dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1
- ./artifacts/polkadot benchmark pallet --chain $RUNTIME-dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 --sanity-weight-check ignore

# run short-benchmarks for system parachain runtimes from cumulus

Expand All @@ -47,7 +47,7 @@ short-benchmark-westend: &short-bench
tags:
- benchmark
script:
- ./artifacts/polkadot-parachain benchmark pallet --chain $RUNTIME_CHAIN --pallet "*" --extrinsic "*" --steps 2 --repeat 1
- ./artifacts/polkadot-parachain benchmark pallet --chain $RUNTIME_CHAIN --pallet "*" --extrinsic "*" --steps 2 --repeat 1 --sanity-weight-check ignore

short-benchmark-asset-hub-rococo:
<<: *short-bench-cumulus
Expand Down
5 changes: 2 additions & 3 deletions .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ test-linux-stable-runtime-benchmarks:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- time cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet

# can be used to run all tests
# test-linux-stable-all:
# stage: test
Expand Down Expand Up @@ -322,7 +321,7 @@ quick-benchmarks:
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings"
script:
- time cargo run --locked --release -p staging-node-cli --bin substrate-node --features runtime-benchmarks --quiet -- benchmark pallet --chain dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 --quiet
- time cargo run --locked --release -p staging-node-cli --bin substrate-node --features runtime-benchmarks --quiet -- benchmark pallet --chain dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 --quiet --sanity-weight-check ignore

quick-benchmarks-omni:
stage: test
Expand All @@ -339,7 +338,7 @@ quick-benchmarks-omni:
WASM_BUILD_RUSTFLAGS: "-C debug-assertions"
script:
- time cargo build --locked --quiet --release -p asset-hub-westend-runtime --features runtime-benchmarks
- time cargo run --locked --release -p frame-omni-bencher --quiet -- v1 benchmark pallet --runtime target/release/wbuild/asset-hub-westend-runtime/asset_hub_westend_runtime.compact.compressed.wasm --all --steps 2 --repeat 1 --quiet
- time cargo run --locked --release -p frame-omni-bencher --quiet -- v1 benchmark pallet --runtime target/release/wbuild/asset-hub-westend-runtime/asset_hub_westend_runtime.compact.compressed.wasm --all --steps 2 --repeat 1 --quiet --sanity-weight-check ignore

test-frame-examples-compile-to-wasm:
# into one job
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1293,11 +1293,8 @@ impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
fn benchmark_metadata(extra: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
use frame_benchmarking::{Benchmarking, BenchmarkList, RuntimeBenchmarkInfo};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand All @@ -1324,7 +1321,9 @@ impl_runtime_apis! {
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
(list, storage_info)
let max_extrinsic_weight = RuntimeBlockWeights::get().per_class.get(DispatchClass::Normal).max_extrinsic.unwrap();
let db_weight: frame_support::weights::RuntimeDbWeight = <Self as frame_system::Config>::DbWeight::get();
RuntimeBenchmarkInfo { list, storage_info, max_extrinsic_weight: Some(max_extrinsic_weight), db_weight: Some(db_weight) }
}

fn dispatch_benchmark(
Expand Down
12 changes: 6 additions & 6 deletions cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1370,11 +1370,8 @@ impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
fn benchmark_metadata(extra: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
use frame_benchmarking::{Benchmarking, BenchmarkList, RuntimeBenchmarkInfo};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand All @@ -1401,7 +1398,10 @@ impl_runtime_apis! {
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
(list, storage_info)
let max_extrinsic_weight = RuntimeBlockWeights::get().per_class.get(DispatchClass::Normal).max_extrinsic.unwrap();
let db_weight: frame_support::weights::RuntimeDbWeight = <Self as frame_system::Config>::DbWeight::get();

RuntimeBenchmarkInfo { list, storage_info, max_extrinsic_weight: Some(max_extrinsic_weight), db_weight: Some(db_weight) }
}

fn dispatch_benchmark(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1052,11 +1052,8 @@ impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
fn benchmark_metadata(extra: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
use frame_benchmarking::{Benchmarking, BenchmarkList, RuntimeBenchmarkInfo};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand All @@ -1079,7 +1076,9 @@ impl_runtime_apis! {
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
(list, storage_info)
let max_extrinsic_weight = RuntimeBlockWeights::get().per_class.get(DispatchClass::Normal).max_extrinsic.unwrap();
let db_weight: frame_support::weights::RuntimeDbWeight = <Self as frame_system::Config>::DbWeight::get();
RuntimeBenchmarkInfo { list, storage_info, max_extrinsic_weight: Some(max_extrinsic_weight), db_weight: Some(db_weight) }
}

fn dispatch_benchmark(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,11 +752,8 @@ impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
fn benchmark_metadata(extra: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
use frame_benchmarking::{Benchmarking, BenchmarkList, RuntimeBenchmarkInfo};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand All @@ -778,7 +775,10 @@ impl_runtime_apis! {
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
(list, storage_info)
let max_extrinsic_weight = RuntimeBlockWeights::get().per_class.get(DispatchClass::Normal).max_extrinsic.unwrap();
let db_weight: frame_support::weights::RuntimeDbWeight = <Self as frame_system::Config>::DbWeight::get();

RuntimeBenchmarkInfo { list, storage_info, max_extrinsic_weight: Some(max_extrinsic_weight), db_weight: Some(db_weight) }
}

fn dispatch_benchmark(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -946,11 +946,8 @@ impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
fn benchmark_metadata(extra: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
use frame_benchmarking::{Benchmarking, BenchmarkList, RuntimeBenchmarkInfo};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand All @@ -960,7 +957,9 @@ impl_runtime_apis! {
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
(list, storage_info)
let max_extrinsic_weight = RuntimeBlockWeights::get().per_class.get(DispatchClass::Normal).max_extrinsic.unwrap();
let db_weight: frame_support::weights::RuntimeDbWeight = <Self as frame_system::Config>::DbWeight::get();
RuntimeBenchmarkInfo { list, storage_info, max_extrinsic_weight: Some(max_extrinsic_weight), db_weight: Some(db_weight) }
}

fn dispatch_benchmark(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,11 +677,8 @@ impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
fn benchmark_metadata(extra: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
use frame_benchmarking::{Benchmarking, BenchmarkList, RuntimeBenchmarkInfo};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand All @@ -691,7 +688,9 @@ impl_runtime_apis! {
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
(list, storage_info)
let max_extrinsic_weight = RuntimeBlockWeights::get().per_class.get(DispatchClass::Normal).max_extrinsic.unwrap();
let db_weight: frame_support::weights::RuntimeDbWeight = <Self as frame_system::Config>::DbWeight::get();
RuntimeBenchmarkInfo { list, storage_info, max_extrinsic_weight: Some(max_extrinsic_weight), db_weight: Some(db_weight) }
}

fn dispatch_benchmark(
Expand Down
12 changes: 6 additions & 6 deletions cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,11 +670,8 @@ impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
fn benchmark_metadata(extra: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
use frame_benchmarking::{Benchmarking, BenchmarkList, RuntimeBenchmarkInfo};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand All @@ -690,7 +687,10 @@ impl_runtime_apis! {
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
(list, storage_info)
let max_extrinsic_weight = RuntimeBlockWeights::get().per_class.get(DispatchClass::Normal).max_extrinsic.unwrap();
let db_weight: frame_support::weights::RuntimeDbWeight = <Self as frame_system::Config>::DbWeight::get();

RuntimeBenchmarkInfo { list, storage_info, max_extrinsic_weight: Some(max_extrinsic_weight), db_weight: Some(db_weight) }
}

fn dispatch_benchmark(
Expand Down
11 changes: 5 additions & 6 deletions cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,11 +661,8 @@ impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
fn benchmark_metadata(extra: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
use frame_benchmarking::{Benchmarking, BenchmarkList, RuntimeBenchmarkInfo};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand All @@ -681,7 +678,9 @@ impl_runtime_apis! {
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
(list, storage_info)
let max_extrinsic_weight = RuntimeBlockWeights::get().per_class.get(DispatchClass::Normal).max_extrinsic.unwrap();
let db_weight: frame_support::weights::RuntimeDbWeight = <Self as frame_system::Config>::DbWeight::get();
RuntimeBenchmarkInfo { list, storage_info, max_extrinsic_weight: Some(max_extrinsic_weight), db_weight: Some(db_weight) }
}

fn dispatch_benchmark(
Expand Down
13 changes: 6 additions & 7 deletions cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,20 +429,19 @@ impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
fn benchmark_metadata(extra: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
use frame_benchmarking::{Benchmarking, BenchmarkList, RuntimeBenchmarkInfo};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use sp_core::Get;

let mut list = Vec::<BenchmarkList>::new();
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();

(list, storage_info)
let max_extrinsic_weight = RuntimeBlockWeights::get().per_class.get(DispatchClass::Normal).max_extrinsic.unwrap();
let db_weight: frame_support::weights::RuntimeDbWeight = <Self as frame_system::Config>::DbWeight::get();
RuntimeBenchmarkInfo { list, storage_info, max_extrinsic_weight: Some(max_extrinsic_weight), db_weight: Some(db_weight) }
}

fn dispatch_benchmark(
Expand Down
12 changes: 6 additions & 6 deletions cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,8 @@ impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
fn benchmark_metadata(extra: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
use frame_benchmarking::{Benchmarking, BenchmarkList, RuntimeBenchmarkInfo};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand All @@ -658,7 +655,10 @@ impl_runtime_apis! {
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
(list, storage_info)
let max_extrinsic_weight = RuntimeBlockWeights::get().per_class.get(DispatchClass::Normal).max_extrinsic.unwrap();
let db_weight: frame_support::weights::RuntimeDbWeight = <Self as frame_system::Config>::DbWeight::get();

RuntimeBenchmarkInfo { list, storage_info, max_extrinsic_weight: Some(max_extrinsic_weight), db_weight: Some(db_weight) }
}

fn dispatch_benchmark(
Expand Down
11 changes: 5 additions & 6 deletions cumulus/parachains/runtimes/people/people-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,8 @@ impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
fn benchmark_metadata(extra: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
use frame_benchmarking::{Benchmarking, BenchmarkList, RuntimeBenchmarkInfo};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand All @@ -658,7 +655,9 @@ impl_runtime_apis! {
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
(list, storage_info)
let max_extrinsic_weight = RuntimeBlockWeights::get().per_class.get(DispatchClass::Normal).max_extrinsic.unwrap();
let db_weight: frame_support::weights::RuntimeDbWeight = <Self as frame_system::Config>::DbWeight::get();
RuntimeBenchmarkInfo { list, storage_info, max_extrinsic_weight: Some(max_extrinsic_weight), db_weight: Some(db_weight) }
}

fn dispatch_benchmark(
Expand Down
11 changes: 5 additions & 6 deletions cumulus/parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,8 @@ impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(extra: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
fn benchmark_metadata(extra: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
use frame_benchmarking::{Benchmarking, BenchmarkList, RuntimeBenchmarkInfo};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand All @@ -869,7 +866,9 @@ impl_runtime_apis! {
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
(list, storage_info)
let max_extrinsic_weight = RuntimeBlockWeights::get().per_class.get(DispatchClass::Normal).max_extrinsic.unwrap();
let db_weight: frame_support::weights::RuntimeDbWeight = <Self as frame_system::Config>::DbWeight::get();
RuntimeBenchmarkInfo { list, storage_info, max_extrinsic_weight: Some(max_extrinsic_weight), db_weight: Some(db_weight) }
}

fn dispatch_benchmark(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ sp_api::impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(_: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
fn benchmark_metadata(_: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
unimplemented!()
}

Expand Down
5 changes: 1 addition & 4 deletions cumulus/polkadot-parachain/src/fake_runtime_api/aura.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ sp_api::impl_runtime_apis! {

#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn benchmark_metadata(_: bool) -> (
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
fn benchmark_metadata(_: bool) -> frame_benchmarking::RuntimeBenchmarkInfo {
unimplemented!()
}

Expand Down
Loading
Loading