This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
migration: unlock/unreserve Gov v1 balances, remove Gov V1 pallets from polkadot runtime, and remove Gov V1 pallet key/values from storage #7314
Merged
paritytech-processbot
merged 39 commits into
master
from
liam-kusama-gov-v1-storage-migration
Aug 18, 2023
Merged
Changes from 3 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
d1cf215
restore old gov configs
liamaharon 639ab0a
migrate old gov v1 storage
liamaharon 3066df0
exclude the Call enum for gov v1 pallets
liamaharon d099689
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon 964ac34
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon fc9e0a2
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon 670f199
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon abf4d90
update substrate
liamaharon 357328c
update tips pallet
liamaharon e2a8ff2
update chain_spec
liamaharon a85c346
fix migrations tuple
liamaharon 49174b9
oliver comments
liamaharon b090f34
format comment
liamaharon 187bda0
".git/.scripts/commands/fmt/fmt.sh"
c94588a
comments
liamaharon b3cbdde
Merge branch 'liam-kusama-gov-v1-storage-migration' of github.com:par…
liamaharon b64b92b
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon 271666a
polkadot migrations
liamaharon 4ec49ff
fix cargo.lock
liamaharon ca208cf
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon 5dd4daa
fix compilation
liamaharon bff4590
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon 4005aee
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon 45ba24f
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon 5e440c1
use democracy standalone migration
liamaharon 1f3f785
re-remove gov v1 pallets from kusama
liamaharon 6cd663b
remove unnecessary feature
liamaharon 8fef227
fix unlock configs
liamaharon 82d4de9
use substrate master
liamaharon 1991ecb
Merge remote-tracking branch 'origin' into liam-kusama-gov-v1-storage…
liamaharon e6048d9
reset cargo.lock
liamaharon 7473d8e
cargo update -p sp-io
liamaharon 3a47d7a
remove from chainspec
liamaharon 3eb21c0
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon 2779a6e
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon 25e81d4
remove polkadot gov v1 pallets
liamaharon 8ef96a0
clean up chain spec
liamaharon 6bf0aec
cargo fmt
liamaharon 6baa262
remove old gov import
liamaharon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,184 @@ | ||
| // Copyright 2022 Parity Technologies (UK) Ltd. | ||
| // This file is part of Polkadot. | ||
|
|
||
| // Polkadot is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU General Public License as published by | ||
| // the Free Software Foundation, either version 3 of the License, or | ||
| // (at your option) any later version. | ||
|
|
||
| // Polkadot is distributed in the hope that it will be useful, | ||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| // GNU General Public License for more details. | ||
|
|
||
| // You should have received a copy of the GNU General Public License | ||
| // along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| //! Old governance configurations for the Kusama runtime. | ||
| use crate::*; | ||
| use frame_support::{ | ||
| parameter_types, | ||
| traits::{EitherOfDiverse, LockIdentifier}, | ||
| }; | ||
| use static_assertions::const_assert; | ||
|
|
||
| parameter_types! { | ||
| pub LaunchPeriod: BlockNumber = prod_or_fast!(7 * DAYS, 1, "KSM_LAUNCH_PERIOD"); | ||
| pub VotingPeriod: BlockNumber = prod_or_fast!(7 * DAYS, 1 * MINUTES, "KSM_VOTING_PERIOD"); | ||
| pub FastTrackVotingPeriod: BlockNumber = prod_or_fast!(3 * HOURS, 1 * MINUTES, "KSM_FAST_TRACK_VOTING_PERIOD"); | ||
| pub const MinimumDeposit: Balance = 100 * CENTS; | ||
| pub EnactmentPeriod: BlockNumber = prod_or_fast!(8 * DAYS, 1, "KSM_ENACTMENT_PERIOD"); | ||
| pub CooloffPeriod: BlockNumber = prod_or_fast!(7 * DAYS, 1 * MINUTES, "KSM_COOLOFF_PERIOD"); | ||
| pub const InstantAllowed: bool = true; | ||
| pub const MaxVotes: u32 = 100; | ||
| pub const MaxProposals: u32 = 100; | ||
| pub MaxProposalWeight: Weight = Perbill::from_percent(50) * BlockWeights::get().max_block; | ||
| } | ||
|
|
||
| impl pallet_democracy::Config for Runtime { | ||
| type RuntimeEvent = RuntimeEvent; | ||
| type Currency = Balances; | ||
| type EnactmentPeriod = EnactmentPeriod; | ||
| type VoteLockingPeriod = EnactmentPeriod; | ||
| type LaunchPeriod = LaunchPeriod; | ||
| type VotingPeriod = VotingPeriod; | ||
| type MinimumDeposit = MinimumDeposit; | ||
| type SubmitOrigin = frame_system::EnsureSigned<AccountId>; | ||
| /// A straight majority of the council can decide what their next motion is. | ||
| type ExternalOrigin = | ||
| pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>; | ||
| /// A majority can have the next scheduled referendum be a straight majority-carries vote. | ||
| type ExternalMajorityOrigin = | ||
| pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>; | ||
| /// A unanimous council can have the next scheduled referendum be a straight default-carries | ||
| /// (NTB) vote. | ||
| type ExternalDefaultOrigin = | ||
| pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 1>; | ||
| /// Two thirds of the technical committee can have an `ExternalMajority/ExternalDefault` vote | ||
| /// be tabled immediately and with a shorter voting/enactment period. | ||
| type FastTrackOrigin = | ||
| pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 2, 3>; | ||
| type InstantOrigin = | ||
| pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>; | ||
| type InstantAllowed = InstantAllowed; | ||
| type FastTrackVotingPeriod = FastTrackVotingPeriod; | ||
| // To cancel a proposal which has been passed, 2/3 of the council must agree to it. | ||
| type CancellationOrigin = EitherOfDiverse< | ||
| EnsureRoot<AccountId>, | ||
| pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>, | ||
| >; | ||
| type BlacklistOrigin = EnsureRoot<AccountId>; | ||
| // To cancel a proposal before it has been passed, the technical committee must be unanimous or | ||
| // Root must agree. | ||
| type CancelProposalOrigin = EitherOfDiverse< | ||
| EnsureRoot<AccountId>, | ||
| pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>, | ||
| >; | ||
liamaharon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // Any single technical committee member may veto a coming council proposal, however they can | ||
| // only do it once and it lasts only for the cooloff period. | ||
| type VetoOrigin = pallet_collective::EnsureMember<AccountId, TechnicalCollective>; | ||
| type CooloffPeriod = CooloffPeriod; | ||
| type Slash = Treasury; | ||
| type Scheduler = Scheduler; | ||
| type PalletsOrigin = OriginCaller; | ||
| type MaxVotes = MaxVotes; | ||
| type WeightInfo = weights::pallet_democracy::WeightInfo<Runtime>; | ||
| type MaxProposals = MaxProposals; | ||
| type Preimages = Preimage; | ||
| type MaxDeposits = ConstU32<100>; | ||
| type MaxBlacklisted = ConstU32<100>; | ||
| } | ||
|
|
||
| parameter_types! { | ||
| pub CouncilMotionDuration: BlockNumber = prod_or_fast!(3 * DAYS, 2 * MINUTES, "KSM_MOTION_DURATION"); | ||
| pub const CouncilMaxProposals: u32 = 100; | ||
| pub const CouncilMaxMembers: u32 = 100; | ||
| } | ||
|
|
||
| pub type CouncilCollective = pallet_collective::Instance1; | ||
| impl pallet_collective::Config<CouncilCollective> for Runtime { | ||
| type RuntimeOrigin = RuntimeOrigin; | ||
| type Proposal = RuntimeCall; | ||
| type RuntimeEvent = RuntimeEvent; | ||
| type MotionDuration = CouncilMotionDuration; | ||
| type MaxProposals = CouncilMaxProposals; | ||
| type MaxMembers = CouncilMaxMembers; | ||
| type DefaultVote = pallet_collective::PrimeDefaultVote; | ||
| type SetMembersOrigin = EnsureRoot<AccountId>; | ||
| type WeightInfo = weights::pallet_collective_council::WeightInfo<Runtime>; | ||
| type MaxProposalWeight = MaxProposalWeight; | ||
| } | ||
|
|
||
| parameter_types! { | ||
| pub const CandidacyBond: Balance = 100 * CENTS; | ||
| // 1 storage item created, key size is 32 bytes, value size is 16+16. | ||
| pub const VotingBondBase: Balance = deposit(1, 64); | ||
| // additional data per vote is 32 bytes (account id). | ||
| pub const VotingBondFactor: Balance = deposit(0, 32); | ||
| /// Daily council elections | ||
| pub TermDuration: BlockNumber = prod_or_fast!(24 * HOURS, 2 * MINUTES, "KSM_TERM_DURATION"); | ||
| pub const DesiredMembers: u32 = 19; | ||
| pub const DesiredRunnersUp: u32 = 19; | ||
| pub const MaxVotesPerVoter: u32 = 16; | ||
| pub const MaxVoters: u32 = 10 * 1000; | ||
| pub const MaxCandidates: u32 = 1000; | ||
| pub const PhragmenElectionPalletId: LockIdentifier = *b"phrelect"; | ||
| } | ||
|
|
||
| // Make sure that there are no more than `MaxMembers` members elected via Phragmen. | ||
| const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get()); | ||
|
|
||
| impl pallet_elections_phragmen::Config for Runtime { | ||
| type RuntimeEvent = RuntimeEvent; | ||
| type Currency = Balances; | ||
| type ChangeMembers = Council; | ||
| type InitializeMembers = Council; | ||
| type CurrencyToVote = frame_support::traits::U128CurrencyToVote; | ||
| type CandidacyBond = CandidacyBond; | ||
| type VotingBondBase = VotingBondBase; | ||
| type VotingBondFactor = VotingBondFactor; | ||
| type LoserCandidate = Treasury; | ||
| type KickedMember = Treasury; | ||
| type DesiredMembers = DesiredMembers; | ||
| type DesiredRunnersUp = DesiredRunnersUp; | ||
| type TermDuration = TermDuration; | ||
| type MaxVoters = MaxVoters; | ||
| type MaxCandidates = MaxCandidates; | ||
| type MaxVotesPerVoter = MaxVotesPerVoter; | ||
| type PalletId = PhragmenElectionPalletId; | ||
| type WeightInfo = weights::pallet_elections_phragmen::WeightInfo<Runtime>; | ||
| } | ||
|
|
||
| parameter_types! { | ||
| pub TechnicalMotionDuration: BlockNumber = prod_or_fast!(3 * DAYS, 2 * MINUTES, "KSM_MOTION_DURATION"); | ||
| pub const TechnicalMaxProposals: u32 = 100; | ||
| pub const TechnicalMaxMembers: u32 = 100; | ||
| } | ||
|
|
||
| pub type TechnicalCollective = pallet_collective::Instance2; | ||
| impl pallet_collective::Config<TechnicalCollective> for Runtime { | ||
| type RuntimeOrigin = RuntimeOrigin; | ||
| type Proposal = RuntimeCall; | ||
| type RuntimeEvent = RuntimeEvent; | ||
| type MotionDuration = TechnicalMotionDuration; | ||
| type MaxProposals = TechnicalMaxProposals; | ||
| type MaxMembers = TechnicalMaxMembers; | ||
| type DefaultVote = pallet_collective::PrimeDefaultVote; | ||
| type SetMembersOrigin = EnsureRoot<AccountId>; | ||
| type WeightInfo = weights::pallet_collective_technical_committee::WeightInfo<Runtime>; | ||
| type MaxProposalWeight = MaxProposalWeight; | ||
| } | ||
|
|
||
| impl pallet_membership::Config<pallet_membership::Instance1> for Runtime { | ||
| type RuntimeEvent = RuntimeEvent; | ||
| type AddOrigin = EnsureRoot<AccountId>; | ||
| type RemoveOrigin = EnsureRoot<AccountId>; | ||
| type SwapOrigin = EnsureRoot<AccountId>; | ||
| type ResetOrigin = EnsureRoot<AccountId>; | ||
| type PrimeOrigin = EnsureRoot<AccountId>; | ||
| type MembershipInitialized = TechnicalCommittee; | ||
| type MembershipChanged = TechnicalCommittee; | ||
| type MaxMembers = TechnicalMaxMembers; | ||
| type WeightInfo = weights::pallet_membership::WeightInfo<Runtime>; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.