diff --git a/polkadot/Cargo.lock b/polkadot/Cargo.lock index 3c2f0f3360..72b4be9600 100644 --- a/polkadot/Cargo.lock +++ b/polkadot/Cargo.lock @@ -2081,6 +2081,7 @@ dependencies = [ "srml-system 0.1.0 (git+https://github.com/paritytech/substrate)", "srml-timestamp 0.1.0 (git+https://github.com/paritytech/substrate)", "srml-treasury 0.1.0 (git+https://github.com/paritytech/substrate)", + "srml-upgrade-key 0.1.0 (git+https://github.com/paritytech/substrate)", "substrate-client 0.1.0 (git+https://github.com/paritytech/substrate)", "substrate-consensus-aura-primitives 0.1.0 (git+https://github.com/paritytech/substrate)", "substrate-keyring 0.1.0 (git+https://github.com/paritytech/substrate)", @@ -3008,6 +3009,25 @@ dependencies = [ "substrate-primitives 0.1.0 (git+https://github.com/paritytech/substrate)", ] +[[package]] +name = "srml-upgrade-key" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate#873e8c7df9b041b98255683a2e91626169ce5209" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0 (git+https://github.com/paritytech/substrate)", + "sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)", + "sr-std 0.1.0 (git+https://github.com/paritytech/substrate)", + "srml-consensus 0.1.0 (git+https://github.com/paritytech/substrate)", + "srml-support 0.1.0 (git+https://github.com/paritytech/substrate)", + "srml-support-procedural 0.1.0 (git+https://github.com/paritytech/substrate)", + "srml-system 0.1.0 (git+https://github.com/paritytech/substrate)", + "substrate-primitives 0.1.0 (git+https://github.com/paritytech/substrate)", +] + [[package]] name = "stable_deref_trait" version = "1.1.1" @@ -4577,6 +4597,7 @@ dependencies = [ "checksum srml-system 0.1.0 (git+https://github.com/paritytech/substrate)" = "" "checksum srml-timestamp 0.1.0 (git+https://github.com/paritytech/substrate)" = "" "checksum srml-treasury 0.1.0 (git+https://github.com/paritytech/substrate)" = "" +"checksum srml-upgrade-key 0.1.0 (git+https://github.com/paritytech/substrate)" = "" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" diff --git a/polkadot/cli/src/chain_spec.rs b/polkadot/cli/src/chain_spec.rs index 14593c73c3..c6186d4305 100644 --- a/polkadot/cli/src/chain_spec.rs +++ b/polkadot/cli/src/chain_spec.rs @@ -26,8 +26,8 @@ pub enum ChainSpec { Development, /// Whatever the current runtime is, with simple Alice/Bob auths. LocalTestnet, - /// The PoC-1 & PoC-2 era testnet. - KrummeLanke, + /// The PoC-3 era testnet. + Alexander, /// Whatever the current runtime is with the "global testnet" defaults. StagingTestnet, } @@ -36,7 +36,7 @@ pub enum ChainSpec { impl ChainSpec { pub(crate) fn load(self) -> Result { Ok(match self { - ChainSpec::KrummeLanke => service::chain_spec::poc_1_testnet_config()?, + ChainSpec::Alexander => service::chain_spec::poc_3_testnet_config()?, ChainSpec::Development => service::chain_spec::development_config(), ChainSpec::LocalTestnet => service::chain_spec::local_testnet_config(), ChainSpec::StagingTestnet => service::chain_spec::staging_testnet_config(), @@ -47,8 +47,7 @@ impl ChainSpec { match s { "dev" => Some(ChainSpec::Development), "local" => Some(ChainSpec::LocalTestnet), - "poc-1" => Some(ChainSpec::KrummeLanke), - "" | "krummelanke" => Some(ChainSpec::KrummeLanke), + "poc-3" | "alex" | "alexander" => Some(ChainSpec::Alexander), "staging" => Some(ChainSpec::StagingTestnet), _ => None, } diff --git a/polkadot/runtime/Cargo.toml b/polkadot/runtime/Cargo.toml index 7986ce3dbb..e065942cc9 100644 --- a/polkadot/runtime/Cargo.toml +++ b/polkadot/runtime/Cargo.toml @@ -33,6 +33,7 @@ srml-staking = { git = "https://github.com/paritytech/substrate" } srml-system = { git = "https://github.com/paritytech/substrate" } srml-timestamp = { git = "https://github.com/paritytech/substrate" } srml-treasury = { git = "https://github.com/paritytech/substrate" } +srml-upgrade-key = { git = "https://github.com/paritytech/substrate" } sr-version = { git = "https://github.com/paritytech/substrate" } [dev-dependencies] diff --git a/polkadot/runtime/src/lib.rs b/polkadot/runtime/src/lib.rs index 0e50472e7b..e8f3a49ddc 100644 --- a/polkadot/runtime/src/lib.rs +++ b/polkadot/runtime/src/lib.rs @@ -54,6 +54,7 @@ extern crate srml_staking as staking; extern crate srml_system as system; extern crate srml_timestamp as timestamp; extern crate srml_treasury as treasury; +extern crate srml_upgrade_key as upgrade_key; extern crate polkadot_primitives as primitives; @@ -214,6 +215,11 @@ impl parachains::Trait for Runtime { const SET_POSITION: u32 = PARACHAINS_SET_POSITION; } +impl upgrade_key::Trait for Runtime { + /// The uniquitous event type. + type Event = Event; +} + construct_runtime!( pub enum Runtime with Log(InternalLog: DigestItem) where Block = Block, @@ -236,6 +242,7 @@ construct_runtime!( CouncilSeats: council_seats::{Config}, Treasury: treasury, Parachains: parachains::{Module, Call, Storage, Config, Inherent}, + UpgradeKey: upgrade_key, } ); diff --git a/polkadot/runtime/wasm/Cargo.lock b/polkadot/runtime/wasm/Cargo.lock index c57799bb9f..e0c0c88b10 100644 --- a/polkadot/runtime/wasm/Cargo.lock +++ b/polkadot/runtime/wasm/Cargo.lock @@ -175,6 +175,7 @@ dependencies = [ "srml-system 0.1.0 (git+https://github.com/paritytech/substrate)", "srml-timestamp 0.1.0 (git+https://github.com/paritytech/substrate)", "srml-treasury 0.1.0 (git+https://github.com/paritytech/substrate)", + "srml-upgrade-key 0.1.0 (git+https://github.com/paritytech/substrate)", "substrate-client 0.1.0 (git+https://github.com/paritytech/substrate)", "substrate-consensus-aura-primitives 0.1.0 (git+https://github.com/paritytech/substrate)", "substrate-primitives 0.1.0 (git+https://github.com/paritytech/substrate)", @@ -587,6 +588,25 @@ dependencies = [ "substrate-primitives 0.1.0 (git+https://github.com/paritytech/substrate)", ] +[[package]] +name = "srml-upgrade-key" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate#873e8c7df9b041b98255683a2e91626169ce5209" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0 (git+https://github.com/paritytech/substrate)", + "sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)", + "sr-std 0.1.0 (git+https://github.com/paritytech/substrate)", + "srml-consensus 0.1.0 (git+https://github.com/paritytech/substrate)", + "srml-support 0.1.0 (git+https://github.com/paritytech/substrate)", + "srml-support-procedural 0.1.0 (git+https://github.com/paritytech/substrate)", + "srml-system 0.1.0 (git+https://github.com/paritytech/substrate)", + "substrate-primitives 0.1.0 (git+https://github.com/paritytech/substrate)", +] + [[package]] name = "static_assertions" version = "0.2.5" @@ -738,6 +758,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum srml-system 0.1.0 (git+https://github.com/paritytech/substrate)" = "" "checksum srml-timestamp 0.1.0 (git+https://github.com/paritytech/substrate)" = "" "checksum srml-treasury 0.1.0 (git+https://github.com/paritytech/substrate)" = "" +"checksum srml-upgrade-key 0.1.0 (git+https://github.com/paritytech/substrate)" = "" "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum substrate-client 0.1.0 (git+https://github.com/paritytech/substrate)" = "" "checksum substrate-consensus-aura-primitives 0.1.0 (git+https://github.com/paritytech/substrate)" = "" diff --git a/polkadot/runtime/wasm/Cargo.toml b/polkadot/runtime/wasm/Cargo.toml index 489feb6e54..cc5c93cc3d 100644 --- a/polkadot/runtime/wasm/Cargo.toml +++ b/polkadot/runtime/wasm/Cargo.toml @@ -32,6 +32,7 @@ srml-staking = { git = "https://github.com/paritytech/substrate", default-featur srml-system = { git = "https://github.com/paritytech/substrate", default-features = false } srml-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false } srml-treasury = { git = "https://github.com/paritytech/substrate", default-features = false } +srml-upgrade-key = { git = "https://github.com/paritytech/substrate", default-features = false } sr-version = { git = "https://github.com/paritytech/substrate", default-features = false } [profile.release] diff --git a/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm index 5707e824bf..c5f741f3fb 100644 Binary files a/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm and b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm differ diff --git a/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm index 344ab78154..473cda94f6 100755 Binary files a/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm and b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm differ diff --git a/polkadot/service/res/krummelanke.json b/polkadot/service/res/alexander.json similarity index 100% rename from polkadot/service/res/krummelanke.json rename to polkadot/service/res/alexander.json diff --git a/polkadot/service/src/chain_spec.rs b/polkadot/service/src/chain_spec.rs index 04ed54ba11..a2df4ed7d0 100644 --- a/polkadot/service/src/chain_spec.rs +++ b/polkadot/service/src/chain_spec.rs @@ -16,10 +16,11 @@ //! Polkadot chain configurations. -use primitives::{AuthorityId, ed25519}; +use primitives::{H256, AuthorityId, ed25519}; use polkadot_runtime::{ GenesisConfig, ConsensusConfig, CouncilSeatsConfig, DemocracyConfig, - SessionConfig, StakingConfig, TimestampConfig, BalancesConfig, Perbill, CouncilVotingConfig, GrandpaConfig + SessionConfig, StakingConfig, TimestampConfig, BalancesConfig, Perbill, + CouncilVotingConfig, GrandpaConfig, UpgradeKeyConfig }; const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; @@ -28,8 +29,8 @@ const DEFAULT_PROTOCOL_ID: &str = "dot"; /// Specialised `ChainSpec`. pub type ChainSpec = ::service::ChainSpec; -pub fn poc_1_testnet_config() -> Result { - ChainSpec::from_embedded(include_bytes!("../res/krummelanke.json")) +pub fn poc_3_testnet_config() -> Result { + ChainSpec::from_embedded(include_bytes!("../res/alexander.json")) } fn staging_testnet_config_genesis() -> GenesisConfig { @@ -106,6 +107,9 @@ fn staging_testnet_config_genesis() -> GenesisConfig { period: 2, // 2*2=4 second block time. }), treasury: Some(Default::default()), + upgrade_key: Some(UpgradeKeyConfig { + key: endowed_accounts[0], + }), } } @@ -124,7 +128,7 @@ pub fn staging_testnet_config() -> ChainSpec { ) } -fn testnet_genesis(initial_authorities: Vec) -> GenesisConfig { +fn testnet_genesis(initial_authorities: Vec, upgrade_key: H256) -> GenesisConfig { let endowed_accounts = vec![ ed25519::Pair::from_seed(b"Alice ").public().0.into(), ed25519::Pair::from_seed(b"Bob ").public().0.into(), @@ -197,13 +201,19 @@ fn testnet_genesis(initial_authorities: Vec) -> GenesisConfig { period: 2, // 2*2=4 second block time. }), treasury: Some(Default::default()), + upgrade_key: Some(UpgradeKeyConfig { + key: upgrade_key, + }), } } fn development_config_genesis() -> GenesisConfig { - testnet_genesis(vec![ - ed25519::Pair::from_seed(b"Alice ").public().into(), - ]) + testnet_genesis( + vec![ + ed25519::Pair::from_seed(b"Alice ").public().into(), + ], + ed25519::Pair::from_seed(b"Alice ").public().0.into() + ) } /// Development config (single validator Alice) @@ -221,10 +231,13 @@ pub fn development_config() -> ChainSpec { } fn local_testnet_genesis() -> GenesisConfig { - testnet_genesis(vec![ - ed25519::Pair::from_seed(b"Alice ").public().into(), - ed25519::Pair::from_seed(b"Bob ").public().into(), - ]) + testnet_genesis( + vec![ + ed25519::Pair::from_seed(b"Alice ").public().into(), + ed25519::Pair::from_seed(b"Bob ").public().into(), + ], + ed25519::Pair::from_seed(b"Alice ").public().0.into() + ) } /// Local testnet config (multivalidator Alice + Bob)