diff --git a/Cargo.lock b/Cargo.lock index 82d2ed1153..522314eaac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -168,7 +168,7 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "astar-collator" -version = "4.33.0" +version = "4.34.0" dependencies = [ "astar-runtime", "async-trait", @@ -258,7 +258,7 @@ dependencies = [ [[package]] name = "astar-runtime" -version = "4.33.0" +version = "4.34.0" dependencies = [ "array-bytes", "cumulus-pallet-aura-ext", @@ -4908,7 +4908,7 @@ checksum = "bb68f22743a3fb35785f1e7f844ca5a3de2dde5bd0c0ef5b372065814699b121" [[package]] name = "local-runtime" -version = "4.33.0" +version = "4.34.0" dependencies = [ "array-bytes", "fp-rpc", @@ -10813,7 +10813,7 @@ dependencies = [ [[package]] name = "shibuya-runtime" -version = "4.33.0" +version = "4.34.0" dependencies = [ "array-bytes", "cumulus-pallet-aura-ext", @@ -10911,7 +10911,7 @@ dependencies = [ [[package]] name = "shiden-runtime" -version = "4.33.0" +version = "4.34.0" dependencies = [ "array-bytes", "cumulus-pallet-aura-ext", diff --git a/bin/collator/Cargo.toml b/bin/collator/Cargo.toml index 7d594230ab..5f5bf2e8a5 100644 --- a/bin/collator/Cargo.toml +++ b/bin/collator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "astar-collator" -version = "4.33.0" +version = "4.34.0" authors = ["Stake Technologies "] description = "Astar collator implementation in Rust." build = "build.rs" diff --git a/runtime/astar/Cargo.toml b/runtime/astar/Cargo.toml index b4ded08886..87ec7a8752 100644 --- a/runtime/astar/Cargo.toml +++ b/runtime/astar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "astar-runtime" -version = "4.33.0" +version = "4.34.0" authors = ["Stake Technologies "] edition = "2021" build = "build.rs" diff --git a/runtime/astar/src/lib.rs b/runtime/astar/src/lib.rs index 83206f27a5..4f6562aa13 100644 --- a/runtime/astar/src/lib.rs +++ b/runtime/astar/src/lib.rs @@ -890,6 +890,23 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall { } } +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + [frame_benchmarking, BaselineBench::] + [frame_system, SystemBench::] + [pallet_balances, Balances] + [pallet_timestamp, Timestamp] + [pallet_dapps_staking, DappsStaking] + [pallet_block_reward, BlockReward] + [pallet_xc_asset_config, XcAssetConfig] + ); +} + impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { @@ -1172,14 +1189,13 @@ impl_runtime_apis! { Vec, Vec, ) { - use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; let mut list = Vec::::new(); - - list_benchmark!(list, extra, pallet_dapps_staking, DappsStaking); - list_benchmark!(list, extra, pallet_block_reward, BlockReward); - list_benchmark!(list, extra, pallet_xc_asset_config, XcAssetConfig); + list_benchmarks!(list, extra); let storage_info = AllPalletsWithSystem::storage_info(); @@ -1189,31 +1205,19 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; - + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; + impl frame_system_benchmarking::Config for Runtime {} + impl baseline::Config for Runtime {} - let whitelist: Vec = vec![ - // Block Number - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac"), - // Execution Phase - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a"), - // Event Count - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850"), - // System Events - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7"), - ]; + use frame_support::traits::WhitelistedStorageKeys; + let whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); let mut batches = Vec::::new(); let params = (&config, &whitelist); - - add_benchmark!(params, batches, frame_system, SystemBench::); - add_benchmark!(params, batches, pallet_balances, Balances); - add_benchmark!(params, batches, pallet_timestamp, Timestamp); - add_benchmark!(params, batches, pallet_dapps_staking, DappsStaking); - add_benchmark!(params, batches, pallet_block_reward, BlockReward); - add_benchmark!(params, batches, pallet_xc_asset_config, XcAssetConfig); + add_benchmarks!(params, batches); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) diff --git a/runtime/local/Cargo.toml b/runtime/local/Cargo.toml index 34c2a57e8d..b3529816d8 100644 --- a/runtime/local/Cargo.toml +++ b/runtime/local/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "local-runtime" -version = "4.33.0" +version = "4.34.0" authors = ["Stake Technologies "] edition = "2021" build = "build.rs" diff --git a/runtime/local/src/lib.rs b/runtime/local/src/lib.rs index a9f245530c..e511b92f93 100644 --- a/runtime/local/src/lib.rs +++ b/runtime/local/src/lib.rs @@ -1014,6 +1014,22 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall { } } +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + [frame_benchmarking, BaselineBench::] + [frame_system, SystemBench::] + [pallet_balances, Balances] + [pallet_timestamp, Timestamp] + [pallet_dapps_staking, DappsStaking] + [pallet_block_reward, BlockReward] + ); +} + impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { @@ -1372,14 +1388,13 @@ impl_runtime_apis! { Vec, Vec, ) { - use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; let mut list = Vec::::new(); - - list_benchmark!(list, extra, pallet_dapps_staking, DappsStaking); - list_benchmark!(list, extra, pallet_dapps_staking, BlockReward); - list_benchmark!(list, extra, pallet_balances, Balances); + list_benchmarks!(list, extra); let storage_info = AllPalletsWithSystem::storage_info(); @@ -1389,30 +1404,19 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; - + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; + impl frame_system_benchmarking::Config for Runtime {} + impl baseline::Config for Runtime {} - let whitelist: Vec = vec![ - // Block Number - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac"), - // Execution Phase - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a"), - // Event Count - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850"), - // System Events - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7"), - ]; + use frame_support::traits::WhitelistedStorageKeys; + let whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); let mut batches = Vec::::new(); let params = (&config, &whitelist); - - add_benchmark!(params, batches, frame_system, SystemBench::); - add_benchmark!(params, batches, pallet_balances, Balances); - add_benchmark!(params, batches, pallet_timestamp, Timestamp); - add_benchmark!(params, batches, pallet_dapps_staking, DappsStaking); - add_benchmark!(params, batches, pallet_block_reward, BlockReward); + add_benchmarks!(params, batches); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) diff --git a/runtime/shibuya/Cargo.toml b/runtime/shibuya/Cargo.toml index 1a44e298d5..ed3bf43918 100644 --- a/runtime/shibuya/Cargo.toml +++ b/runtime/shibuya/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shibuya-runtime" -version = "4.33.0" +version = "4.34.0" authors = ["Stake Technologies "] edition = "2021" build = "build.rs" diff --git a/runtime/shibuya/src/lib.rs b/runtime/shibuya/src/lib.rs index 2968d01233..3485df9a1a 100644 --- a/runtime/shibuya/src/lib.rs +++ b/runtime/shibuya/src/lib.rs @@ -1261,6 +1261,23 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall { } } +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + [frame_benchmarking, BaselineBench::] + [frame_system, SystemBench::] + [pallet_balances, Balances] + [pallet_timestamp, Timestamp] + [pallet_dapps_staking, DappsStaking] + [pallet_block_reward, BlockReward] + [pallet_xc_asset_config, XcAssetConfig] + ); +} + impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { @@ -1589,14 +1606,13 @@ impl_runtime_apis! { Vec, Vec, ) { - use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; let mut list = Vec::::new(); - - list_benchmark!(list, extra, pallet_dapps_staking, DappsStaking); - list_benchmark!(list, extra, pallet_block_reward, BlockReward); - list_benchmark!(list, extra, pallet_xc_asset_config, XcAssetConfig); + list_benchmarks!(list, extra); let storage_info = AllPalletsWithSystem::storage_info(); @@ -1606,31 +1622,19 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; - + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; + impl frame_system_benchmarking::Config for Runtime {} + impl baseline::Config for Runtime {} - let whitelist: Vec = vec![ - // Block Number - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac"), - // Execution Phase - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a"), - // Event Count - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850"), - // System Events - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7"), - ]; + use frame_support::traits::WhitelistedStorageKeys; + let whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); let mut batches = Vec::::new(); let params = (&config, &whitelist); - - add_benchmark!(params, batches, frame_system, SystemBench::); - add_benchmark!(params, batches, pallet_balances, Balances); - add_benchmark!(params, batches, pallet_timestamp, Timestamp); - add_benchmark!(params, batches, pallet_dapps_staking, DappsStaking); - add_benchmark!(params, batches, pallet_block_reward, BlockReward); - add_benchmark!(params, batches, pallet_xc_asset_config, XcAssetConfig); + add_benchmarks!(params, batches); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) diff --git a/runtime/shiden/Cargo.toml b/runtime/shiden/Cargo.toml index 6bb27b58fe..ab3cc5bbf0 100644 --- a/runtime/shiden/Cargo.toml +++ b/runtime/shiden/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shiden-runtime" -version = "4.33.0" +version = "4.34.0" authors = ["Stake Technologies "] edition = "2021" build = "build.rs" diff --git a/runtime/shiden/src/lib.rs b/runtime/shiden/src/lib.rs index 757f967579..ec2e6db177 100644 --- a/runtime/shiden/src/lib.rs +++ b/runtime/shiden/src/lib.rs @@ -939,6 +939,23 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall { } } +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + [frame_benchmarking, BaselineBench::] + [frame_system, SystemBench::] + [pallet_balances, Balances] + [pallet_timestamp, Timestamp] + [pallet_dapps_staking, DappsStaking] + [pallet_block_reward, BlockReward] + [pallet_xc_asset_config, XcAssetConfig] + ); +} + impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { @@ -1267,14 +1284,13 @@ impl_runtime_apis! { Vec, Vec, ) { - use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; let mut list = Vec::::new(); - - list_benchmark!(list, extra, pallet_dapps_staking, DappsStaking); - list_benchmark!(list, extra, pallet_block_reward, BlockReward); - list_benchmark!(list, extra, pallet_xc_asset_config, XcAssetConfig); + list_benchmarks!(list, extra); let storage_info = AllPalletsWithSystem::storage_info(); @@ -1284,31 +1300,20 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; - + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; + impl frame_system_benchmarking::Config for Runtime {} + impl baseline::Config for Runtime {} - let whitelist: Vec = vec![ - // Block Number - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac"), - // Execution Phase - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a"), - // Event Count - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850"), - // System Events - array_bytes::hex_into_unchecked("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7"), - ]; + use frame_support::traits::WhitelistedStorageKeys; + let whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); let mut batches = Vec::::new(); let params = (&config, &whitelist); - add_benchmark!(params, batches, frame_system, SystemBench::); - add_benchmark!(params, batches, pallet_balances, Balances); - add_benchmark!(params, batches, pallet_timestamp, Timestamp); - add_benchmark!(params, batches, pallet_dapps_staking, DappsStaking); - add_benchmark!(params, batches, pallet_block_reward, BlockReward); - add_benchmark!(params, batches, pallet_xc_asset_config, XcAssetConfig); + add_benchmarks!(params, batches); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches)