diff --git a/Cargo.lock b/Cargo.lock index 6a5ffc83..af602e5c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,7 +15,7 @@ dependencies = [ [[package]] name = "account" version = "0.1.1" -source = "git+https://github.com/darwinia-network/moonbeam.git?branch=polkadot-v0.9.30#9d31c6120bb0f317053da9cac7fe7cd2a44f844c" +source = "git+https://github.com/darwinia-network/moonbeam?branch=polkadot-v0.9.30#9d31c6120bb0f317053da9cac7fe7cd2a44f844c" dependencies = [ "blake2-rfc", "hex", @@ -9026,7 +9026,7 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "precompile-utils" version = "0.1.0" -source = "git+https://github.com/darwinia-network/moonbeam.git?branch=polkadot-v0.9.30#9d31c6120bb0f317053da9cac7fe7cd2a44f844c" +source = "git+https://github.com/darwinia-network/moonbeam?branch=polkadot-v0.9.30#9d31c6120bb0f317053da9cac7fe7cd2a44f844c" dependencies = [ "affix", "evm", @@ -9052,7 +9052,7 @@ dependencies = [ [[package]] name = "precompile-utils-macro" version = "0.1.0" -source = "git+https://github.com/darwinia-network/moonbeam.git?branch=polkadot-v0.9.30#9d31c6120bb0f317053da9cac7fe7cd2a44f844c" +source = "git+https://github.com/darwinia-network/moonbeam?branch=polkadot-v0.9.30#9d31c6120bb0f317053da9cac7fe7cd2a44f844c" dependencies = [ "case", "num_enum", @@ -13925,7 +13925,7 @@ dependencies = [ [[package]] name = "xcm-primitives" version = "0.1.0" -source = "git+https://github.com/darwinia-network/moonbeam.git?branch=polkadot-v0.9.30#9d31c6120bb0f317053da9cac7fe7cd2a44f844c" +source = "git+https://github.com/darwinia-network/moonbeam?branch=polkadot-v0.9.30#9d31c6120bb0f317053da9cac7fe7cd2a44f844c" dependencies = [ "ethereum", "ethereum-types", diff --git a/node/src/chain_spec/crab.rs b/node/src/chain_spec/crab.rs index f426e311..88c0b827 100644 --- a/node/src/chain_spec/crab.rs +++ b/node/src/chain_spec/crab.rs @@ -188,7 +188,7 @@ pub fn genesis_config() -> ChainSpec { treasury: Default::default(), // Utility stuff. - sudo: Default::default(), + sudo: SudoConfig { key: Some(array_bytes::hex_n_into_unchecked(ALITH)) }, vesting: Default::default(), // XCM stuff. diff --git a/node/src/chain_spec/darwinia.rs b/node/src/chain_spec/darwinia.rs index e35d3156..65d80f48 100644 --- a/node/src/chain_spec/darwinia.rs +++ b/node/src/chain_spec/darwinia.rs @@ -188,7 +188,7 @@ pub fn genesis_config() -> ChainSpec { treasury: Default::default(), // Utility stuff. - sudo: Default::default(), + sudo: SudoConfig { key: Some(array_bytes::hex_n_into_unchecked(ALITH)) }, vesting: Default::default(), // XCM stuff. diff --git a/node/src/chain_spec/pangolin.rs b/node/src/chain_spec/pangolin.rs index c8ddf4d0..50164a3a 100644 --- a/node/src/chain_spec/pangolin.rs +++ b/node/src/chain_spec/pangolin.rs @@ -188,7 +188,7 @@ pub fn genesis_config() -> ChainSpec { treasury: Default::default(), // Utility stuff. - sudo: Default::default(), + sudo: SudoConfig { key: Some(array_bytes::hex_n_into_unchecked(ALITH)) }, vesting: Default::default(), // XCM stuff. diff --git a/tool/state-processor/src/main.rs b/tool/state-processor/src/main.rs index 76f52e0b..fd9df8d2 100644 --- a/tool/state-processor/src/main.rs +++ b/tool/state-processor/src/main.rs @@ -18,6 +18,7 @@ mod evm; mod indices; mod proxy; mod staking; +mod sudo; mod system; mod vesting; diff --git a/tool/state-processor/src/processor.rs b/tool/state-processor/src/processor.rs index 4fb1e397..07efbcda 100644 --- a/tool/state-processor/src/processor.rs +++ b/tool/state-processor/src/processor.rs @@ -59,6 +59,7 @@ where .process_indices() .process_vesting() .process_proxy() + .process_sudo() .process_staking() .process_evm(); diff --git a/tool/state-processor/src/sudo/mod.rs b/tool/state-processor/src/sudo/mod.rs new file mode 100644 index 00000000..a13d8eb8 --- /dev/null +++ b/tool/state-processor/src/sudo/mod.rs @@ -0,0 +1,17 @@ +// darwinia +use crate::*; + +impl Processor { + pub fn process_sudo(&mut self) -> &mut Self { + // Storage items. + // https://github.dev/darwinia-network/substrate/blob/darwinia-v0.12.5/frame/sudo/src/lib.rs#L268 + // + // The new sudo key will be set on the genesis side. + // We just need to kill the old keys. + log::info!("drain solo and para `Sudo::Key`"); + self.solo_state.take_value(b"Sudo", b"Key", "", &mut [0_u8; 32]); + self.para_state.take_value(b"Sudo", b"Key", "", &mut [0_u8; 32]); + + self + } +}