diff --git a/crates/subspace-runtime-primitives/src/extension.rs b/crates/subspace-runtime-primitives/src/extension.rs index 7ba3eed821..c639ae1893 100644 --- a/crates/subspace-runtime-primitives/src/extension.rs +++ b/crates/subspace-runtime-primitives/src/extension.rs @@ -1,9 +1,8 @@ #[cfg(feature = "runtime-benchmarks")] pub mod benchmarking; -pub mod weights; -use crate::extension::weights::WeightInfo as SubstrateWeightInfo; use crate::utility::{MaybeNestedCall, nested_call_iter}; +use crate::weights::balance_transfer_check_extension::WeightInfo as SubstrateWeightInfo; use core::marker::PhantomData; use frame_support::RuntimeDebugNoBound; use frame_support::pallet_prelude::Weight; diff --git a/crates/subspace-runtime-primitives/src/lib.rs b/crates/subspace-runtime-primitives/src/lib.rs index bc92cdecbd..3b576b6c28 100644 --- a/crates/subspace-runtime-primitives/src/lib.rs +++ b/crates/subspace-runtime-primitives/src/lib.rs @@ -4,6 +4,7 @@ pub mod extension; pub mod utility; +pub mod weights; #[cfg(not(feature = "std"))] extern crate alloc; diff --git a/crates/subspace-runtime-primitives/src/weights.rs b/crates/subspace-runtime-primitives/src/weights.rs new file mode 100644 index 0000000000..efb1abe492 --- /dev/null +++ b/crates/subspace-runtime-primitives/src/weights.rs @@ -0,0 +1,3 @@ +//! Shared weights for Subspace production and test runtimes. + +pub mod balance_transfer_check_extension; diff --git a/crates/subspace-runtime-primitives/src/extension/weights.rs b/crates/subspace-runtime-primitives/src/weights/balance_transfer_check_extension.rs similarity index 92% rename from crates/subspace-runtime-primitives/src/extension/weights.rs rename to crates/subspace-runtime-primitives/src/weights/balance_transfer_check_extension.rs index a4757531de..ae215988b0 100644 --- a/crates/subspace-runtime-primitives/src/extension/weights.rs +++ b/crates/subspace-runtime-primitives/src/weights/balance_transfer_check_extension.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=balance_transfer_check_extension -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime-primitives/src/extension/weights.rs +// --pallet=balance_transfer_check_extension +// --output=./crates/subspace-runtime-primitives/src/weights/balance_transfer_check_extension.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/lib.rs b/crates/subspace-runtime/src/lib.rs index c718f3e66d..2acff1e45b 100644 --- a/crates/subspace-runtime/src/lib.rs +++ b/crates/subspace-runtime/src/lib.rs @@ -1285,27 +1285,27 @@ mod benches { frame_benchmarking::define_benchmarks!( [frame_benchmarking, BaselineBench::] [frame_system, SystemBench::] + [pallet_timestamp, Timestamp] + [pallet_subspace, Subspace] + [pallet_subspace_extension, SubspaceExtensionBench::] + [pallet_rewards, Rewards] [pallet_balances, Balances] + [balance_transfer_check_extension, BalanceTransferCheckBench::] + // pallet_transaction_fees has no calls to benchmark + [pallet_transaction_payment, TransactionPayment] + [pallet_utility, Utility] [pallet_domains, Domains] - [pallet_mmr, Mmr] - [pallet_rewards, Rewards] [pallet_runtime_configs, RuntimeConfigs] - [pallet_subspace, Subspace] - [pallet_timestamp, Timestamp] + // pallet_mmr and pallet_subspace_mmr have no calls to benchmark [pallet_messenger, Messenger] - [pallet_transporter, Transporter] - [pallet_subspace_extension, SubspaceExtensionBench::] [pallet_messenger_from_domains_extension, MessengerFromDomainsExtensionBench::] - [pallet_transaction_payment, TransactionPayment] - [pallet_utility, Utility] - [pallet_sudo, Sudo] - [pallet_collective, Council] - [pallet_preimage, Preimage] + [pallet_transporter, Transporter] [pallet_scheduler, Scheduler] + [pallet_collective, Council] [pallet_democracy, Democracy] + [pallet_preimage, Preimage] [pallet_multisig, Multisig] - // TODO: benchmark this extension - [balance_transfer_check_extension, BalanceTransferCheckBench::] + [pallet_sudo, Sudo] ); } diff --git a/crates/subspace-runtime/src/weights/frame_system.rs b/crates/subspace-runtime/src/weights/frame_system.rs index 87f2125a95..4c20d7d27f 100644 --- a/crates/subspace-runtime/src/weights/frame_system.rs +++ b/crates/subspace-runtime/src/weights/frame_system.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=frame_system -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/frame_system.rs +// --pallet=frame_system +// --output=./crates/subspace-runtime/src/weights/frame_system.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_balances.rs b/crates/subspace-runtime/src/weights/pallet_balances.rs index bffd7c464d..cf9d199c3c 100644 --- a/crates/subspace-runtime/src/weights/pallet_balances.rs +++ b/crates/subspace-runtime/src/weights/pallet_balances.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_balances -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_balances.rs +// --pallet=pallet_balances +// --output=./crates/subspace-runtime/src/weights/pallet_balances.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_collective.rs b/crates/subspace-runtime/src/weights/pallet_collective.rs index 1325b036c7..ee9b71e009 100644 --- a/crates/subspace-runtime/src/weights/pallet_collective.rs +++ b/crates/subspace-runtime/src/weights/pallet_collective.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_collective -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_collective.rs +// --pallet=pallet_collective +// --output=./crates/subspace-runtime/src/weights/pallet_collective.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_domains.rs b/crates/subspace-runtime/src/weights/pallet_domains.rs index a15f0f9e2c..6a184de769 100644 --- a/crates/subspace-runtime/src/weights/pallet_domains.rs +++ b/crates/subspace-runtime/src/weights/pallet_domains.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_domains -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_domains.rs +// --pallet=pallet_domains +// --output=./crates/subspace-runtime/src/weights/pallet_domains.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_messenger.rs b/crates/subspace-runtime/src/weights/pallet_messenger.rs index 0047dfafb8..4b0b47ce2c 100644 --- a/crates/subspace-runtime/src/weights/pallet_messenger.rs +++ b/crates/subspace-runtime/src/weights/pallet_messenger.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_messenger -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_messenger.rs +// --pallet=pallet_messenger +// --output=./crates/subspace-runtime/src/weights/pallet_messenger.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_messenger_from_domains_extension.rs b/crates/subspace-runtime/src/weights/pallet_messenger_from_domains_extension.rs index edfc9a28e3..b73ae2c58f 100644 --- a/crates/subspace-runtime/src/weights/pallet_messenger_from_domains_extension.rs +++ b/crates/subspace-runtime/src/weights/pallet_messenger_from_domains_extension.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_messenger_from_domains_extension -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_messenger_from_domains_extension.rs +// --pallet=pallet_messenger_from_domains_extension +// --output=./crates/subspace-runtime/src/weights/pallet_messenger_from_domains_extension.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_multisig.rs b/crates/subspace-runtime/src/weights/pallet_multisig.rs index e3195dfae3..76a7b468dc 100644 --- a/crates/subspace-runtime/src/weights/pallet_multisig.rs +++ b/crates/subspace-runtime/src/weights/pallet_multisig.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_multisig -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_multisig.rs +// --pallet=pallet_multisig +// --output=./crates/subspace-runtime/src/weights/pallet_multisig.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_preimage.rs b/crates/subspace-runtime/src/weights/pallet_preimage.rs index bf4e04e45a..5b70c63210 100644 --- a/crates/subspace-runtime/src/weights/pallet_preimage.rs +++ b/crates/subspace-runtime/src/weights/pallet_preimage.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_preimage -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_preimage.rs +// --pallet=pallet_preimage +// --output=./crates/subspace-runtime/src/weights/pallet_preimage.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_rewards.rs b/crates/subspace-runtime/src/weights/pallet_rewards.rs index cfde6a539b..ba749f46d6 100644 --- a/crates/subspace-runtime/src/weights/pallet_rewards.rs +++ b/crates/subspace-runtime/src/weights/pallet_rewards.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_rewards -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_rewards.rs +// --pallet=pallet_rewards +// --output=./crates/subspace-runtime/src/weights/pallet_rewards.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_runtime_configs.rs b/crates/subspace-runtime/src/weights/pallet_runtime_configs.rs index 6f153f54ba..342dffc395 100644 --- a/crates/subspace-runtime/src/weights/pallet_runtime_configs.rs +++ b/crates/subspace-runtime/src/weights/pallet_runtime_configs.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_runtime_configs -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_runtime_configs.rs +// --pallet=pallet_runtime_configs +// --output=./crates/subspace-runtime/src/weights/pallet_runtime_configs.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_scheduler.rs b/crates/subspace-runtime/src/weights/pallet_scheduler.rs index 0587f989be..ba1d20ad56 100644 --- a/crates/subspace-runtime/src/weights/pallet_scheduler.rs +++ b/crates/subspace-runtime/src/weights/pallet_scheduler.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_scheduler -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_scheduler.rs +// --pallet=pallet_scheduler +// --output=./crates/subspace-runtime/src/weights/pallet_scheduler.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_subspace.rs b/crates/subspace-runtime/src/weights/pallet_subspace.rs index 3c63234890..1331393410 100644 --- a/crates/subspace-runtime/src/weights/pallet_subspace.rs +++ b/crates/subspace-runtime/src/weights/pallet_subspace.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_subspace -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_subspace.rs +// --pallet=pallet_subspace +// --output=./crates/subspace-runtime/src/weights/pallet_subspace.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_subspace_extension.rs b/crates/subspace-runtime/src/weights/pallet_subspace_extension.rs index f97ffcdf4d..1f2a7faa9e 100644 --- a/crates/subspace-runtime/src/weights/pallet_subspace_extension.rs +++ b/crates/subspace-runtime/src/weights/pallet_subspace_extension.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_subspace_extension -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_subspace_extension.rs +// --pallet=pallet_subspace_extension +// --output=./crates/subspace-runtime/src/weights/pallet_subspace_extension.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_sudo.rs b/crates/subspace-runtime/src/weights/pallet_sudo.rs index 60dec420f6..4409f097d3 100644 --- a/crates/subspace-runtime/src/weights/pallet_sudo.rs +++ b/crates/subspace-runtime/src/weights/pallet_sudo.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_sudo -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_sudo.rs +// --pallet=pallet_sudo +// --output=./crates/subspace-runtime/src/weights/pallet_sudo.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_timestamp.rs b/crates/subspace-runtime/src/weights/pallet_timestamp.rs index 1a8673ee8e..3ba02a393c 100644 --- a/crates/subspace-runtime/src/weights/pallet_timestamp.rs +++ b/crates/subspace-runtime/src/weights/pallet_timestamp.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_timestamp -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_timestamp.rs +// --pallet=pallet_timestamp +// --output=./crates/subspace-runtime/src/weights/pallet_timestamp.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_transaction_payment.rs b/crates/subspace-runtime/src/weights/pallet_transaction_payment.rs index b02813b4b4..51bd63a8dc 100644 --- a/crates/subspace-runtime/src/weights/pallet_transaction_payment.rs +++ b/crates/subspace-runtime/src/weights/pallet_transaction_payment.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_transaction_payment -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_transaction_payment.rs +// --pallet=pallet_transaction_payment +// --output=./crates/subspace-runtime/src/weights/pallet_transaction_payment.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_transporter.rs b/crates/subspace-runtime/src/weights/pallet_transporter.rs index f4305af40f..39b47790e9 100644 --- a/crates/subspace-runtime/src/weights/pallet_transporter.rs +++ b/crates/subspace-runtime/src/weights/pallet_transporter.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_transporter -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_transporter.rs +// --pallet=pallet_transporter +// --output=./crates/subspace-runtime/src/weights/pallet_transporter.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/crates/subspace-runtime/src/weights/pallet_utility.rs b/crates/subspace-runtime/src/weights/pallet_utility.rs index cecc688873..f4f9d315a4 100644 --- a/crates/subspace-runtime/src/weights/pallet_utility.rs +++ b/crates/subspace-runtime/src/weights/pallet_utility.rs @@ -8,18 +8,18 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // benchmark // pallet -// --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_utility -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./crates/subspace-runtime/src/weights-tmp/pallet_utility.rs +// --pallet=pallet_utility +// --output=./crates/subspace-runtime/src/weights/pallet_utility.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/pallets/evm-tracker/src/create_contract.rs b/domains/pallets/evm-tracker/src/create_contract.rs index d142e9e8c9..6f656237b1 100644 --- a/domains/pallets/evm-tracker/src/create_contract.rs +++ b/domains/pallets/evm-tracker/src/create_contract.rs @@ -1,7 +1,7 @@ //! Contract creation allow list implementations use crate::traits::{AccountIdFor, MaybeIntoEthCall, MaybeIntoEvmCall}; -use crate::weights::SubstrateWeightInfo; +use crate::weights::pallet_evm_tracker::WeightInfo as SubstrateWeightInfo; use crate::{MAXIMUM_NUMBER_OF_CALLS, WeightInfo}; use domain_runtime_primitives::{ERR_CONTRACT_CREATION_NOT_ALLOWED, EthereumAccountId}; use frame_support::RuntimeDebugNoBound; diff --git a/domains/pallets/evm-tracker/src/weights.rs b/domains/pallets/evm-tracker/src/weights.rs index 0ad15b2fe0..f80a3453fa 100644 --- a/domains/pallets/evm-tracker/src/weights.rs +++ b/domains/pallets/evm-tracker/src/weights.rs @@ -1,67 +1,3 @@ +//! Shared weights for pallet_evm_tracker, used in production and test runtimes. -//! Autogenerated weights for `pallet_evm_tracker` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 46.2.0 -//! DATE: 2025-06-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `MacBook-Pro`, CPU: `M1 Max` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// ./target/release/subspace-node -// domain -// benchmark -// pallet -// --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm -// --genesis-builder=none -// --steps=50 -// --repeat=20 -// --pallet=pallet_evm_tracker -// --extrinsic=* -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=./domains/pallets/evm-tracker/src/weights.rs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -// Manually added import -use crate as pallet_evm_tracker; - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weight functions for `pallet_evm_tracker`. -pub struct SubstrateWeightInfo(PhantomData); -impl pallet_evm_tracker::WeightInfo for SubstrateWeightInfo { - /// Storage: `EVMNoncetracker::ContractCreationAllowedBy` (r:1 w:0) - /// Proof: `EVMNoncetracker::ContractCreationAllowedBy` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `c` is `[0, 5000]`. - fn evm_contract_check_multiple(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `209` - // Estimated: `1694` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(3_468_459, 0) - .saturating_add(Weight::from_parts(0, 1694)) - // Standard Error: 67 - .saturating_add(Weight::from_parts(8_703, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `EVMNoncetracker::ContractCreationAllowedBy` (r:1 w:0) - /// Proof: `EVMNoncetracker::ContractCreationAllowedBy` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `c` is `[0, 1300]`. - fn evm_contract_check_nested(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `209` - // Estimated: `1694` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(3_485_601, 0) - .saturating_add(Weight::from_parts(0, 1694)) - // Standard Error: 626 - .saturating_add(Weight::from_parts(114_709, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(1)) - } -} +pub mod pallet_evm_tracker; diff --git a/domains/pallets/evm-tracker/src/weights/pallet_evm_tracker.rs b/domains/pallets/evm-tracker/src/weights/pallet_evm_tracker.rs new file mode 100644 index 0000000000..38b6c720cd --- /dev/null +++ b/domains/pallets/evm-tracker/src/weights/pallet_evm_tracker.rs @@ -0,0 +1,64 @@ + +//! Autogenerated weights for `pallet_evm_tracker` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 46.2.0 +//! DATE: 2025-06-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `MacBook-Pro`, CPU: `M1 Max` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// ./target/production/subspace-node +// domain +// benchmark +// pallet +// --runtime=./target/production/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled +// --genesis-builder=none +// --steps=50 +// --repeat=20 +// --heap-pages=4096 +// --pallet=pallet_evm_tracker +// --output=./domains/pallets/evm-tracker/src/weights/pallet_evm_tracker.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_evm_tracker`. +pub struct WeightInfo(PhantomData); +impl crate::WeightInfo for WeightInfo { + /// Storage: `EVMNoncetracker::ContractCreationAllowedBy` (r:1 w:0) + /// Proof: `EVMNoncetracker::ContractCreationAllowedBy` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// The range of component `c` is `[0, 5000]`. + fn evm_contract_check_multiple(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `209` + // Estimated: `1694` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_468_459, 0) + .saturating_add(Weight::from_parts(0, 1694)) + // Standard Error: 67 + .saturating_add(Weight::from_parts(8_703, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(1)) + } + /// Storage: `EVMNoncetracker::ContractCreationAllowedBy` (r:1 w:0) + /// Proof: `EVMNoncetracker::ContractCreationAllowedBy` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// The range of component `c` is `[0, 1300]`. + fn evm_contract_check_nested(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `209` + // Estimated: `1694` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_485_601, 0) + .saturating_add(Weight::from_parts(0, 1694)) + // Standard Error: 626 + .saturating_add(Weight::from_parts(114_709, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(1)) + } +} diff --git a/domains/runtime/auto-id/src/lib.rs b/domains/runtime/auto-id/src/lib.rs index 9d33c1c43c..242f33b686 100644 --- a/domains/runtime/auto-id/src/lib.rs +++ b/domains/runtime/auto-id/src/lib.rs @@ -663,16 +663,19 @@ mod benches { frame_benchmarking::define_benchmarks!( [frame_benchmarking, BaselineBench::] [frame_system, SystemBench::] + [pallet_timestamp, Timestamp] [domain_pallet_executive, ExecutivePallet] + [pallet_utility, Utility] + [pallet_balances, Balances] + [pallet_transaction_payment, TransactionPayment] + [pallet_auto_id, AutoId] [pallet_messenger, Messenger] [pallet_messenger_from_consensus_extension, MessengerFromConsensusExtensionBench::] [pallet_messenger_between_domains_extension, MessengerBetweenDomainsExtensionBench::] - [pallet_auto_id, AutoId] - [pallet_timestamp, Timestamp] - [pallet_utility, Utility] - [pallet_balances, Balances] [pallet_transporter, Transporter] - [pallet_transaction_payment, TransactionPayment] + // pallet_domain_id has no calls to benchmark + // pallet_block_fees only has inherent calls + // pallet_domain_sudo only has inherent calls ); } diff --git a/domains/runtime/auto-id/src/weights/domain_pallet_executive.rs b/domains/runtime/auto-id/src/weights/domain_pallet_executive.rs index fd042d9000..5de723f741 100644 --- a/domains/runtime/auto-id/src/weights/domain_pallet_executive.rs +++ b/domains/runtime/auto-id/src/weights/domain_pallet_executive.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=domain_pallet_executive -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/auto-id/src/weights-tmp/domain_pallet_executive.rs +// --pallet=domain_pallet_executive +// --output=./domains/runtime/auto-id/src/weights/domain_pallet_executive.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/auto-id/src/weights/frame_system.rs b/domains/runtime/auto-id/src/weights/frame_system.rs index 91f90ca354..c5866c7446 100644 --- a/domains/runtime/auto-id/src/weights/frame_system.rs +++ b/domains/runtime/auto-id/src/weights/frame_system.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=frame_system -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/auto-id/src/weights-tmp/frame_system.rs +// --pallet=frame_system +// --output=./domains/runtime/auto-id/src/weights/frame_system.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/auto-id/src/weights/pallet_auto_id.rs b/domains/runtime/auto-id/src/weights/pallet_auto_id.rs index 4f9b25852f..4c360d1c8f 100644 --- a/domains/runtime/auto-id/src/weights/pallet_auto_id.rs +++ b/domains/runtime/auto-id/src/weights/pallet_auto_id.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_auto_id -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/auto-id/src/weights-tmp/pallet_auto_id.rs +// --pallet=pallet_auto_id +// --output=./domains/runtime/auto-id/src/weights/pallet_auto_id.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/auto-id/src/weights/pallet_balances.rs b/domains/runtime/auto-id/src/weights/pallet_balances.rs index ca770c6161..908d399ec0 100644 --- a/domains/runtime/auto-id/src/weights/pallet_balances.rs +++ b/domains/runtime/auto-id/src/weights/pallet_balances.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_balances -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/auto-id/src/weights-tmp/pallet_balances.rs +// --pallet=pallet_balances +// --output=./domains/runtime/auto-id/src/weights/pallet_balances.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/auto-id/src/weights/pallet_messenger.rs b/domains/runtime/auto-id/src/weights/pallet_messenger.rs index 43c95fdbd3..fe22cad46d 100644 --- a/domains/runtime/auto-id/src/weights/pallet_messenger.rs +++ b/domains/runtime/auto-id/src/weights/pallet_messenger.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_messenger -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/auto-id/src/weights-tmp/pallet_messenger.rs +// --pallet=pallet_messenger +// --output=./domains/runtime/auto-id/src/weights/pallet_messenger.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/auto-id/src/weights/pallet_messenger_between_domains_extension.rs b/domains/runtime/auto-id/src/weights/pallet_messenger_between_domains_extension.rs index b7233b44d2..548bcfc15e 100644 --- a/domains/runtime/auto-id/src/weights/pallet_messenger_between_domains_extension.rs +++ b/domains/runtime/auto-id/src/weights/pallet_messenger_between_domains_extension.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_messenger_between_domains_extension -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/auto-id/src/weights-tmp/pallet_messenger_between_domains_extension.rs +// --pallet=pallet_messenger_between_domains_extension +// --output=./domains/runtime/auto-id/src/weights/pallet_messenger_between_domains_extension.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/auto-id/src/weights/pallet_messenger_from_consensus_extension.rs b/domains/runtime/auto-id/src/weights/pallet_messenger_from_consensus_extension.rs index e2e3a61c65..0379f23ee9 100644 --- a/domains/runtime/auto-id/src/weights/pallet_messenger_from_consensus_extension.rs +++ b/domains/runtime/auto-id/src/weights/pallet_messenger_from_consensus_extension.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_messenger_from_consensus_extension -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/auto-id/src/weights-tmp/pallet_messenger_from_consensus_extension.rs +// --pallet=pallet_messenger_from_consensus_extension +// --output=./domains/runtime/auto-id/src/weights/pallet_messenger_from_consensus_extension.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/auto-id/src/weights/pallet_timestamp.rs b/domains/runtime/auto-id/src/weights/pallet_timestamp.rs index e3d1efb836..273f9b35c5 100644 --- a/domains/runtime/auto-id/src/weights/pallet_timestamp.rs +++ b/domains/runtime/auto-id/src/weights/pallet_timestamp.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_timestamp -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/auto-id/src/weights-tmp/pallet_timestamp.rs +// --pallet=pallet_timestamp +// --output=./domains/runtime/auto-id/src/weights/pallet_timestamp.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/auto-id/src/weights/pallet_transaction_payment.rs b/domains/runtime/auto-id/src/weights/pallet_transaction_payment.rs index 98da4a3fe6..6f185a72ea 100644 --- a/domains/runtime/auto-id/src/weights/pallet_transaction_payment.rs +++ b/domains/runtime/auto-id/src/weights/pallet_transaction_payment.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_transaction_payment -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/auto-id/src/weights-tmp/pallet_transaction_payment.rs +// --pallet=pallet_transaction_payment +// --output=./domains/runtime/auto-id/src/weights/pallet_transaction_payment.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/auto-id/src/weights/pallet_transporter.rs b/domains/runtime/auto-id/src/weights/pallet_transporter.rs index a92ec87996..f64a32255c 100644 --- a/domains/runtime/auto-id/src/weights/pallet_transporter.rs +++ b/domains/runtime/auto-id/src/weights/pallet_transporter.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_transporter -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/auto-id/src/weights-tmp/pallet_transporter.rs +// --pallet=pallet_transporter +// --output=./domains/runtime/auto-id/src/weights/pallet_transporter.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/auto-id/src/weights/pallet_utility.rs b/domains/runtime/auto-id/src/weights/pallet_utility.rs index 7e0342078f..ada09567a1 100644 --- a/domains/runtime/auto-id/src/weights/pallet_utility.rs +++ b/domains/runtime/auto-id/src/weights/pallet_utility.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_utility -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/auto-id/src/weights-tmp/pallet_utility.rs +// --pallet=pallet_utility +// --output=./domains/runtime/auto-id/src/weights/pallet_utility.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/evm/src/lib.rs b/domains/runtime/evm/src/lib.rs index 9e47833b63..b8a074cb86 100644 --- a/domains/runtime/evm/src/lib.rs +++ b/domains/runtime/evm/src/lib.rs @@ -1006,17 +1006,23 @@ mod benches { frame_benchmarking::define_benchmarks!( [frame_benchmarking, BaselineBench::] [frame_system, SystemBench::] + [pallet_timestamp, Timestamp] [domain_pallet_executive, ExecutivePallet] + [pallet_utility, Utility] + [pallet_balances, Balances] + [pallet_transaction_payment, TransactionPayment] [pallet_messenger, Messenger] [pallet_messenger_from_consensus_extension, MessengerFromConsensusExtensionBench::] - [pallet_evm_tracker, EVMNoncetracker] [pallet_messenger_between_domains_extension, MessengerBetweenDomainsExtensionBench::] - [pallet_timestamp, Timestamp] - [pallet_utility, Utility] - [pallet_balances, Balances] [pallet_transporter, Transporter] + // pallet_ethereum uses `pallet_evm::Config::GasWeightMapping::gas_to_weight` to weight its calls [pallet_evm, EVM] - [pallet_transaction_payment, TransactionPayment] + // pallet_evm_chain_id has no calls to benchmark + [pallet_evm_tracker, EVMNoncetracker] + // TODO: pallet_evm_tracker CheckNonce extension benchmarks + // pallet_domain_id has no calls to benchmark + // pallet_block_fees only has inherent calls + // pallet_domain_sudo only has inherent calls ); } diff --git a/domains/runtime/evm/src/weights/domain_pallet_executive.rs b/domains/runtime/evm/src/weights/domain_pallet_executive.rs index 4bf732128a..2d0ab64528 100644 --- a/domains/runtime/evm/src/weights/domain_pallet_executive.rs +++ b/domains/runtime/evm/src/weights/domain_pallet_executive.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=domain_pallet_executive -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/evm/src/weights-tmp/domain_pallet_executive.rs +// --pallet=domain_pallet_executive +// --output=./domains/runtime/evm/src/weights/domain_pallet_executive.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/evm/src/weights/frame_system.rs b/domains/runtime/evm/src/weights/frame_system.rs index 210c2dab0a..3c0596d949 100644 --- a/domains/runtime/evm/src/weights/frame_system.rs +++ b/domains/runtime/evm/src/weights/frame_system.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=frame_system -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/evm/src/weights-tmp/frame_system.rs +// --pallet=frame_system +// --output=./domains/runtime/evm/src/weights/frame_system.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/evm/src/weights/pallet_balances.rs b/domains/runtime/evm/src/weights/pallet_balances.rs index 2c5e6f7e3b..e95ef25e81 100644 --- a/domains/runtime/evm/src/weights/pallet_balances.rs +++ b/domains/runtime/evm/src/weights/pallet_balances.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_balances -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/evm/src/weights-tmp/pallet_balances.rs +// --pallet=pallet_balances +// --output=./domains/runtime/evm/src/weights/pallet_balances.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/evm/src/weights/pallet_evm.rs b/domains/runtime/evm/src/weights/pallet_evm.rs index 3e176abbcd..712334565a 100644 --- a/domains/runtime/evm/src/weights/pallet_evm.rs +++ b/domains/runtime/evm/src/weights/pallet_evm.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_evm -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/evm/src/weights-tmp/pallet_evm.rs +// --pallet=pallet_evm +// --output=./domains/runtime/evm/src/weights/pallet_evm.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/evm/src/weights/pallet_messenger.rs b/domains/runtime/evm/src/weights/pallet_messenger.rs index 46f60224a9..abab88da9a 100644 --- a/domains/runtime/evm/src/weights/pallet_messenger.rs +++ b/domains/runtime/evm/src/weights/pallet_messenger.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_messenger -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/evm/src/weights-tmp/pallet_messenger.rs +// --pallet=pallet_messenger +// --output=./domains/runtime/evm/src/weights/pallet_messenger.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/evm/src/weights/pallet_messenger_between_domains_extension.rs b/domains/runtime/evm/src/weights/pallet_messenger_between_domains_extension.rs index 49e118c51c..57f717b05e 100644 --- a/domains/runtime/evm/src/weights/pallet_messenger_between_domains_extension.rs +++ b/domains/runtime/evm/src/weights/pallet_messenger_between_domains_extension.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_messenger_between_domains_extension -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/evm/src/weights-tmp/pallet_messenger_between_domains_extension.rs +// --pallet=pallet_messenger_between_domains_extension +// --output=./domains/runtime/evm/src/weights/pallet_messenger_between_domains_extension.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/evm/src/weights/pallet_messenger_from_consensus_extension.rs b/domains/runtime/evm/src/weights/pallet_messenger_from_consensus_extension.rs index b077614a94..6e6b3a4839 100644 --- a/domains/runtime/evm/src/weights/pallet_messenger_from_consensus_extension.rs +++ b/domains/runtime/evm/src/weights/pallet_messenger_from_consensus_extension.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_messenger_from_consensus_extension -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/evm/src/weights-tmp/pallet_messenger_from_consensus_extension.rs +// --pallet=pallet_messenger_from_consensus_extension +// --output=./domains/runtime/evm/src/weights/pallet_messenger_from_consensus_extension.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/evm/src/weights/pallet_timestamp.rs b/domains/runtime/evm/src/weights/pallet_timestamp.rs index cb1d58e812..fdbc5696b6 100644 --- a/domains/runtime/evm/src/weights/pallet_timestamp.rs +++ b/domains/runtime/evm/src/weights/pallet_timestamp.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_timestamp -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/evm/src/weights-tmp/pallet_timestamp.rs +// --pallet=pallet_timestamp +// --output=./domains/runtime/evm/src/weights/pallet_timestamp.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/evm/src/weights/pallet_transaction_payment.rs b/domains/runtime/evm/src/weights/pallet_transaction_payment.rs index 1fa01191e6..5189176019 100644 --- a/domains/runtime/evm/src/weights/pallet_transaction_payment.rs +++ b/domains/runtime/evm/src/weights/pallet_transaction_payment.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_transaction_payment -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/evm/src/weights-tmp/pallet_transaction_payment.rs +// --pallet=pallet_transaction_payment +// --output=./domains/runtime/evm/src/weights/pallet_transaction_payment.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/evm/src/weights/pallet_transporter.rs b/domains/runtime/evm/src/weights/pallet_transporter.rs index 073a0d2bd2..493b70810e 100644 --- a/domains/runtime/evm/src/weights/pallet_transporter.rs +++ b/domains/runtime/evm/src/weights/pallet_transporter.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_transporter -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/evm/src/weights-tmp/pallet_transporter.rs +// --pallet=pallet_transporter +// --output=./domains/runtime/evm/src/weights/pallet_transporter.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/domains/runtime/evm/src/weights/pallet_utility.rs b/domains/runtime/evm/src/weights/pallet_utility.rs index 96382bc667..bf71ae959a 100644 --- a/domains/runtime/evm/src/weights/pallet_utility.rs +++ b/domains/runtime/evm/src/weights/pallet_utility.rs @@ -8,19 +8,19 @@ //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/release/subspace-node +// ./target/production/subspace-node // domain // benchmark // pallet -// --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --runtime=./target/production/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm +// --extrinsic=* +// --wasm-execution=compiled // --genesis-builder=none // --steps=50 // --repeat=20 -// --pallet=pallet_utility -// --extrinsic=* -// --wasm-execution=compiled // --heap-pages=4096 -// --output=./domains/runtime/evm/src/weights-tmp/pallet_utility.rs +// --pallet=pallet_utility +// --output=./domains/runtime/evm/src/weights/pallet_utility.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] diff --git a/runtime-benchmark.sh b/runtime-benchmark.sh index 12a869f0fc..8150044a6c 100755 --- a/runtime-benchmark.sh +++ b/runtime-benchmark.sh @@ -1,84 +1,147 @@ -#!/bin/bash -e +#!/usr/bin/env bash -profile="production" -features="runtime-benchmarks" +# http://redsymbol.net/articles/unofficial-bash-strict-mode/ +set -euo pipefail -cargo build --profile $profile --bin subspace-node --features $features +PROFILE="production" +FEATURES="runtime-benchmarks" +# While testing the script, use --steps=2 --repeat=1 for quick but inaccurate benchmarks +BENCH_SETTINGS="--extrinsic=* --wasm-execution=compiled --genesis-builder=none --steps=50 --repeat=20 --heap-pages=4096" +# If you're sure the node and runtime binaries are up to date, set this to true to save rebuild and +# linking time +SKIP_BUILDS="false" -cargo build --profile $profile --package subspace-runtime --features $features -subspace_runtime_pallets=( - "frame_system" - "pallet_balances" - "pallet_domains" - "pallet_rewards" - "pallet_runtime_configs" - "pallet_subspace" - "pallet_timestamp" - "pallet_messenger" - "pallet_transporter" - "pallet_subspace_extension" - "pallet_messenger_from_domains_extension" - "pallet_transaction_payment" - "pallet_utility" - "pallet_sudo" - "pallet_collective" - "pallet_preimage" - "pallet_scheduler" - "pallet_multisig" - # TODO: `pallet_democracy` benchmark are broken, need investigation - # "pallet_democracy" +# This function searches through a runtime lib.rs file for benchmark definitions +function find_benchmarks () { + grep '\[[a-z0-9_]*, [A-Za-z0-9:<>]*\]' | cut -d, -f1 | cut -d[ -f2 +} + +if [[ ! -d "./crates/subspace-runtime/src/weights" ]] || [[ ! -d "./domains/runtime/evm/src/weights" ]] || [[ ! -d "./domains/runtime/auto-id/src/weights" ]]; then + echo "Missing ./crates/subspace-runtime/src/weights, ./domains/runtime/evm/src/weights or ./domains/runtime/auto-id/src/weights directories" + echo "This script must be run from the base of an autonomys/subspace repository checkout" + exit 1 +fi + +if [[ "$SKIP_BUILDS" != 'true' ]]; then + # The node builds all the runtimes, and generating weights will rebuild some runtimes, even though + # those weights are not used in the benchmarks. So it is faster to build everything upfront. + echo "Building subspace-node and runtimes with profile: '$PROFILE' and features: '$FEATURES'..." + # Show commands before executing them + set -x + cargo build --profile "$PROFILE" --bin subspace-node --features "$FEATURES" + cargo build --profile "$PROFILE" --package subspace-runtime --features "$FEATURES" + cargo build --profile "$PROFILE" --package evm-domain-runtime --features "$FEATURES" + cargo build --profile "$PROFILE" --package auto-id-domain-runtime --features "$FEATURES" + set +x +else + echo "Skipping builds of subspace-node and runtimes" +fi + +echo "Generating weights for Subspace runtime..." +# frame_benchmarking is unused, it contains benchmarks for hashing and sr25519_verification +# TODO: `pallet_democracy` benchmark are broken, need investigation +SUBSPACE_RUNTIME_PALLETS=$(cat ./crates/subspace-runtime/src/lib.rs | \ + find_benchmarks | \ + grep -v -e "frame_benchmarking" -e "balance_transfer_check_extension" -e "pallet_democracy" +) +echo "Pallet list: $SUBSPACE_RUNTIME_PALLETS" +for PALLET in $SUBSPACE_RUNTIME_PALLETS; do + CMD="./target/$PROFILE/subspace-node benchmark pallet \ + --runtime=./target/$PROFILE/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm \ + $BENCH_SETTINGS \ + --pallet=$PALLET --output=./crates/subspace-runtime/src/weights/$PALLET.rs" + echo "$CMD" + $CMD +done + +echo "Fixing pallet names in weights for Subspace runtime..." +set -x +sed -i "" -e "s/pallet_subspace_extension::WeightInfo/pallet_subspace::extensions::WeightInfo/g" \ + ./crates/subspace-runtime/src/weights/pallet_subspace_extension.rs +sed -i "" -e "s/pallet_messenger_from_domains_extension::WeightInfo/pallet_messenger::extensions::FromDomainWeightInfo/g" \ + ./crates/subspace-runtime/src/weights/pallet_messenger_from_domains_extension.rs +set +x + +# These extension weights are written to subspace-runtime-primitives +# TODO: move these extensions to subspace-runtime, and use default weights in test runtimes +SUBSPACE_RUNTIME_PRIMITIVES=( + "balance_transfer_check_extension" ) -for pallet in "${subspace_runtime_pallets[@]}"; do - cmd="./target/release/subspace-node benchmark pallet \ - --runtime=./target/release/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm \ - --genesis-builder=none --steps=50 --repeat=20 --pallet=$pallet --extrinsic=* --wasm-execution=compiled \ - --heap-pages=4096 --output=./crates/subspace-runtime/src/weights/$pallet.rs" - echo $cmd - $cmd +echo "Primitives Pallet list: ${SUBSPACE_RUNTIME_PRIMITIVES[@]}" +for PALLET in "${SUBSPACE_RUNTIME_PRIMITIVES[@]}"; do + CMD="./target/$PROFILE/subspace-node benchmark pallet \ + --runtime=./target/$PROFILE/wbuild/subspace-runtime/subspace_runtime.compact.compressed.wasm \ + $BENCH_SETTINGS \ + --pallet=$PALLET --output=./crates/subspace-runtime-primitives/src/weights/$PALLET.rs" + echo "$CMD" + $CMD done -cargo build --profile $profile --package evm-domain-runtime --features $features -evm_domain_runtime_pallets=( - "frame_system" - "domain_pallet_executive" - "pallet_messenger" - "pallet_messenger_from_consensus_extension" - "pallet_messenger_between_domains_extension" - "pallet_timestamp" - "pallet_utility" - "pallet_balances" - "pallet_transporter" - "pallet_evm" - "pallet_transaction_payment" +echo "Fixing pallet names in weights for Subspace runtime primitives..." +set -x +sed -i "" -e "s/balance_transfer_check_extension::WeightInfo/crate::extension::WeightInfo/g" \ + ./crates/subspace-runtime-primitives/src/weights/balance_transfer_check_extension.rs +set +x + +echo "Generating weights for EVM domain runtime..." +EVM_DOMAIN_RUNTIME_PALLETS=$(cat domains/runtime/evm/src/lib.rs | \ + find_benchmarks | \ + grep -v -e "frame_benchmarking" -e "pallet_evm_tracker" ) -for pallet in "${evm_domain_runtime_pallets[@]}"; do - cmd="./target/release/subspace-node domain benchmark pallet \ - --runtime=./target/release/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm \ - --genesis-builder=none --steps=50 --repeat=20 --pallet=$pallet --extrinsic=* --wasm-execution=compiled \ - --heap-pages=4096 --output=./domains/runtime/evm/src/weights/$pallet.rs" - echo $cmd - $cmd +echo "Pallet list: $EVM_DOMAIN_RUNTIME_PALLETS" +for PALLET in $EVM_DOMAIN_RUNTIME_PALLETS; do + CMD="./target/$PROFILE/subspace-node domain benchmark pallet \ + --runtime=./target/$PROFILE/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm \ + $BENCH_SETTINGS \ + --pallet=$PALLET --output=./domains/runtime/evm/src/weights/$PALLET.rs" + echo "$CMD" + $CMD done -cargo build --profile $profile --package auto-id-domain-runtime --features $features -auto_id_domain_runtime_pallets=( - "frame_system" - "domain_pallet_executive" - "pallet_messenger" - "pallet_messenger_from_consensus_extension" - "pallet_messenger_between_domains_extension" - "pallet_auto_id" - "pallet_timestamp" - "pallet_utility" - "pallet_balances" - "pallet_transporter" - "pallet_transaction_payment" +# These extension weights are written to pallet-evm-tracker +# TODO: move these weights to evm-domain-runtime, and use default weights in test runtimes +# TODO: pallet_evm_tracker CheckNonce extension benchmarks +PALLET="pallet_evm_tracker" +echo "EVM Tracker Pallet name: $PALLET" +CMD="./target/$PROFILE/subspace-node domain benchmark pallet \ + --runtime=./target/$PROFILE/wbuild/evm-domain-runtime/evm_domain_runtime.compact.compressed.wasm \ + $BENCH_SETTINGS \ + --pallet=$PALLET --output=./domains/pallets/evm-tracker/src/weights/$PALLET.rs" +echo "$CMD" +$CMD + +echo "Fixing pallet names in weights for $PALLET..." +set -x +sed -i "" -e "s/pallet_evm_tracker::WeightInfo/crate::WeightInfo/g" \ + ./domains/pallets/evm-tracker/src/weights/pallet_evm_tracker.rs +set +x + +echo "Generating weights for Auto ID domain runtime..." +AUTO_ID_DOMAIN_RUNTIME_PALLETS=$(cat domains/runtime/auto-id/src/lib.rs | \ + find_benchmarks | \ + grep -v -e "frame_benchmarking" ) -for pallet in "${auto_id_domain_runtime_pallets[@]}"; do - cmd="./target/release/subspace-node domain benchmark pallet \ - --runtime=./target/release/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm \ - --genesis-builder=none --steps=50 --repeat=20 --pallet=$pallet --extrinsic=* --wasm-execution=compiled \ - --heap-pages=4096 --output=./domains/runtime/auto-id/src/weights/$pallet.rs" - echo $cmd - $cmd +echo "Pallet list: $AUTO_ID_DOMAIN_RUNTIME_PALLETS" +for PALLET in $AUTO_ID_DOMAIN_RUNTIME_PALLETS; do + CMD="./target/$PROFILE/subspace-node domain benchmark pallet \ + --runtime=./target/$PROFILE/wbuild/auto-id-domain-runtime/auto_id_domain_runtime.compact.compressed.wasm \ + $BENCH_SETTINGS \ + --pallet=$PALLET --output=./domains/runtime/auto-id/src/weights/$PALLET.rs" + echo "$CMD" + $CMD done + +echo "Fixing pallet names in weights for domain runtimes..." +# These replacements work for both EVM and Auto ID domain runtimes +set -x +sed -i "" -e "s/pallet_messenger_from_consensus_extension::WeightInfo/pallet_messenger::extensions::FromConsensusWeightInfo/g" \ + ./domains/runtime/*/src/weights/pallet_messenger_from_consensus_extension.rs +sed -i "" -e "s/pallet_messenger_between_domains_extension::WeightInfo/pallet_messenger::extensions::FromDomainWeightInfo/g" \ + ./domains/runtime/*/src/weights/pallet_messenger_between_domains_extension.rs +set +x + +echo +echo "===============================================================================" +echo "Successfully generated benchmark weights for Subspace, EVM and Auto ID runtimes" +echo "===============================================================================" +echo