diff --git a/code/parachain/runtime/common/src/governance.rs b/code/parachain/runtime/common/src/governance.rs index fb202792e3e..4c605144471 100644 --- a/code/parachain/runtime/common/src/governance.rs +++ b/code/parachain/runtime/common/src/governance.rs @@ -71,4 +71,29 @@ pub mod native { collective::EnsureProportionAtLeast, >, >; + + pub type EnsureRootOrOneSixthNativeTechnical = EitherOfDiverse< + EnsureRoot, + collective::EnsureProportionAtLeast, + >; + pub type EnsureRootOrOneSixthNativeCouncil = EitherOfDiverse< + EnsureRoot, + collective::EnsureProportionAtLeast, + >; + + pub type EnsureRootOrOneThirdNativeCouncilOrTechnical = EitherOfDiverse< + EnsureRoot, + EitherOfDiverse< + collective::EnsureProportionAtLeast, + collective::EnsureProportionAtLeast, + >, + >; + + pub type EnsureRootOrOneSixthNativeCouncilOrTechnical = EitherOfDiverse< + EnsureRoot, + EitherOfDiverse< + collective::EnsureProportionAtLeast, + collective::EnsureProportionAtLeast, + >, + >; } diff --git a/code/parachain/runtime/composable/src/governance.rs b/code/parachain/runtime/composable/src/governance.rs index 231ffda55e9..25c6ab6b87e 100644 --- a/code/parachain/runtime/composable/src/governance.rs +++ b/code/parachain/runtime/composable/src/governance.rs @@ -80,10 +80,16 @@ impl pallet_referenda::Config for Runtime { system::EnsureSignedBy, system::EnsureSignedBy, >; - + + #[cfg(not(feature = "fastnet"))] type CancelOrigin = EnsureRootOrOneThirdNativeTechnical; + #[cfg(feature = "fastnet")] + type CancelOrigin = EnsureRootOrOneSixthNativeTechnical; + #[cfg(not(feature = "fastnet"))] type KillOrigin = EnsureRootOrMoreThenHalfNativeCouncil; + #[cfg(feature = "fastnet")] + type KillOrigin = EnsureRootOrOneSixthNativeCouncil; type Slash = (); @@ -130,7 +136,10 @@ impl pallet_whitelist::Config for Runtime { type WeightInfo = weights::whitelist::WeightInfo; type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; - type WhitelistOrigin = EnsureRootOrOneThirdNativeTechnical; + #[cfg(not(feature = "fastnet"))] + type WhitelistOrigin = EnsureRootOrOneThirdNativeCouncilOrTechnical; + #[cfg(feature = "fastnet")] + type WhitelistOrigin = EnsureRootOrOneSixthNativeCouncilOrTechnical; type DispatchWhitelistedOrigin = EitherOf, WhitelistedCaller>; type Preimages = Preimage; } diff --git a/code/parachain/runtime/composable/src/tracks.rs b/code/parachain/runtime/composable/src/tracks.rs index 0849f478e75..184c5f2b856 100644 --- a/code/parachain/runtime/composable/src/tracks.rs +++ b/code/parachain/runtime/composable/src/tracks.rs @@ -21,10 +21,6 @@ use super::*; const fn percent(x: i32) -> sp_runtime::FixedI64 { sp_runtime::FixedI64::from_rational(x as u128, 100) } -const fn permill(x: i32) -> sp_runtime::FixedI64 { - sp_runtime::FixedI64::from_rational(x as u128, 1000) -} -pub const ONE_PICA: Balance = 1_000_000_000_000; use common::MINUTES; use pallet_referenda::Curve; @@ -40,28 +36,38 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 2] // Amount that must be placed on deposit before a decision can be made. decision_deposit: 0, // Amount of time this must be submitted for before a decision can be made. - #[cfg(feature = "testnet")] - prepare_period: 1 * MINUTES, - #[cfg(not(feature = "testnet"))] + #[cfg(feature = "fastnet")] + prepare_period: 2 * MINUTES, + #[cfg(not(feature = "fastnet"))] prepare_period: 2 * HOURS, // Amount of time that a decision may take to be approved prior to cancellation. + #[cfg(feature = "fastnet")] + decision_period: 1 * HOURS, + #[cfg(not(feature = "fastnet"))] decision_period: 7 * DAYS, // Amount of time that the approval criteria must hold before it can be approved. - #[cfg(feature = "testnet")] - confirm_period: 1 * MINUTES, - #[cfg(not(feature = "testnet"))] + #[cfg(feature = "fastnet")] + confirm_period: 15 * MINUTES, + #[cfg(not(feature = "fastnet"))] confirm_period: 1 * DAYS, // Minimum amount of time that an approved proposal must be in the dispatch queue. - #[cfg(feature = "testnet")] - min_enactment_period: 1 * MINUTES, - #[cfg(not(feature = "testnet"))] + #[cfg(feature = "fastnet")] + min_enactment_period: 5 * MINUTES, + #[cfg(not(feature = "fastnet"))] min_enactment_period: 1 * DAYS, // Minimum aye votes as percentage of overall conviction-weighted votes needed for // approval as a function of time into decision period. + #[cfg(feature = "fastnet")] + min_approval: Curve::make_reciprocal(4, 30, percent(80), percent(50), percent(100)), + #[cfg(not(feature = "fastnet"))] min_approval: Curve::make_reciprocal(4, 28, percent(80), percent(50), percent(100)), // Minimum pre-conviction aye-votes ("support") as percentage of overall population that // is needed for approval as a function of time into decision period. + #[cfg(feature = "fastnet")] + min_support: Curve::make_linear(30, 30, percent(0), percent(50)), + #[cfg(not(feature = "fastnet"))] min_support: Curve::make_linear(28, 28, percent(0), percent(50)), + }, ), ( @@ -70,19 +76,31 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 2] name: "whitelisted_caller", max_deciding: 2, decision_deposit: 0, - #[cfg(feature = "testnet")] - prepare_period: 1 * MINUTES, - #[cfg(not(feature = "testnet"))] + #[cfg(feature = "fastnet")] + prepare_period: 2 * MINUTES, + #[cfg(not(feature = "fastnet"))] prepare_period: 30 * MINUTES, + #[cfg(feature = "fastnet")] + decision_period: 30 * MINUTES, + #[cfg(not(feature = "fastnet"))] decision_period: 4 * DAYS, - #[cfg(feature = "testnet")] - confirm_period: 1 * MINUTES, - #[cfg(not(feature = "testnet"))] + #[cfg(feature = "fastnet")] + confirm_period: 5 * MINUTES, + #[cfg(not(feature = "fastnet"))] confirm_period: 10 * MINUTES, - #[cfg(feature = "testnet")] - min_enactment_period: 1 * MINUTES, - #[cfg(not(feature = "testnet"))] + #[cfg(feature = "fastnet")] + min_enactment_period: 2 * MINUTES, + #[cfg(not(feature = "fastnet"))] min_enactment_period: 10 * MINUTES, + #[cfg(feature = "fastnet")] + min_approval: Curve::make_reciprocal( + 1, + 30, + percent(96), + percent(50), + percent(100), + ), + #[cfg(not(feature = "fastnet"))] min_approval: Curve::make_reciprocal( 16, 28 * 24, @@ -90,6 +108,9 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 2] percent(50), percent(100), ), + #[cfg(feature = "fastnet")] + min_support: Curve::make_reciprocal(1, 30, percent(20), percent(5), percent(50)), + #[cfg(not(feature = "fastnet"))] min_support: Curve::make_reciprocal(1, 28, percent(20), percent(5), percent(50)), }, ), @@ -116,4 +137,4 @@ impl pallet_referenda::TracksInfo for TracksInfo { Err(()) } } -} \ No newline at end of file +} diff --git a/code/parachain/runtime/picasso/src/governance.rs b/code/parachain/runtime/picasso/src/governance.rs index ce786192388..0bacc8059a3 100644 --- a/code/parachain/runtime/picasso/src/governance.rs +++ b/code/parachain/runtime/picasso/src/governance.rs @@ -89,10 +89,15 @@ impl pallet_referenda::Config for Runtime { system::EnsureSignedBy, system::EnsureSignedBy, >; - + #[cfg(not(feature = "fastnet"))] type CancelOrigin = EnsureRootOrOneThirdNativeTechnical; + #[cfg(feature = "fastnet")] + type CancelOrigin = EnsureRootOrOneSixthNativeTechnical; + #[cfg(not(feature = "fastnet"))] type KillOrigin = EnsureRootOrMoreThenHalfNativeCouncil; + #[cfg(feature = "fastnet")] + type KillOrigin = EnsureRootOrOneSixthNativeCouncil; type Slash = (); @@ -139,7 +144,10 @@ impl pallet_whitelist::Config for Runtime { type WeightInfo = weights::whitelist::WeightInfo; type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; - type WhitelistOrigin = EnsureRootOrOneThirdNativeTechnical; + #[cfg(not(feature = "fastnet"))] + type WhitelistOrigin = EnsureRootOrOneThirdNativeCouncilOrTechnical; + #[cfg(feature = "fastnet")] + type WhitelistOrigin = EnsureRootOrOneSixthNativeCouncilOrTechnical; type DispatchWhitelistedOrigin = EitherOf, WhitelistedCaller>; type Preimages = Preimage; } diff --git a/code/parachain/runtime/picasso/src/tracks.rs b/code/parachain/runtime/picasso/src/tracks.rs index 31c7eb6a253..ec62f362e49 100644 --- a/code/parachain/runtime/picasso/src/tracks.rs +++ b/code/parachain/runtime/picasso/src/tracks.rs @@ -35,29 +35,41 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 2] // For Root origin this should generally be just one. max_deciding: 1, // Amount that must be placed on deposit before a decision can be made. + #[cfg(feature = "fastnet")] + decision_deposit: 50 * ONE_PICA, + #[cfg(not(feature = "fastnet"))] decision_deposit: 500_000 * ONE_PICA, // Amount of time this must be submitted for before a decision can be made. - #[cfg(feature = "testnet")] - prepare_period: 1 * MINUTES, - #[cfg(not(feature = "testnet"))] + #[cfg(feature = "fastnet")] + prepare_period: 2 * MINUTES, + #[cfg(not(feature = "fastnet"))] prepare_period: 2 * HOURS, // Amount of time that a decision may take to be approved prior to cancellation. + #[cfg(feature = "fastnet")] + decision_period: 1 * HOURS, + #[cfg(not(feature = "fastnet"))] decision_period: 7 * DAYS, // Amount of time that the approval criteria must hold before it can be approved. - #[cfg(feature = "testnet")] - confirm_period: 1 * MINUTES, - #[cfg(not(feature = "testnet"))] + #[cfg(feature = "fastnet")] + confirm_period: 15 * MINUTES, + #[cfg(not(feature = "fastnet"))] confirm_period: 1 * DAYS, // Minimum amount of time that an approved proposal must be in the dispatch queue. - #[cfg(feature = "testnet")] - min_enactment_period: 1 * MINUTES, - #[cfg(not(feature = "testnet"))] + #[cfg(feature = "fastnet")] + min_enactment_period: 5 * MINUTES, + #[cfg(not(feature = "fastnet"))] min_enactment_period: 1 * DAYS, // Minimum aye votes as percentage of overall conviction-weighted votes needed for // approval as a function of time into decision period. + #[cfg(feature = "fastnet")] + min_approval: Curve::make_reciprocal(4, 30, percent(80), percent(50), percent(100)), + #[cfg(not(feature = "fastnet"))] min_approval: Curve::make_reciprocal(4, 28, percent(80), percent(50), percent(100)), // Minimum pre-conviction aye-votes ("support") as percentage of overall population that // is needed for approval as a function of time into decision period. + #[cfg(feature = "fastnet")] + min_support: Curve::make_linear(30, 30, percent(0), percent(50)), + #[cfg(not(feature = "fastnet"))] min_support: Curve::make_linear(28, 28, percent(0), percent(50)), }, ), @@ -66,20 +78,35 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 2] pallet_referenda::TrackInfo { name: "whitelisted_caller", max_deciding: 2, + #[cfg(feature = "fastnet")] + decision_deposit: 5 * ONE_PICA, + #[cfg(not(feature = "fastnet"))] decision_deposit: 50_000 * ONE_PICA, - #[cfg(feature = "testnet")] - prepare_period: 1 * MINUTES, - #[cfg(not(feature = "testnet"))] + #[cfg(feature = "fastnet")] + prepare_period: 2 * MINUTES, + #[cfg(not(feature = "fastnet"))] prepare_period: 30 * MINUTES, + #[cfg(feature = "fastnet")] + decision_period: 30 * MINUTES, + #[cfg(not(feature = "fastnet"))] decision_period: 4 * DAYS, - #[cfg(feature = "testnet")] - confirm_period: 1 * MINUTES, - #[cfg(not(feature = "testnet"))] + #[cfg(feature = "fastnet")] + confirm_period: 5 * MINUTES, + #[cfg(not(feature = "fastnet"))] confirm_period: 10 * MINUTES, - #[cfg(feature = "testnet")] - min_enactment_period: 1 * MINUTES, - #[cfg(not(feature = "testnet"))] + #[cfg(feature = "fastnet")] + min_enactment_period: 2 * MINUTES, + #[cfg(not(feature = "fastnet"))] min_enactment_period: 10 * MINUTES, + #[cfg(feature = "fastnet")] + min_approval: Curve::make_reciprocal( + 1, + 30, + percent(96), + percent(50), + percent(100), + ), + #[cfg(not(feature = "fastnet"))] min_approval: Curve::make_reciprocal( 16, 28 * 24, @@ -87,6 +114,9 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 2] percent(50), percent(100), ), + #[cfg(feature = "fastnet")] + min_support: Curve::make_reciprocal(1, 30, percent(20), percent(5), percent(50)), + #[cfg(not(feature = "fastnet"))] min_support: Curve::make_reciprocal(1, 28, percent(20), percent(5), percent(50)), }, ), @@ -113,4 +143,4 @@ impl pallet_referenda::TracksInfo for TracksInfo { Err(()) } } -} \ No newline at end of file +}