Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare migrations for parachain-staking #488

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
464 changes: 235 additions & 229 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ resolver = "2"
[patch."https://github.com/purestake/nimbus"]
nimbus-consensus = { git = "https://github.com/zeitgeistpm/nimbus", branch = "moonbeam-polkadot-v0.9.16" }
nimbus-primitives = { git = "https://github.com/zeitgeistpm/nimbus", branch = "moonbeam-polkadot-v0.9.16" }

[patch."https://github.com/purestake/moonbeam"]
parachain-staking = { git = "https://github.com/zeitgeistpm/moonbeam", branch = "parachain-staking-migrations-3" }
4 changes: 2 additions & 2 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ cumulus-relay-chain-local = { branch = "moonbeam-polkadot-v0.9.16", git = "https
nimbus-consensus = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/nimbus", optional = true }
nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/nimbus", optional = true }
pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/nimbus", optional = true }
parachain-staking = { rev = "45257659f04b28dd4927b5dc611fac6f9e8905fd", git = "https://github.com/PureStake/moonbeam", optional = true }
parachain-staking = { rev = "45257659f04b28dd4927b5dc611fac6f9e8905fd", git = "https://github.com/purestake/moonbeam", optional = true }
parity-scale-codec = { optional = true, version = "3.0.0" }
sc-chain-spec = { branch = "moonbeam-polkadot-v0.9.16", git = "https://github.com/purestake/substrate", optional = true }
sc-network = { branch = "moonbeam-polkadot-v0.9.16", git = "https://github.com/purestake/substrate", optional = true }
Expand Down Expand Up @@ -155,4 +155,4 @@ name = "zeitgeist-node"
version = "0.2.4"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
targets = ["x86_64-unknown-linux-gnu"]
6 changes: 3 additions & 3 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sp-runtime = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, g
sp-session = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/substrate" }
sp-transaction-pool = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/substrate" }
sp-version = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/substrate" }
substrate-fixed = { default-features = false, features = ["serde"], git = "https://github.com/encointer/substrate-fixed" }
substrate-fixed = { rev = "5984ba9b9433d5007597c7f03f65ea5bf6d08601", default-features = false, features = ["serde"], git = "https://github.com/encointer/substrate-fixed" }

# Benchmark

Expand All @@ -55,10 +55,10 @@ parachain-info = { branch = "moonbeam-polkadot-v0.9.16", default-features = fals

nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/nimbus", optional = true }
pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/nimbus", optional = true }
pallet-author-mapping = { rev = "45257659f04b28dd4927b5dc611fac6f9e8905fd", default-features = false, git = "https://github.com/PureStake/moonbeam", optional = true }
pallet-author-mapping = { rev = "45257659f04b28dd4927b5dc611fac6f9e8905fd", default-features = false, git = "https://github.com/purestake/moonbeam", optional = true }
pallet-author-slot-filter = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/nimbus", optional = true }
pallet-crowdloan-rewards = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/PureStake/crowdloan-rewards", optional = true }
parachain-staking = { rev = "45257659f04b28dd4927b5dc611fac6f9e8905fd", default-features = false, git = "https://github.com/PureStake/moonbeam", optional = true }
parachain-staking = { rev = "45257659f04b28dd4927b5dc611fac6f9e8905fd", default-features = false, git = "https://github.com/purestake/moonbeam", optional = true }

# Polkadot

Expand Down
16 changes: 16 additions & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ mod xcm_config;
pub use parachain_params::*;
pub use parameters::*;

#[cfg(feature = "parachain")]
use parachain_staking::migrations::{PurgeStaleStorage, RemoveExitQueue};

use alloc::{boxed::Box, vec, vec::Vec};
use frame_support::{
construct_runtime,
Expand Down Expand Up @@ -77,13 +80,26 @@ type EnsureRootOrMoreThanHalfOfAdvisoryCommittee = EnsureOneOf<
AdvisoryCommitteeCollectiveInstance,
>,
>;

#[cfg(feature = "parachain")]
type Executive = frame_executive::Executive<
Runtime,
Block,
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
(PurgeStaleStorage<Runtime>, RemoveExitQueue<Runtime>),
>;

#[cfg(not(feature = "parachain"))]
type Executive = frame_executive::Executive<
Runtime,
Block,
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
>;

type Header = generic::Header<BlockNumber, BlakeTwo256>;
type RikiddoSigmoidFeeMarketVolumeEma = zrml_rikiddo::Instance1;

Expand Down
2 changes: 1 addition & 1 deletion zrml/prediction-markets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pallet-randomness-collective-flip = { branch = "moonbeam-polkadot-v0.9.16", git
pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.16", git = "https://github.com/purestake/substrate", optional = true }
sp-api = { branch = "moonbeam-polkadot-v0.9.16", git = "https://github.com/purestake/substrate", optional = true }
sp-io = { branch = "moonbeam-polkadot-v0.9.16", git = "https://github.com/purestake/substrate", optional = true }
substrate-fixed = { optional = true, git = "https://github.com/encointer/substrate-fixed" }
substrate-fixed = { rev = "5984ba9b9433d5007597c7f03f65ea5bf6d08601", optional = true, git = "https://github.com/encointer/substrate-fixed" }
zrml-prediction-markets-runtime-api = { features = ["std"], optional = true, path = "./runtime-api" }
zrml-rikiddo = { optional = true, path = "../rikiddo" }
zrml-swaps = { optional = true, path = "../swaps" }
Expand Down
2 changes: 1 addition & 1 deletion zrml/rikiddo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ frame-system = { branch = "moonbeam-polkadot-v0.9.16", default-features = false,
parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "2.0.0" }
sp-core = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/substrate" }
sp-runtime = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/substrate" }
substrate-fixed = { default-features = false, features = ["serde"], git = "https://github.com/encointer/substrate-fixed" }
substrate-fixed = { rev = "5984ba9b9433d5007597c7f03f65ea5bf6d08601", default-features = false, features = ["serde"], git = "https://github.com/encointer/substrate-fixed" }
zeitgeist-primitives = { default-features = false, path = "../../primitives" }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
hashbrown = { default-features = true, version = "0.11"}
Expand Down
4 changes: 2 additions & 2 deletions zrml/rikiddo/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ arbitrary = { features = ["derive"], version = "1.0" }
frame-support = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/substrate" }
frame-system = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/substrate" }
libfuzzer-sys = "0.4"
substrate-fixed = { default-features = false, git = "https://github.com/encointer/substrate-fixed" }
substrate-fixed = { rev = "5984ba9b9433d5007597c7f03f65ea5bf6d08601", default-features = false, git = "https://github.com/encointer/substrate-fixed" }
zrml-rikiddo = { features = ["arbitrary", "mock"], path = ".." }

[package]
Expand All @@ -86,4 +86,4 @@ publish = false
version = "0.0.0"

[package.metadata]
cargo-fuzz = true
cargo-fuzz = true
2 changes: 1 addition & 1 deletion zrml/swaps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frame-system = { branch = "moonbeam-polkadot-v0.9.16", default-features = false,
orml-traits = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/PureStake/open-runtime-module-library" }
parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "2.0.0" }
sp-runtime = { branch = "moonbeam-polkadot-v0.9.16", default-features = false, git = "https://github.com/purestake/substrate" }
substrate-fixed = { default-features = false, git = "https://github.com/encointer/substrate-fixed" }
substrate-fixed = { rev = "5984ba9b9433d5007597c7f03f65ea5bf6d08601", default-features = false, git = "https://github.com/encointer/substrate-fixed" }
zeitgeist-primitives = { default-features = false, path = "../../primitives" }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
zrml-liquidity-mining = { default-features = false, path = "../liquidity-mining" }
Expand Down