Skip to content

Commit

Permalink
Add pallet-collective instance benchmarks to all runtimes. Run benche…
Browse files Browse the repository at this point in the history
…s script now uses frame-omni-bencher and outputs to a folder instead of a file to support pallet instances.
  • Loading branch information
snowmead committed Mar 7, 2025
1 parent 55c350a commit 3b96f1a
Show file tree
Hide file tree
Showing 19 changed files with 1,798 additions and 935 deletions.
4 changes: 2 additions & 2 deletions runtime/moonbase/src/governance/councils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl pallet_collective::Config<TreasuryCouncilInstance> for Runtime {
/// The maximum number of treasury council members.
type MaxMembers = ConstU32<9>;
type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote;
type WeightInfo = moonbase_weights::pallet_collective::WeightInfo<Runtime>;
type WeightInfo = moonbase_weights::pallet_collective_treasury_council::WeightInfo<Runtime>;
type SetMembersOrigin = referenda::GeneralAdminOrRoot;
type MaxProposalWeight = MaxProposalWeight;
}
Expand All @@ -56,7 +56,7 @@ impl pallet_collective::Config<OpenTechCommitteeInstance> for Runtime {
/// The maximum number of technical committee members.
type MaxMembers = ConstU32<100>;
type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote;
type WeightInfo = moonbase_weights::pallet_collective::WeightInfo<Runtime>;
type WeightInfo = moonbase_weights::pallet_collective_open_tech_committee::WeightInfo<Runtime>;
type SetMembersOrigin = referenda::GeneralAdminOrRoot;
type MaxProposalWeight = MaxProposalWeight;
}
8 changes: 8 additions & 0 deletions runtime/moonbase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,12 @@ use moonbeam_runtime_common::deal_with_fees::{

#[cfg(feature = "runtime-benchmarks")]
mod benches {
// TODO: Temporary workaround before upgrading to latest polkadot-sdk - fix https://github.com/paritytech/polkadot-sdk/pull/6435
#[allow(unused_imports)]
use pallet_collective as pallet_collective_treasury_council;
#[allow(unused_imports)]
use pallet_collective as pallet_collective_open_tech_committee;

frame_support::parameter_types! {
pub const MaxBalance: crate::Balance = crate::Balance::max_value();
}
Expand Down Expand Up @@ -1501,6 +1507,8 @@ mod benches {
[pallet_precompile_benchmarks, PrecompileBenchmarks]
[pallet_parameters, Parameters]
[pallet_xcm_weight_trader, XcmWeightTrader]
[pallet_collective_treasury_council, TreasuryCouncilCollective]
[pallet_collective_open_tech_committee, OpenTechCommitteeCollective]
);
}

Expand Down
3 changes: 2 additions & 1 deletion runtime/moonbase/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ pub mod pallet_author_inherent;
pub mod pallet_author_mapping;
pub mod pallet_author_slot_filter;
pub mod pallet_balances;
pub mod pallet_collective;
pub mod pallet_collective_open_tech_committee;
pub mod pallet_collective_treasury_council;
pub mod pallet_conviction_voting;
pub mod pallet_crowdloan_rewards;
pub mod pallet_evm;
Expand Down
308 changes: 0 additions & 308 deletions runtime/moonbase/src/weights/pallet_collective.rs

This file was deleted.

289 changes: 289 additions & 0 deletions runtime/moonbase/src/weights/pallet_collective_open_tech_committee.rs

Large diffs are not rendered by default.

291 changes: 291 additions & 0 deletions runtime/moonbase/src/weights/pallet_collective_treasury_council.rs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions runtime/moonbeam/src/governance/councils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl pallet_collective::Config<TreasuryCouncilInstance> for Runtime {
/// The maximum number of treasury council members.
type MaxMembers = ConstU32<9>;
type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote;
type WeightInfo = moonbeam_weights::pallet_collective::WeightInfo<Runtime>;
type WeightInfo = moonbeam_weights::pallet_collective_treasury_council::WeightInfo<Runtime>;
type SetMembersOrigin = referenda::GeneralAdminOrRoot;
type MaxProposalWeight = MaxProposalWeight;
}
Expand All @@ -55,7 +55,7 @@ impl pallet_collective::Config<OpenTechCommitteeInstance> for Runtime {
/// The maximum number of technical committee members.
type MaxMembers = ConstU32<100>;
type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote;
type WeightInfo = moonbeam_weights::pallet_collective::WeightInfo<Runtime>;
type WeightInfo = moonbeam_weights::pallet_collective_open_tech_committee::WeightInfo<Runtime>;
type SetMembersOrigin = referenda::GeneralAdminOrRoot;
type MaxProposalWeight = MaxProposalWeight;
}
8 changes: 8 additions & 0 deletions runtime/moonbeam/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,12 @@ use moonbeam_runtime_common::deal_with_fees::{

#[cfg(feature = "runtime-benchmarks")]
mod benches {
// TODO: Temporary workaround before upgrading to latest polkadot-sdk - fix https://github.com/paritytech/polkadot-sdk/pull/6435
#[allow(unused_imports)]
use pallet_collective as pallet_collective_treasury_council;
#[allow(unused_imports)]
use pallet_collective as pallet_collective_open_tech_committee;

frame_support::parameter_types! {
pub const MaxBalance: crate::Balance = crate::Balance::max_value();
}
Expand Down Expand Up @@ -1495,6 +1501,8 @@ mod benches {
[pallet_precompile_benchmarks, PrecompileBenchmarks]
[pallet_parameters, Parameters]
[pallet_xcm_weight_trader, XcmWeightTrader]
[pallet_collective_treasury_council, TreasuryCouncilCollective]
[pallet_collective_open_tech_committee, OpenTechCommitteeCollective]
);
}

Expand Down
3 changes: 2 additions & 1 deletion runtime/moonbeam/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ pub mod pallet_author_inherent;
pub mod pallet_author_mapping;
pub mod pallet_author_slot_filter;
pub mod pallet_balances;
pub mod pallet_collective;
pub mod pallet_collective_open_tech_committee;
pub mod pallet_collective_treasury_council;
pub mod pallet_conviction_voting;
pub mod pallet_crowdloan_rewards;
pub mod pallet_evm;
Expand Down
Loading

0 comments on commit 3b96f1a

Please sign in to comment.