Skip to content

Commit

Permalink
Upgrade polkadot v0.9.16 (#567)
Browse files Browse the repository at this point in the history
* Update runtimes to polkadot 0.9.16

* Fix collator compilation

* Bump version
  • Loading branch information
akru authored Feb 14, 2022
1 parent 61add2a commit d38011e
Show file tree
Hide file tree
Showing 19 changed files with 1,438 additions and 1,084 deletions.
1,544 changes: 929 additions & 615 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exclude = [
panic = "unwind"

[patch.crates-io]
ethereum = { git = "https://github.com/AstarNetwork/ethereum", branch = "polkadot-v0.9.13" }
evm = { git = "https://github.com/AstarNetwork/evm", branch = "polkadot-v0.9.13" }
evm-gasometer = { git = "https://github.com/AstarNetwork/evm", branch = "polkadot-v0.9.13" }
evm-runtime = { git = "https://github.com/AstarNetwork/evm", branch = "polkadot-v0.9.13" }
ethereum = { git = "https://github.com/AstarNetwork/ethereum", branch = "polkadot-v0.9.16" }
evm = { git = "https://github.com/AstarNetwork/evm", branch = "polkadot-v0.9.16" }
evm-gasometer = { git = "https://github.com/AstarNetwork/evm", branch = "polkadot-v0.9.16" }
evm-runtime = { git = "https://github.com/AstarNetwork/evm", branch = "polkadot-v0.9.16" }
142 changes: 72 additions & 70 deletions bin/collator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "astar-collator"
version = "3.7.1"
version = "3.8.0"
authors = ["Stake Technologies <devops@stake.co.jp>"]
description = "Astar collator implementation in Rust."
build = "build.rs"
Expand All @@ -25,54 +25,54 @@ serde_json = "1.0"
log = "0.4.8"

# primitives
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-trie= { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-keystore= { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
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-core = { 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-trie= { 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-runtime = { 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-offchain = { 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-consensus = { 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" }

# client dependencies
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false }
sc-chain-spec = { 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" }
sc-finality-grandpa = { 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-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sc-offchain = { 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-service = { 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-tracing = { 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" }
sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }

# RPC related dependencies
jsonrpc-core = "18.0.0"
jsonrpc-pubsub = "18.0.0"

# Frontier dependencies
fc-consensus = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.13" }
fp-consensus = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.13" }
fc-rpc-core = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.13" }
fc-rpc = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.13", features = ["rpc_binary_search_estimate"] }
fp-rpc = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.13" }
fc-db = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.13" }
fc-mapping-sync = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.13" }
pallet-evm = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.13" }
pallet-ethereum = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.13" }
fc-consensus = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.16" }
fp-consensus = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.16" }
fc-rpc-core = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.16" }
fc-rpc = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.16", features = ["rpc_binary_search_estimate"] }
fp-rpc = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.16" }
fc-db = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.16" }
fc-mapping-sync = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.16" }
pallet-evm = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.16" }
pallet-ethereum = { git = "https://github.com/PlasmNetwork/frontier", branch = "polkadot-v0.9.16" }

# astar-specific dependencies
astar-runtime = { path = "../../runtime/astar" }
Expand All @@ -81,47 +81,49 @@ shiden-runtime = { path = "../../runtime/shiden" }
shibuya-runtime = { path = "../../runtime/shibuya" }

# frame dependencies
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
pallet-contracts-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
pallet-contracts-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }

# CLI-specific dependencies
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", optional = true }
sc-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.13" }
cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13" }
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13" }
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13" }
cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
cumulus-client-cli = { 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-client-consensus-aura = { 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-consensus-relay-chain = { 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" }
cumulus-relay-chain-interface = { 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" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }

# polkadot dependencies
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.13" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.13" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.13" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.13", optional = true }
polkadot-primitives = { 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-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16", optional = true }

# benchmark dependencies
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", optional = true }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", optional = true }
pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.13", optional = true }
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.13", optional = true }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", optional = true }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", optional = true }
pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16", optional = true }
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16", optional = true }

# try-runtime
frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", optional = true }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", optional = true }
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 }

[build-dependencies]
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", optional = true }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", optional = true }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.13", optional = true }
build-script-utils = { package = "substrate-build-script-utils", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", optional = true }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", optional = true }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16", optional = true }
build-script-utils = { package = "substrate-build-script-utils", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
structopt = { version = "0.3.8", optional = true }
vergen = { version = "3.0.4", optional = true }

Expand Down
34 changes: 25 additions & 9 deletions bin/collator/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,10 @@ pub fn run() -> Result<()> {
builder.with_profiling(sc_tracing::TracingReceiver::Log, "");
let _ = builder.init();

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

let block: Block = generate_genesis_block(&spec, state_version)?;
let raw_header = block.header().encode();
let output_buf = if params.raw {
raw_header
Expand Down Expand Up @@ -570,8 +570,9 @@ pub fn run() -> 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 polkadot_config = SubstrateCli::create_configuration(
Expand Down Expand Up @@ -668,11 +669,26 @@ 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 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<C: SubstrateCli>(&self) -> Result<()> {
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
5 changes: 4 additions & 1 deletion bin/collator/src/local/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub fn development_config() -> ChainSpec {
vec![],
None,
None,
None,
Some(properties),
None,
)
Expand Down Expand Up @@ -119,7 +120,9 @@ fn testnet_genesis(
false,
sp_runtime::Permill::from_parts(125_000),
),
sudo: SudoConfig { key: root_key },
sudo: SudoConfig {
key: Some(root_key),
},
}
}

Expand Down
Loading

0 comments on commit d38011e

Please sign in to comment.