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

chore: upgrade to polkadot v0.9.16 #348

Merged
merged 19 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
1,308 changes: 764 additions & 544 deletions Cargo.lock

Large diffs are not rendered by default.

356 changes: 179 additions & 177 deletions Cargo.toml

Large diffs are not rendered by default.

128 changes: 64 additions & 64 deletions integration-tests/Cargo.toml

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions integration-tests/src/kusama_test_net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use xcm_emulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain
decl_test_relay_chain! {
pub struct KusamaRelay {
Runtime = kusama_runtime::Runtime,
XcmConfig = kusama_runtime::XcmConfig,
XcmConfig = kusama_runtime::xcm_config::XcmConfig,
new_ext = kusama_ext(),
}
}
Expand All @@ -27,6 +27,8 @@ decl_test_parachain! {
pub struct Basilisk{
Runtime = basilisk_runtime::Runtime,
Origin = basilisk_runtime::Origin,
XcmpMessageHandler = basilisk_runtime::XcmpQueue,
DmpMessageHandler = basilisk_runtime::DmpQueue,
new_ext = basilisk_ext(),
}
}
Expand All @@ -35,6 +37,8 @@ decl_test_parachain! {
pub struct Hydra{
Runtime = basilisk_runtime::Runtime,
Origin = basilisk_runtime::Origin,
XcmpMessageHandler = basilisk_runtime::XcmpQueue,
DmpMessageHandler = basilisk_runtime::DmpQueue,
new_ext = hydra_ext(),
}
}
Expand All @@ -51,8 +55,9 @@ decl_test_network! {

fn default_parachains_host_configuration() -> HostConfiguration<BlockNumber> {
HostConfiguration {
validation_upgrade_frequency: 1u32,
validation_upgrade_delay: 1,
minimum_validation_upgrade_delay: 5,
validation_upgrade_cooldown: 5u32,
validation_upgrade_delay: 5,
code_retention_period: 1200,
max_code_size: MAX_CODE_SIZE,
max_pov_size: MAX_POV_SIZE,
Expand Down
116 changes: 59 additions & 57 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,67 +38,69 @@ pallet-lbp-rpc = { path="../pallets/lbp/rpc" }
pallet-lbp-rpc-runtime-api = {path = '../pallets/lbp/rpc/runtime-api', default-features = false}

# Substrate dependencies
frame-benchmarking = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
frame-benchmarking-cli = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15", optional = true }
pallet-transaction-payment-rpc = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-basic-authorship = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-chain-spec = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-cli = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15", features = ["wasmtime"] }
sc-client-api = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-consensus = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-consensus-aura = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-executor = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15", features = ["wasmtime"] }
sc-finality-grandpa = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-keystore = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-rpc = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-rpc-api = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-service = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15", features = ["wasmtime"] }
sc-tracing = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-telemetry = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-transaction-pool = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-transaction-pool-api = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-api = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-block-builder = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-blockchain = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-consensus = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-consensus-aura = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-consensus-babe = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-core = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-finality-grandpa = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-inherents = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-runtime = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-timestamp = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-transaction-pool = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-trie = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-storage = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
substrate-frame-rpc-system = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sc-network = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-keystore = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-session = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-offchain = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
substrate-prometheus-endpoint = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
pallet-grandpa = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
frame-system-rpc-runtime-api = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
pallet-transaction-payment-rpc-runtime-api = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
sp-authority-discovery = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15" }
frame-try-runtime = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15", optional = true }
try-runtime-cli = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.15", optional = true }
frame-benchmarking = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
frame-benchmarking-cli = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", optional = true }
pallet-transaction-payment-rpc = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-basic-authorship = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-chain-spec = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-cli = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", features = ["wasmtime"] }
sc-client-api = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-consensus = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-consensus-aura = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-executor = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", features = ["wasmtime"] }
sc-finality-grandpa = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-keystore = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-rpc = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-rpc-api = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-service = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", features = ["wasmtime"] }
sc-tracing = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-telemetry = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-transaction-pool = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-transaction-pool-api = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-api = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-block-builder = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-blockchain = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-consensus = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-consensus-aura = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-consensus-babe = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-core = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-finality-grandpa = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-inherents = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-runtime = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-timestamp = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-transaction-pool = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-trie = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-storage = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
substrate-frame-rpc-system = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-network = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-keystore = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-session = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-offchain = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
substrate-prometheus-endpoint = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
pallet-grandpa = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
frame-system-rpc-runtime-api = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
pallet-transaction-payment-rpc-runtime-api = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-authority-discovery = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
frame-try-runtime = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", optional = true }
try-runtime-cli = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", optional = true }

# Cumulus dependencies
cumulus-client-cli = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.15" }
cumulus-client-consensus-aura = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.15" }
cumulus-client-consensus-relay-chain = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.15" }
cumulus-client-consensus-common = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.15" }
cumulus-client-network = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.15" }
cumulus-client-service = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.15" }
cumulus-primitives-core = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.15" }
cumulus-primitives-parachain-inherent = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.15" }
cumulus-client-cli = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16" }
cumulus-client-consensus-aura = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16" }
cumulus-client-consensus-relay-chain = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16" }
cumulus-client-consensus-common = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16" }
cumulus-client-network = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16" }
cumulus-client-service = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16" }
cumulus-primitives-core = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16" }
cumulus-primitives-parachain-inherent = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16" }
cumulus-relay-chain-interface = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16" }
cumulus-relay-chain-local = { git = "/~https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16" }

# Polkadot dependencies
polkadot-cli = { git = "/~https://github.com/paritytech/polkadot", branch = "release-v0.9.15" }
polkadot-parachain = { git = "/~https://github.com/paritytech/polkadot", branch = "release-v0.9.15" }
polkadot-primitives = { git = "/~https://github.com/paritytech/polkadot", branch = "release-v0.9.15" }
polkadot-service = { git = "/~https://github.com/paritytech/polkadot", branch = "release-v0.9.15" }
polkadot-cli = { git = "/~https://github.com/paritytech/polkadot", branch = "release-v0.9.16" }
polkadot-parachain = { git = "/~https://github.com/paritytech/polkadot", branch = "release-v0.9.16" }
polkadot-primitives = { git = "/~https://github.com/paritytech/polkadot", branch = "release-v0.9.16" }
polkadot-service = { git = "/~https://github.com/paritytech/polkadot", branch = "release-v0.9.16" }

[features]
default = [
Expand Down
26 changes: 18 additions & 8 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ pub fn kusama_staging_parachain_config() -> Result<ChainSpec, String> {
),
// Protocol ID
Some(PROTOCOL_ID),
// Fork ID
None,
// Properties
Some(properties),
// Extensions
Expand Down Expand Up @@ -253,6 +255,8 @@ pub fn testnet_parachain_config() -> Result<ChainSpec, String> {
),
// Protocol ID
Some(PROTOCOL_ID),
// Fork ID
None,
// Properties
Some(properties),
// Extensions
Expand Down Expand Up @@ -321,6 +325,8 @@ pub fn parachain_development_config() -> Result<ChainSpec, String> {
None,
// Protocol ID
Some(PROTOCOL_ID),
// Fork ID
None,
// Properties
Some(properties),
// Extensions
Expand Down Expand Up @@ -391,6 +397,8 @@ pub fn benchmarks_development_config() -> Result<ChainSpec, String> {
None,
// Protocol ID
Some(PROTOCOL_ID),
// Fork ID
None,
// Properties
Some(properties),
// Extensions
Expand Down Expand Up @@ -467,6 +475,8 @@ pub fn local_parachain_config() -> Result<ChainSpec, String> {
None,
// Protocol ID
Some(PROTOCOL_ID),
// Fork ID
None,
// Properties
Some(properties),
// Extensions
Expand Down Expand Up @@ -509,7 +519,7 @@ fn parachain_genesis(
},
sudo: SudoConfig {
// Assign network admin rights.
key: root_key,
key: Some(root_key),
},
collator_selection: CollatorSelectionConfig {
invulnerables: initial_authorities.iter().cloned().map(|(acc, _)| acc).collect(),
Expand Down Expand Up @@ -540,7 +550,7 @@ fn parachain_genesis(
},
multi_transaction_payment: MultiTransactionPaymentConfig {
currencies: vec![],
fallback_account: tx_fee_payment_account,
fallback_account: Some(tx_fee_payment_account),
account_currencies: vec![],
},
tokens: TokensConfig { balances: vec![] },
Expand Down Expand Up @@ -576,8 +586,8 @@ fn parachain_genesis(
aura_ext: Default::default(),
duster: DusterConfig {
account_blacklist: vec![hex!["6d6f646c70792f74727372790000000000000000000000000000000000000000"].into()],
reward_account: hex!["6d6f646c70792f74727372790000000000000000000000000000000000000000"].into(),
dust_account: hex!["6d6f646c70792f74727372790000000000000000000000000000000000000000"].into(),
reward_account: Some(hex!["6d6f646c70792f74727372790000000000000000000000000000000000000000"].into()),
dust_account: Some(hex!["6d6f646c70792f74727372790000000000000000000000000000000000000000"].into()),
},
}
}
Expand Down Expand Up @@ -611,7 +621,7 @@ fn testnet_parachain_genesis(
},
sudo: SudoConfig {
// Assign network admin rights.
key: root_key,
key: Some(root_key),
},
collator_selection: CollatorSelectionConfig {
invulnerables: initial_authorities.iter().cloned().map(|(acc, _)| acc).collect(),
Expand Down Expand Up @@ -642,7 +652,7 @@ fn testnet_parachain_genesis(
},
multi_transaction_payment: MultiTransactionPaymentConfig {
currencies: accepted_assets,
fallback_account: tx_fee_payment_account,
fallback_account: Some(tx_fee_payment_account),
account_currencies: vec![],
},
tokens: TokensConfig {
Expand Down Expand Up @@ -681,8 +691,8 @@ fn testnet_parachain_genesis(
aura_ext: Default::default(),
duster: DusterConfig {
account_blacklist: vec![get_account_id_from_seed::<sr25519::Public>("Duster")],
reward_account: get_account_id_from_seed::<sr25519::Public>("Duster"),
dust_account: get_account_id_from_seed::<sr25519::Public>("Duster"),
reward_account: Some(get_account_id_from_seed::<sr25519::Public>("Duster")),
dust_account: Some(get_account_id_from_seed::<sr25519::Public>("Duster")),
},
}
}
39 changes: 29 additions & 10 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,13 @@ pub fn run() -> sc_cli::Result<()> {
params.runtime.is_testing_runtime()
};

let block: Block = generate_genesis_block(&load_spec(
&params.chain.clone().unwrap_or_default(),
is_testing_runtime,
)?)?;
let spec = load_spec(&params.chain.clone().unwrap_or_default(), false)?;
let state_version = Cli::native_runtime_version(&spec).state_version();

let block: Block = generate_genesis_block(
&load_spec(&params.chain.clone().unwrap_or_default(), is_testing_runtime)?,
state_version,
)?;
let raw_header = block.header().encode();
let output_buf = if params.raw {
raw_header
Expand Down Expand Up @@ -347,7 +350,10 @@ pub fn run() -> sc_cli::Result<()> {

let parachain_account = AccountIdConversion::<polkadot_primitives::v0::AccountId>::into_account(&id);

let block: Block = generate_genesis_block(&config.chain_spec).map_err(|e| format!("{:?}", e))?;
let state_version = Cli::native_runtime_version(&config.chain_spec).state_version();

let block: Block =
generate_genesis_block(&config.chain_spec, state_version).map_err(|e| format!("{:?}", e))?;
let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode()));

let task_executor = config.tokio_handle.clone();
Expand Down Expand Up @@ -425,11 +431,24 @@ impl CliConfiguration<Self> for RelayChainCli {
self.base.base.rpc_ws(default_listen_port)
}

fn prometheus_config(&self, default_listen_port: u16) -> Result<Option<PrometheusConfig>> {
self.base.base.prometheus_config(default_listen_port)
}

fn init<C: SubstrateCli>(&self) -> Result<()> {
fn prometheus_config(
&self,
default_listen_port: u16,
chain_spec: &Box<dyn ChainSpec>,
) -> Result<Option<PrometheusConfig>> {
self.base.base.prometheus_config(default_listen_port, chain_spec)
}

fn init<F>(
&self,
_support_url: &String,
_impl_version: &String,
_logger_hook: F,
_config: &sc_service::Configuration,
) -> Result<()>
where
F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration),
{
unreachable!("PolkadotCli is never initialized; qed");
}

Expand Down
Loading