diff --git a/docs/weight-generation.md b/docs/weight-generation.md index 9a1eae34e7..6904db0ca3 100644 --- a/docs/weight-generation.md +++ b/docs/weight-generation.md @@ -67,7 +67,7 @@ for pallet in "${pallets[@]}"; do done ``` -You probably want to do this inside a `tmux` session or similar, as it will take a while. +You probably want to do this inside a `tmux` session or something similar (e.g., `nohup &`), as it will take a while (several hours). 7. `rsync` the weights back to your local machine, replacing the existing weights. @@ -78,7 +78,20 @@ You probably want to do this inside a `tmux` session or similar, as it will take 9. Commit the weight changes. -10. If not installed, `cargo install subweight`, and check the weight changes with `subweight compare commits --path-pattern "./**/weights/*.rs" --method asymptotic --ignore-errors HEAD origin/main`. Ensure the changes are reasonable. +10. Ensure the changes are reasonable. If not installed, `cargo install subweight`, check the weight changes: + ``` + subweight compare commits \ + --path-pattern "./**/weights/**/*.rs" \ + --method asymptotic \ + --ignore-errors \ + \ + ` + ``` + _Hint1: Add `--format markdown --no-color` for markdown-compatible results._ + + _Hint2: Change `--path-pattern "./**/weights/**/*.rs"` to e.g. `--path-pattern "./relay/polkadot/weights/**/*.rs"` for a specific runtime._ + + _Hint3: Add `--change added changed` to include only relevant changes._ ## FAQ diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index e8e1a0b0a0..2cd585377f 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -1477,7 +1477,7 @@ impl pallet_balances::Config for Runtime { type MaxLocks = ConstU32<4>; type MaxReserves = ConstU32<4>; type ReserveIdentifier = [u8; 8]; - type WeightInfo = weights::pallet_balances_nis::WeightInfo; + type WeightInfo = weights::pallet_balances_nis_counterpart::WeightInfo; type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); @@ -1981,7 +1981,7 @@ mod benches { [runtime_parachains::coretime, Coretime] // Substrate [pallet_balances, Native] - [pallet_balances, Nis] + [pallet_balances, NisCounterpart] [pallet_bags_list, VoterList] [frame_benchmarking::baseline, Baseline::] [pallet_bounties, Bounties] @@ -2559,9 +2559,9 @@ sp_api::impl_runtime_apis! { // Benchmark files generated for `Balances/NisCounterpartBalances` instances are by default // `pallet_balances_balances.rs / pallet_balances_nis_counterpart_balances`, which is not really nice, // so with this redefinition we can change names to nicer: - // `pallet_balances_native.rs / pallet_balances_nis.rs`. + // `pallet_balances_native.rs / pallet_balances_nis_counterpart.rs`. type Native = pallet_balances::Pallet::; - type Nis = pallet_balances::Pallet::; + type NisCounterpart = pallet_balances::Pallet::; let mut list = Vec::::new(); list_benchmarks!(list, extra); @@ -2776,7 +2776,7 @@ sp_api::impl_runtime_apis! { } type Native = pallet_balances::Pallet::; - type Nis = pallet_balances::Pallet::; + type NisCounterpart = pallet_balances::Pallet::; let mut whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); let treasury_key = frame_system::Account::::hashed_key_for(Treasury::account_id()); diff --git a/relay/kusama/src/weights/mod.rs b/relay/kusama/src/weights/mod.rs index 8e68ad27da..b503f319e3 100644 --- a/relay/kusama/src/weights/mod.rs +++ b/relay/kusama/src/weights/mod.rs @@ -20,7 +20,7 @@ pub mod frame_system; pub mod pallet_asset_rate; pub mod pallet_bags_list; pub mod pallet_balances_native; -pub mod pallet_balances_nis; +pub mod pallet_balances_nis_counterpart; pub mod pallet_bounties; pub mod pallet_child_bounties; pub mod pallet_conviction_voting; diff --git a/relay/kusama/src/weights/pallet_balances_nis.rs b/relay/kusama/src/weights/pallet_balances_nis_counterpart.rs similarity index 99% rename from relay/kusama/src/weights/pallet_balances_nis.rs rename to relay/kusama/src/weights/pallet_balances_nis_counterpart.rs index 358303cbd3..b6a803c17b 100644 --- a/relay/kusama/src/weights/pallet_balances_nis.rs +++ b/relay/kusama/src/weights/pallet_balances_nis_counterpart.rs @@ -177,4 +177,4 @@ impl pallet_balances::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 1501)) .saturating_add(T::DbWeight::get().reads(1)) } -} +} \ No newline at end of file