Unverified Commit 29fea4e4 authored by Gavin Wood's avatar Gavin Wood Committed by GitHub
Browse files

Remove Sudo (#1437)

* Remove Sudo

NOTE: To ensure minimal index changes to pre-existing pallet deployments,
this is done with a "swap_remove" style; the previous last pallet
(Purchase), which is hitherto unused, has been shifted into the old index
of Sudo.

* Remove CC1 designation.

* Fixes

* Bump

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes
parent 4a997abe
Pipeline #101061 passed with stages
in 19 minutes
......@@ -2422,7 +2422,7 @@ dependencies = [
[[package]]
name = "kusama-runtime"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"bitvec",
"frame-benchmarking",
......@@ -4302,7 +4302,7 @@ checksum = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e"
[[package]]
name = "polkadot"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"assert_cmd",
"futures 0.3.5",
......@@ -4316,7 +4316,7 @@ dependencies = [
[[package]]
name = "polkadot-availability-store"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"derive_more 0.99.9",
"exit-future",
......@@ -4342,7 +4342,7 @@ dependencies = [
[[package]]
name = "polkadot-cli"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"frame-benchmarking-cli",
"futures 0.3.5",
......@@ -4367,7 +4367,7 @@ dependencies = [
[[package]]
name = "polkadot-collator"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"futures 0.3.5",
"futures-timer 2.0.2",
......@@ -4405,7 +4405,7 @@ dependencies = [
[[package]]
name = "polkadot-erasure-coding"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"derive_more 0.15.0",
"parity-scale-codec",
......@@ -4417,7 +4417,7 @@ dependencies = [
[[package]]
name = "polkadot-network"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"arrayvec 0.4.12",
"bytes 0.5.5",
......@@ -4466,7 +4466,7 @@ dependencies = [
[[package]]
name = "polkadot-network-test"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"futures 0.3.5",
"log 0.4.8",
......@@ -4585,7 +4585,7 @@ dependencies = [
[[package]]
name = "polkadot-parachain"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"derive_more 0.99.9",
"log 0.4.8",
......@@ -4624,7 +4624,7 @@ dependencies = [
[[package]]
name = "polkadot-primitives"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"bitvec",
"frame-system",
......@@ -4648,7 +4648,7 @@ dependencies = [
[[package]]
name = "polkadot-rpc"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"jsonrpc-core",
"pallet-transaction-payment-rpc",
......@@ -4674,7 +4674,7 @@ dependencies = [
[[package]]
name = "polkadot-runtime"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"bitvec",
"frame-benchmarking",
......@@ -4710,7 +4710,6 @@ dependencies = [
"pallet-session-benchmarking",
"pallet-staking",
"pallet-staking-reward-curve",
"pallet-sudo",
"pallet-timestamp",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
......@@ -4749,7 +4748,7 @@ dependencies = [
[[package]]
name = "polkadot-runtime-common"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"bitvec",
"frame-benchmarking",
......@@ -4837,7 +4836,7 @@ dependencies = [
[[package]]
name = "polkadot-service"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"env_logger",
"frame-benchmarking",
......@@ -4981,7 +4980,7 @@ dependencies = [
[[package]]
name = "polkadot-statement-table"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"parity-scale-codec",
"polkadot-primitives",
......@@ -5001,7 +5000,7 @@ dependencies = [
[[package]]
name = "polkadot-test-runtime"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"bitvec",
"frame-executive",
......@@ -5132,7 +5131,7 @@ dependencies = [
[[package]]
name = "polkadot-validation"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"ansi_term 0.12.1",
"bitvec",
......@@ -8360,7 +8359,7 @@ dependencies = [
[[package]]
name = "test-parachain-adder"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"dlmalloc",
"parity-scale-codec",
......@@ -8401,7 +8400,7 @@ dependencies = [
[[package]]
name = "test-parachain-halt"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"substrate-wasm-builder-runner 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
......@@ -9340,7 +9339,7 @@ dependencies = [
[[package]]
name = "westend-runtime"
version = "0.8.16"
version = "0.8.17"
dependencies = [
"bitvec",
"frame-benchmarking",
......
......@@ -4,7 +4,7 @@ path = "src/main.rs"
[package]
name = "polkadot"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
......@@ -61,9 +61,9 @@ cargo build --release
This repo supports runtimes for Polkadot, Kusama, and Westend.
### Connect to Polkadot Chain Candidate 1 (CC1)
### Connect to Polkadot Mainnet
Connect to the global Polkadot CC1 network by running:
Connect to the global Polkadot Mainnet network by running:
```bash
./target/release/polkadot --chain=polkadot
......@@ -71,7 +71,7 @@ Connect to the global Polkadot CC1 network by running:
You can see your node on [telemetry] (set a custom name with `--name "my custom name"`).
[telemetry]: https://telemetry.polkadot.io/#list/Polkadot%20CC1
[telemetry]: https://telemetry.polkadot.io/#list/Polkadot
### Connect to the "Kusama" Canary Network
......
[package]
name = "polkadot-availability-store"
description = "Persistent database for parachain data"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-cli"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot Relay-chain Client Node"
edition = "2018"
......
[package]
name = "polkadot-collator"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator node implementation"
edition = "2018"
......
[package]
name = "polkadot-erasure-coding"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-network"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot-specific networking protocol"
edition = "2018"
......
[package]
name = "polkadot-network-test"
version = "0.8.16"
version = "0.8.17"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
......@@ -194,9 +194,6 @@ fn polkadot_staging_testnet_config_genesis() -> polkadot::GenesisConfig {
vesting: Some(polkadot::VestingConfig {
vesting: vec![],
}),
sudo: Some(polkadot::SudoConfig {
key: endowed_accounts[0].clone(),
}),
}
}
......@@ -599,7 +596,7 @@ fn testnet_accounts() -> Vec<AccountId> {
/// Helper function to create polkadot GenesisConfig for testing
pub fn polkadot_testnet_genesis(
initial_authorities: Vec<(AccountId, AccountId, BabeId, GrandpaId, ImOnlineId, ValidatorId, AuthorityDiscoveryId)>,
root_key: AccountId,
_root_key: AccountId,
endowed_accounts: Option<Vec<AccountId>>,
) -> polkadot::GenesisConfig {
let endowed_accounts: Vec<AccountId> = endowed_accounts.unwrap_or_else(testnet_accounts);
......@@ -667,9 +664,6 @@ pub fn polkadot_testnet_genesis(
vesting: Some(polkadot::VestingConfig {
vesting: vec![],
}),
sudo: Some(polkadot::SudoConfig {
key: root_key,
}),
}
}
......
[package]
name = "polkadot-parachain"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Types and utilities for creating and working with parachains"
edition = "2018"
......
[package]
name = "test-parachain-adder"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which adds to a number as its state transition"
edition = "2018"
......
[package]
name = "test-parachain-halt"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which executes forever"
edition = "2018"
......
[package]
name = "polkadot-primitives"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-rpc"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-runtime-common"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "kusama-runtime"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
......
......@@ -87,7 +87,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 2016,
spec_version: 2017,
impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS,
......
[package]
name = "polkadot-runtime"
version = "0.8.16"
version = "0.8.17"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
......@@ -60,7 +60,6 @@ system = { package = "frame-system", git = "https://github.com/paritytech/substr
system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
timestamp = { package = "pallet-timestamp", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
treasury = { package = "pallet-treasury", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sudo = { package = "pallet-sudo", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
vesting = { package = "pallet-vesting", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
utility = { package = "pallet-utility", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
......@@ -140,7 +139,6 @@ std = [
"sp-session/std",
"randomness-collective-flip/std",
"runtime-common/std",
"sudo/std",
"vesting/std",
"utility/std",
]
......
......@@ -93,13 +93,13 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polkadot"),
impl_name: create_runtime_str!("parity-polkadot"),
authoring_version: 0,
spec_version: 16,
spec_version: 17,
impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS,
#[cfg(feature = "disable-runtime-api")]
apis: version::create_apis_vec![[]],
transaction_version: 2,
transaction_version: 3,
};
/// Native version.
......@@ -132,7 +132,7 @@ impl Filter<Call> for BaseFilter {
Call::Authorship(_) | Call::Staking(_) | Call::Offences(_) |
Call::Session(_) | Call::FinalityTracker(_) | Call::Grandpa(_) | Call::ImOnline(_) |
Call::AuthorityDiscovery(_) |
Call::Utility(_) | Call::Claims(_) | Call::Vesting(_) | Call::Sudo(_) |
Call::Utility(_) | Call::Claims(_) | Call::Vesting(_) |
Call::Identity(_) | Call::Proxy(_) | Call::Multisig(_) | Call::Poll(_) |
Call::Purchase(_) =>
true,
......@@ -815,11 +815,6 @@ impl multisig::Trait for Runtime {
type WeightInfo = ();
}
impl sudo::Trait for Runtime {
type Event = Event;
type Call = Call;
}
parameter_types! {
// One storage item; key size 32, value size 8; .
pub const ProxyDepositBase: Balance = deposit(1, 8);
......@@ -831,13 +826,43 @@ parameter_types! {
/// The type used to represent the kinds of proxying allowed.
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug)]
pub enum ProxyType {
Any,
NonTransfer,
Governance,
Staking,
SudoBalances,
IdentityJudgement,
Any = 0,
NonTransfer = 1,
Governance = 2,
Staking = 3,
// Skip 4 as it is now removed (was SudoBalances)
IdentityJudgement = 5,
}
#[cfg(test)]
mod proxt_type_tests {
use super::*;
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug)]
pub enum OldProxyType {
Any,
NonTransfer,
Governance,
Staking,
SudoBalances,
IdentityJudgement,
}
#[test]
fn proxy_type_decodes_correctly() {
for (i, j) in vec![
(OldProxyType::Any, ProxyType::Any),
(OldProxyType::NonTransfer, ProxyType::NonTransfer),
(OldProxyType::Governance, ProxyType::Governance),
(OldProxyType::Staking, ProxyType::Staking),
(OldProxyType::IdentityJudgement, ProxyType::IdentityJudgement),
].into_iter() {
assert_eq!(i.encode(), j.encode());
}
assert!(ProxyType::decode(&mut &OldProxyType::SudoBalances.encode()[..]).is_err());
}
}
impl Default for ProxyType { fn default() -> Self { Self::Any } }
impl InstanceFilter<Call> for ProxyType {
fn filter(&self, c: &Call) -> bool {
......@@ -876,7 +901,6 @@ impl InstanceFilter<Call> for ProxyType {
Call::Vesting(vesting::Call::vest_other(..)) |
// Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer`
Call::Utility(..) |
// Specifically omitting Sudo pallet
Call::Identity(..) |
Call::Proxy(..) |
Call::Multisig(..)
......@@ -889,11 +913,6 @@ impl InstanceFilter<Call> for ProxyType {
ProxyType::Staking => matches!(c,
Call::Staking(..) | Call::Utility(utility::Call::batch(..)) | Call::Utility(..)
),
ProxyType::SudoBalances => match c {
Call::Sudo(sudo::Call::sudo(ref x)) => matches!(x.as_ref(), &Call::Balances(..)),
Call::Utility(..) => true,
_ => false,
},
ProxyType::IdentityJudgement => matches!(c,
Call::Identity(identity::Call::provide_judgement(..))
| Call::Utility(utility::Call::batch(..))
......@@ -1037,8 +1056,8 @@ construct_runtime! {
// Cunning utilities. Usable initially.
Utility: utility::{Module, Call, Event},
// Sudo. Last module. Usable initially, but removed once governance enabled.
Sudo: sudo::{Module, Call, Storage, Config<T>, Event<T>},
// DOT Purchase module. Late addition; this is in place of Sudo.
Purchase: purchase::{Module, Call, Storage, Event<T>},
// Identity. Late addition.
Identity: identity::{Module, Call, Storage, Event<T>},
......@@ -1051,9 +1070,6 @@ construct_runtime! {
// Poll module.
Poll: poll::{Module, Call, Storage, Event<T>},
// DOT Purchase module. Late addition.
Purchase: purchase::{Module, Call, Storage, Event<T>},
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment