Skip to content

Commit

Permalink
configured
Browse files Browse the repository at this point in the history
  • Loading branch information
asiniscalchi committed Sep 4, 2024
1 parent 2b4400a commit 929313b
Show file tree
Hide file tree
Showing 8 changed files with 564 additions and 60 deletions.
1 change: 1 addition & 0 deletions runtime/laos/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ frame_benchmarking::define_benchmarks!(
[cumulus_pallet_parachain_system, ParachainSystem]
[pallet_scheduler, Scheduler]
[pallet_treasury, Treasury]
[pallet_democracy, Democracy]
// TODO pallet_xcm?
);
9 changes: 9 additions & 0 deletions runtime/laos/src/configs/collective_council.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ pub const COUNCIL_MOTION_DURATION: BlockNumber = 5 * MINUTES;
#[cfg(not(feature = "fast-mode"))]
pub const COUNCIL_MOTION_DURATION: BlockNumber = 7 * DAYS;

pub type CouncilMajority =
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>;
pub type AllOfCouncil =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 1>;
pub type TwoThirdOfCouncil =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>;
pub type HalfOfCouncil =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>;

parameter_types! {
pub const CouncilMotionDuration: BlockNumber = COUNCIL_MOTION_DURATION;
pub const CouncilMaxProposals: u32 = 7;
Expand Down
14 changes: 7 additions & 7 deletions runtime/laos/src/configs/democracy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use super::collective_council::{
AllOfCouncil, CouncilCollective, HalfOfCouncil, TwoThirdOfCouncil,
};
use crate::{
currency::UNIT, weights, AccountId, Balance, BlockNumber, OriginCaller, Preimage, Runtime,
RuntimeEvent, Scheduler, Treasury,
currency::UNIT, weights, AccountId, Balance, Balances, BlockNumber, OriginCaller, Preimage,
Runtime, RuntimeEvent, Scheduler, Treasury,
};
use frame_support::parameter_types;
use frame_support::{parameter_types, traits::EitherOfDiverse};
use frame_system::{EnsureRoot, EnsureSigned};
use parachains_common::{DAYS, HOURS, MINUTES};
use polkadot_runtime_common::prod_or_fast;
Expand All @@ -29,7 +29,7 @@ impl pallet_democracy::Config for Runtime {
type CancelProposalOrigin = EnsureRoot<AccountId>;
// To cancel a proposal which has been passed, 2/3 of the council must agree to
// it.
type CancellationOrigin = EnsureRootOr<TwoThirdOfCouncil>;
type CancellationOrigin = EitherOfDiverse<EnsureRoot<AccountId>, TwoThirdOfCouncil>;
/// Period in blocks where an external proposal may not be re-submitted
/// after being vetoed.
type CooloffPeriod = CooloffPeriod;
Expand All @@ -52,10 +52,10 @@ impl pallet_democracy::Config for Runtime {
type ExternalOrigin = HalfOfCouncil;
/// Half of the council can have an ExternalMajority/ExternalDefault vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin = EnsureRootOr<HalfOfCouncil>;
type FastTrackOrigin = EitherOfDiverse<EnsureRoot<AccountId>, HalfOfCouncil>;
type FastTrackVotingPeriod = FastTrackVotingPeriod;
type InstantAllowed = InstantAllowed;
type InstantOrigin = EnsureRootOr<AllOfCouncil>;
type InstantOrigin = EitherOfDiverse<EnsureRoot<AccountId>, AllOfCouncil>;
// Same as EnactmentPeriod
/// How often (in blocks) new public referenda are launched.
type LaunchPeriod = LaunchPeriod;
Expand All @@ -79,5 +79,5 @@ impl pallet_democracy::Config for Runtime {
type VoteLockingPeriod = EnactmentPeriod;
/// How often (in blocks) to check for new votes.
type VotingPeriod = VotingPeriod;
type WeightInfo = (); //weights::pallet_democracy::WeightInfo<Runtime>;
type WeightInfo = weights::pallet_democracy::WeightInfo<Runtime>;
}
4 changes: 1 addition & 3 deletions runtime/laos/src/configs/treasury.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::collective_council::CouncilCollective;
use super::collective_council::CouncilMajority;
use crate::{
currency::UNIT, weights, AccountId, Balance, Balances, BlockNumber, Permill, Runtime,
RuntimeEvent, Treasury,
Expand Down Expand Up @@ -34,8 +34,6 @@ parameter_types! {
pub TreasuryAccount: AccountId = Treasury::account_id();
}

type CouncilMajority =
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>;
type ApproveOrigin = EitherOfDiverse<EnsureRoot<AccountId>, CouncilMajority>;
type RejectOrigin = EitherOfDiverse<EnsureRoot<AccountId>, CouncilMajority>;

Expand Down
1 change: 1 addition & 0 deletions runtime/laos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ construct_runtime!(
Treasury: pallet_treasury = 41,
Elections: pallet_elections_phragmen = 42,
Preimage: pallet_preimage = 43,
Democracy: pallet_democracy = 45,

// Frontier
Ethereum: pallet_ethereum = 50,
Expand Down
1 change: 1 addition & 0 deletions runtime/laos/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub mod cumulus_pallet_xcmp_queue;
pub mod extrinsic_weights;
pub mod pallet_asset_metadata_extender;
pub mod pallet_collective;
pub mod pallet_democracy;
pub mod pallet_elections_phragmen;
pub mod pallet_evm;
pub mod pallet_laos_evolution;
Expand Down
106 changes: 56 additions & 50 deletions runtime/laos/src/weights/pallet_collective.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

//! Autogenerated weights for `pallet_collective`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-08-08, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-09-04, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `titan`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024
Expand Down Expand Up @@ -45,13 +45,13 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0 + m * (176 ±0) + p * (440 ±0)`
// Estimated: `1551 + m * (117 ±35) + p * (65536 ±101)`
// Minimum execution time: 17_236_000 picoseconds.
Weight::from_parts(17_236_000, 0)
// Minimum execution time: 10_225_000 picoseconds.
Weight::from_parts(10_225_000, 0)
.saturating_add(Weight::from_parts(0, 1551))
// Standard Error: 538_714
.saturating_add(Weight::from_parts(984_342, 0).saturating_mul(m.into()))
// Standard Error: 1_539_185
.saturating_add(Weight::from_parts(2_823_406, 0).saturating_mul(p.into()))
// Standard Error: 471_270
.saturating_add(Weight::from_parts(1_193_788, 0).saturating_mul(m.into()))
// Standard Error: 1_346_487
.saturating_add(Weight::from_parts(2_801_824, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into())))
.saturating_add(T::DbWeight::get().writes(2))
Expand All @@ -67,11 +67,13 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `66 + m * (20 ±0)`
// Estimated: `1552 + m * (20 ±0)`
// Minimum execution time: 20_985_000 picoseconds.
Weight::from_parts(49_331_530, 0)
// Minimum execution time: 19_418_000 picoseconds.
Weight::from_parts(18_663_251, 0)
.saturating_add(Weight::from_parts(0, 1552))
// Standard Error: 22_292
.saturating_add(Weight::from_parts(14_892, 0).saturating_mul(b.into()))
// Standard Error: 723
.saturating_add(Weight::from_parts(689, 0).saturating_mul(b.into()))
// Standard Error: 38_925
.saturating_add(Weight::from_parts(48_368, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(Weight::from_parts(0, 20).saturating_mul(m.into()))
}
Expand All @@ -85,13 +87,13 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `66 + m * (20 ±0)`
// Estimated: `3532 + m * (20 ±0)`
// Minimum execution time: 51_170_000 picoseconds.
Weight::from_parts(50_884_077, 0)
// Minimum execution time: 20_947_000 picoseconds.
Weight::from_parts(17_919_052, 0)
.saturating_add(Weight::from_parts(0, 3532))
// Standard Error: 1_224
.saturating_add(Weight::from_parts(198, 0).saturating_mul(b.into()))
// Standard Error: 65_863
.saturating_add(Weight::from_parts(83_026, 0).saturating_mul(m.into()))
// Standard Error: 2_933
.saturating_add(Weight::from_parts(2_789, 0).saturating_mul(b.into()))
// Standard Error: 157_798
.saturating_add(Weight::from_parts(171_368, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(Weight::from_parts(0, 20).saturating_mul(m.into()))
}
Expand All @@ -112,15 +114,15 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `30 + m * (20 ±0) + p * (71 ±0)`
// Estimated: `3496 + m * (20 ±0) + p * (71 ±0)`
// Minimum execution time: 58_757_000 picoseconds.
Weight::from_parts(12_176_995, 0)
// Minimum execution time: 25_009_000 picoseconds.
Weight::from_parts(16_838_986, 0)
.saturating_add(Weight::from_parts(0, 3496))
// Standard Error: 40_337
.saturating_add(Weight::from_parts(21_566, 0).saturating_mul(b.into()))
// Standard Error: 2_290_257
.saturating_add(Weight::from_parts(1_308_907, 0).saturating_mul(m.into()))
// Standard Error: 6_870_772
.saturating_add(Weight::from_parts(3_125_388, 0).saturating_mul(p.into()))
// Standard Error: 1_737
.saturating_add(Weight::from_parts(4_571, 0).saturating_mul(b.into()))
// Standard Error: 98_628
.saturating_add(Weight::from_parts(139_574, 0).saturating_mul(m.into()))
// Standard Error: 295_884
.saturating_add(Weight::from_parts(767_055, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(4))
.saturating_add(Weight::from_parts(0, 20).saturating_mul(m.into()))
Expand All @@ -135,8 +137,8 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `328 + m * (40 ±0)`
// Estimated: `4593`
// Minimum execution time: 23_097_000 picoseconds.
Weight::from_parts(25_093_000, 0)
// Minimum execution time: 18_943_000 picoseconds.
Weight::from_parts(20_254_000, 0)
.saturating_add(Weight::from_parts(0, 4593))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
Expand All @@ -155,11 +157,13 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `176 + m * (40 ±0) + p * (55 ±0)`
// Estimated: `3642 + m * (40 ±0) + p * (55 ±0)`
// Minimum execution time: 24_409_000 picoseconds.
Weight::from_parts(26_028_750, 0)
// Minimum execution time: 25_665_000 picoseconds.
Weight::from_parts(24_786_958, 0)
.saturating_add(Weight::from_parts(0, 3642))
// Standard Error: 229_785
.saturating_add(Weight::from_parts(991_500, 0).saturating_mul(p.into()))
// Standard Error: 24_844
.saturating_add(Weight::from_parts(28_906, 0).saturating_mul(m.into()))
// Standard Error: 66_250
.saturating_add(Weight::from_parts(299_916, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 40).saturating_mul(m.into()))
Expand All @@ -180,15 +184,13 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `248 + m * (40 ±0) + p * (78 ±0)`
// Estimated: `3714 + b * (1 ±0) + m * (40 ±0) + p * (78 ±0)`
// Minimum execution time: 50_532_000 picoseconds.
Weight::from_parts(35_629_592, 0)
// Minimum execution time: 37_653_000 picoseconds.
Weight::from_parts(36_834_554, 0)
.saturating_add(Weight::from_parts(0, 3714))
// Standard Error: 14_617
.saturating_add(Weight::from_parts(6_009, 0).saturating_mul(b.into()))
// Standard Error: 933_690
.saturating_add(Weight::from_parts(539_583, 0).saturating_mul(m.into()))
// Standard Error: 2_489_840
.saturating_add(Weight::from_parts(1_004_388, 0).saturating_mul(p.into()))
// Standard Error: 100_500
.saturating_add(Weight::from_parts(61_812, 0).saturating_mul(m.into()))
// Standard Error: 268_000
.saturating_add(Weight::from_parts(506_000, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into()))
Expand All @@ -211,11 +213,13 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `230 + m * (31 ±0) + p * (55 ±0)`
// Estimated: `3696 + m * (31 ±0) + p * (55 ±0)`
// Minimum execution time: 37_864_000 picoseconds.
Weight::from_parts(38_462_208, 0)
// Minimum execution time: 25_553_000 picoseconds.
Weight::from_parts(23_703_041, 0)
.saturating_add(Weight::from_parts(0, 3696))
// Standard Error: 67_405
.saturating_add(Weight::from_parts(292_416, 0).saturating_mul(p.into()))
// Standard Error: 40_540
.saturating_add(Weight::from_parts(67_468, 0).saturating_mul(m.into()))
// Standard Error: 108_108
.saturating_add(Weight::from_parts(500_583, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 31).saturating_mul(m.into()))
Expand All @@ -238,11 +242,13 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `267 + m * (40 ±0) + p * (78 ±0)`
// Estimated: `3733 + b * (1 ±0) + m * (40 ±0) + p * (78 ±0)`
// Minimum execution time: 57_164_000 picoseconds.
Weight::from_parts(197_987_852, 0)
// Minimum execution time: 41_326_000 picoseconds.
Weight::from_parts(40_599_109, 0)
.saturating_add(Weight::from_parts(0, 3733))
// Standard Error: 3_553
.saturating_add(Weight::from_parts(490, 0).saturating_mul(b.into()))
// Standard Error: 1_148
.saturating_add(Weight::from_parts(973, 0).saturating_mul(b.into()))
// Standard Error: 73_378
.saturating_add(Weight::from_parts(79_666, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into()))
Expand All @@ -260,8 +266,8 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `224 + p * (32 ±0)`
// Estimated: `1935`
// Minimum execution time: 21_041_000 picoseconds.
Weight::from_parts(24_164_000, 0)
// Minimum execution time: 15_349_000 picoseconds.
Weight::from_parts(16_658_000, 0)
.saturating_add(Weight::from_parts(0, 1935))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(3))
Expand Down
Loading

0 comments on commit 929313b

Please sign in to comment.