Skip to content

Commit

Permalink
Shorter testnet timing (#1213)
Browse files Browse the repository at this point in the history
  • Loading branch information
AurevoirXavier authored Jul 21, 2023
1 parent 55a68d0 commit c4ef814
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 28 deletions.
4 changes: 2 additions & 2 deletions runtime/pangolin/src/pallets/collective.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl pallet_collective::Config<CouncilCollective> for Runtime {
type MaxMembers = ConstU32<COLLECTIVE_MAX_MEMBERS>;
type MaxProposalWeight = MaxProposalWeight;
type MaxProposals = ConstU32<100>;
type MotionDuration = ConstU32<{ 3 * DAYS }>;
type MotionDuration = ConstU32<{ 10 * MINUTES }>;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type RuntimeOrigin = RuntimeOrigin;
Expand All @@ -49,7 +49,7 @@ impl pallet_collective::Config<TechnicalCollective> for Runtime {
type MaxMembers = ConstU32<COLLECTIVE_MAX_MEMBERS>;
type MaxProposalWeight = MaxProposalWeight;
type MaxProposals = ConstU32<100>;
type MotionDuration = ConstU32<{ 3 * DAYS }>;
type MotionDuration = ConstU32<{ 10 * MINUTES }>;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type RuntimeOrigin = RuntimeOrigin;
Expand Down
10 changes: 5 additions & 5 deletions runtime/pangolin/src/pallets/democracy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// darwinia
use crate::*;

const ENACTMENT_PERIOD: u32 = 28 * DAYS;
const ENACTMENT_PERIOD: u32 = 10 * MINUTES;

impl pallet_democracy::Config for Runtime {
type BlacklistOrigin = Root;
Expand All @@ -28,7 +28,7 @@ impl pallet_democracy::Config for Runtime {
type CancelProposalOrigin = RootOrAll<TechnicalCollective>;
// To cancel a proposal which has been passed, 2/3 of the council must agree to it.
type CancellationOrigin = RootOrAtLeastTwoThird<CouncilCollective>;
type CooloffPeriod = ConstU32<{ 7 * DAYS }>;
type CooloffPeriod = ConstU32<{ 5 * MINUTES }>;
type Currency = Balances;
type EnactmentPeriod = ConstU32<ENACTMENT_PERIOD>;
/// A unanimous council can have the next scheduled referendum be a straight default-carries
Expand All @@ -41,10 +41,10 @@ impl pallet_democracy::Config for Runtime {
/// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin = RootOrAtLeastTwoThird<TechnicalCollective>;
type FastTrackVotingPeriod = ConstU32<{ 3 * HOURS }>;
type FastTrackVotingPeriod = ConstU32<{ MINUTES }>;
type InstantAllowed = ConstBool<true>;
type InstantOrigin = RootOrAll<TechnicalCollective>;
type LaunchPeriod = ConstU32<{ 28 * DAYS }>;
type LaunchPeriod = ConstU32<{ 10 * MINUTES }>;
type MaxBlacklisted = ConstU32<100>;
type MaxDeposits = ConstU32<100>;
type MaxProposals = ConstU32<100>;
Expand All @@ -60,6 +60,6 @@ impl pallet_democracy::Config for Runtime {
// only do it once and it lasts only for the cool-off period.
type VetoOrigin = pallet_collective::EnsureMember<AccountId, TechnicalCollective>;
type VoteLockingPeriod = ConstU32<ENACTMENT_PERIOD>;
type VotingPeriod = ConstU32<{ 28 * DAYS }>;
type VotingPeriod = ConstU32<{ 10 * MINUTES }>;
type WeightInfo = weights::pallet_democracy::WeightInfo<Self>;
}
3 changes: 1 addition & 2 deletions runtime/pangolin/src/pallets/elections_phragmen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ impl pallet_elections_phragmen::Config for Runtime {
type MaxVotesPerVoter = ConstU32<16>;
type PalletId = PhragmenElectionPalletId;
type RuntimeEvent = RuntimeEvent;
// Daily council elections.
type TermDuration = ConstU32<{ 7 * DAYS }>;
type TermDuration = ConstU32<{ 10 * MINUTES }>;
// 1 storage item created, key size is 32 bytes, value size is 16+16.
type VotingBondBase = ConstU128<{ darwinia_deposit(1, 64) }>;
// Additional data per vote is 32 bytes (account id).
Expand Down
4 changes: 1 addition & 3 deletions runtime/pangolin/src/pallets/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
// darwinia
use crate::*;

fast_runtime_or_not!(MinStakingDuration, ConstU32<{ 5 * MINUTES }>, ConstU32<{ 14 * DAYS }>);

pub enum RingStaking {}
impl darwinia_staking::Stake for RingStaking {
type AccountId = AccountId;
Expand Down Expand Up @@ -77,7 +75,7 @@ impl darwinia_staking::Config for Runtime {
type Kton = KtonStaking;
type MaxDeposits = <Self as darwinia_deposit::Config>::MaxDeposits;
type MaxUnstakings = ConstU32<16>;
type MinStakingDuration = MinStakingDuration;
type MinStakingDuration = ConstU32<{ 10 * MINUTES }>;
type PayoutFraction = PayoutFraction;
type RewardRemainder = Treasury;
type Ring = RingStaking;
Expand Down
2 changes: 1 addition & 1 deletion runtime/pangolin/src/pallets/tips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl pallet_tips::Config for Runtime {
type DataDepositPerByte = ConstU128<{ darwinia_deposit(0, 1) }>;
type MaximumReasonLength = ConstU32<16384>;
type RuntimeEvent = RuntimeEvent;
type TipCountdown = ConstU32<DAYS>;
type TipCountdown = ConstU32<{ 10 * MINUTES }>;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = ConstU128<{ 100 * UNIT }>;
type Tippers = PhragmenElection;
Expand Down
2 changes: 1 addition & 1 deletion runtime/pangolin/src/pallets/treasury.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ impl pallet_treasury::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SpendFunds = ();
type SpendOrigin = frame_support::traits::NeverEnsureOrigin<Balance>;
type SpendPeriod = ConstU32<{ 24 * DAYS }>;
type SpendPeriod = ConstU32<{ 10 * MINUTES }>;
type WeightInfo = weights::pallet_treasury::WeightInfo<Self>;
}
4 changes: 2 additions & 2 deletions runtime/pangoro/src/pallets/collective.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl pallet_collective::Config<CouncilCollective> for Runtime {
type MaxMembers = ConstU32<COLLECTIVE_MAX_MEMBERS>;
type MaxProposalWeight = MaxProposalWeight;
type MaxProposals = ConstU32<100>;
type MotionDuration = ConstU32<{ 3 * DAYS }>;
type MotionDuration = ConstU32<{ 10 * MINUTES }>;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type RuntimeOrigin = RuntimeOrigin;
Expand All @@ -49,7 +49,7 @@ impl pallet_collective::Config<TechnicalCollective> for Runtime {
type MaxMembers = ConstU32<COLLECTIVE_MAX_MEMBERS>;
type MaxProposalWeight = MaxProposalWeight;
type MaxProposals = ConstU32<100>;
type MotionDuration = ConstU32<{ 3 * DAYS }>;
type MotionDuration = ConstU32<{ 10 * MINUTES }>;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type RuntimeOrigin = RuntimeOrigin;
Expand Down
10 changes: 5 additions & 5 deletions runtime/pangoro/src/pallets/democracy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// darwinia
use crate::*;

const ENACTMENT_PERIOD: u32 = 28 * DAYS;
const ENACTMENT_PERIOD: u32 = 10 * MINUTES;

impl pallet_democracy::Config for Runtime {
type BlacklistOrigin = Root;
Expand All @@ -28,7 +28,7 @@ impl pallet_democracy::Config for Runtime {
type CancelProposalOrigin = RootOrAll<TechnicalCollective>;
// To cancel a proposal which has been passed, 2/3 of the council must agree to it.
type CancellationOrigin = RootOrAtLeastTwoThird<CouncilCollective>;
type CooloffPeriod = ConstU32<{ 7 * DAYS }>;
type CooloffPeriod = ConstU32<{ 5 * MINUTES }>;
type Currency = Balances;
type EnactmentPeriod = ConstU32<ENACTMENT_PERIOD>;
/// A unanimous council can have the next scheduled referendum be a straight default-carries
Expand All @@ -41,10 +41,10 @@ impl pallet_democracy::Config for Runtime {
/// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin = RootOrAtLeastTwoThird<TechnicalCollective>;
type FastTrackVotingPeriod = ConstU32<{ 3 * HOURS }>;
type FastTrackVotingPeriod = ConstU32<{ MINUTES }>;
type InstantAllowed = ConstBool<true>;
type InstantOrigin = RootOrAll<TechnicalCollective>;
type LaunchPeriod = ConstU32<{ 28 * DAYS }>;
type LaunchPeriod = ConstU32<{ 10 * MINUTES }>;
type MaxBlacklisted = ConstU32<100>;
type MaxDeposits = ConstU32<100>;
type MaxProposals = ConstU32<100>;
Expand All @@ -60,6 +60,6 @@ impl pallet_democracy::Config for Runtime {
// only do it once and it lasts only for the cool-off period.
type VetoOrigin = pallet_collective::EnsureMember<AccountId, TechnicalCollective>;
type VoteLockingPeriod = ConstU32<ENACTMENT_PERIOD>;
type VotingPeriod = ConstU32<{ 28 * DAYS }>;
type VotingPeriod = ConstU32<{ 10 * MINUTES }>;
type WeightInfo = weights::pallet_democracy::WeightInfo<Self>;
}
3 changes: 1 addition & 2 deletions runtime/pangoro/src/pallets/elections_phragmen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ impl pallet_elections_phragmen::Config for Runtime {
type MaxVotesPerVoter = ConstU32<16>;
type PalletId = PhragmenElectionPalletId;
type RuntimeEvent = RuntimeEvent;
// Daily council elections.
type TermDuration = ConstU32<{ 7 * DAYS }>;
type TermDuration = ConstU32<{ 10 * MINUTES }>;
// 1 storage item created, key size is 32 bytes, value size is 16+16.
type VotingBondBase = ConstU128<{ darwinia_deposit(1, 64) }>;
// Additional data per vote is 32 bytes (account id).
Expand Down
4 changes: 1 addition & 3 deletions runtime/pangoro/src/pallets/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
// darwinia
use crate::*;

fast_runtime_or_not!(MinStakingDuration, ConstU32<{ 5 * MINUTES }>, ConstU32<{ 14 * DAYS }>);

pub enum RingStaking {}
impl darwinia_staking::Stake for RingStaking {
type AccountId = AccountId;
Expand Down Expand Up @@ -77,7 +75,7 @@ impl darwinia_staking::Config for Runtime {
type Kton = KtonStaking;
type MaxDeposits = <Self as darwinia_deposit::Config>::MaxDeposits;
type MaxUnstakings = ConstU32<16>;
type MinStakingDuration = MinStakingDuration;
type MinStakingDuration = ConstU32<{ 10 * MINUTES }>;
type PayoutFraction = PayoutFraction;
type RewardRemainder = Treasury;
type Ring = RingStaking;
Expand Down
2 changes: 1 addition & 1 deletion runtime/pangoro/src/pallets/tips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl pallet_tips::Config for Runtime {
type DataDepositPerByte = ConstU128<{ darwinia_deposit(0, 1) }>;
type MaximumReasonLength = ConstU32<16384>;
type RuntimeEvent = RuntimeEvent;
type TipCountdown = ConstU32<DAYS>;
type TipCountdown = ConstU32<{ 10 * MINUTES }>;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = ConstU128<{ 100 * UNIT }>;
type Tippers = PhragmenElection;
Expand Down
2 changes: 1 addition & 1 deletion runtime/pangoro/src/pallets/treasury.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ impl pallet_treasury::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SpendFunds = ();
type SpendOrigin = frame_support::traits::NeverEnsureOrigin<Balance>;
type SpendPeriod = ConstU32<{ 24 * DAYS }>;
type SpendPeriod = ConstU32<{ 10 * MINUTES }>;
type WeightInfo = weights::pallet_treasury::WeightInfo<Self>;
}

0 comments on commit c4ef814

Please sign in to comment.