Skip to content

Commit

Permalink
Update to polkadot v0.9.19 (#543)
Browse files Browse the repository at this point in the history
* fix compile errors

* fix clippy

* bump versions

* bump package.json

* benchmark takes another arg

* cargo update

* simplify match statement

* [benchmarking bot] Auto commit generated weights files (#541)

Co-authored-by: Kailai-Wang <[email protected]>

* [benchmarking bot] Auto commit generated weights files (#542)

Co-authored-by: chenzongxiong <[email protected]>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kailai-Wang <[email protected]>
Co-authored-by: chenzongxiong <[email protected]>
  • Loading branch information
4 people authored Apr 27, 2022
1 parent bfa0468 commit 188fb1e
Show file tree
Hide file tree
Showing 58 changed files with 1,647 additions and 1,574 deletions.
1,189 changes: 588 additions & 601 deletions Cargo.lock

Large diffs are not rendered by default.

104 changes: 52 additions & 52 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ homepage = 'https://litentry.com/'
license = 'GPL-3.0'
name = 'litentry-collator'
repository = 'https://github.com/litentry/litentry-parachain'
version = '0.9.5'
version = '0.9.6'

[[bin]]
name = 'litentry-collator'
Expand All @@ -26,67 +26,67 @@ hex-literal = "0.3.4"
async-trait = "0.1.53"

# Substrate dependencies
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }

# RPC related dependencies
jsonrpc-core = "18.0.0"
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }

# Cumulus dependencies
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-collator = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.19" }
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.19" }
cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.19" }
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.19" }
cumulus-client-collator = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.19" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.19" }
cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.19" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.19" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.19" }
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.19" }
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.19" }
cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.19" }

# Polkadot dependencies
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.18" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.18" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.18" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.18" }
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.18" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.19" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.19" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.19" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.19" }
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.19" }

# Benchmarking
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }

# TryRuntime
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }

# Local dependencies
litentry-parachain-runtime = { path = "../runtime/litentry" }
Expand All @@ -96,7 +96,7 @@ moonbase-parachain-runtime = { path = "../runtime/moonbase" }
primitives = { path = "../primitives" }

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" }
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.19" }

[features]
default = []
Expand Down
5 changes: 3 additions & 2 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ pub enum Subcommand {
#[clap(subcommand)]
Key(sc_cli::KeySubcommand),

/// The custom benchmark subcommmand benchmarking runtime pallets.
#[clap(name = "benchmark", about = "Benchmark runtime pallets.")]
/// Sub-commands concerned with benchmarking.
/// The pallet benchmarking moved to the `pallet` sub-command.
#[clap(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// Try some testing command against a specified runtime state.
Expand Down
107 changes: 77 additions & 30 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::{
use codec::Encode;
use cumulus_client_service::genesis::generate_genesis_block;
use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::BenchmarkCmd;
use log::info;
use polkadot_parachain::primitives::AccountIdConversion;
use sc_cli::{
Expand Down Expand Up @@ -229,6 +230,39 @@ fn extract_genesis_wasm(chain_spec: &Box<dyn sc_service::ChainSpec>) -> Result<V
.ok_or_else(|| "Could not find wasm file in genesis state!".into())
}

/// Creates partial components for the runtimes that are supported by the benchmarks.
macro_rules! construct_benchmark_partials {
($config:expr, |$partials:ident| $code:expr) => {
if $config.chain_spec.is_litmus() {
let $partials = new_partial::<litmus_parachain_runtime::RuntimeApi, _>(
&$config,
crate::service::build_import_queue::<litmus_parachain_runtime::RuntimeApi>,
)?;
$code
} else if $config.chain_spec.is_litentry() {
let $partials = new_partial::<litentry_parachain_runtime::RuntimeApi, _>(
&$config,
crate::service::build_import_queue::<litentry_parachain_runtime::RuntimeApi>,
)?;
$code
} else if $config.chain_spec.is_rococo() {
let $partials = new_partial::<rococo_parachain_runtime::RuntimeApi, _>(
&$config,
crate::service::build_import_queue::<rococo_parachain_runtime::RuntimeApi>,
)?;
$code
} else if $config.chain_spec.is_moonbase() {
let $partials = new_partial::<moonbase_parachain_runtime::RuntimeApi, _>(
&$config,
crate::service::build_import_queue::<moonbase_parachain_runtime::RuntimeApi>,
)?;
$code
} else {
panic!("{}", UNSUPPORTED_CHAIN_MESSAGE)
}
};
}

macro_rules! construct_async_run {
(|$components:ident, $cli:ident, $cmd:ident, $config:ident| $( $code:tt )* ) => {{
let runner = $cli.create_runner($cmd)?;
Expand Down Expand Up @@ -336,7 +370,7 @@ pub fn run() -> Result<()> {
})
},
Some(Subcommand::Revert(cmd)) => construct_async_run!(|components, cli, cmd, config| {
Ok(cmd.run(components.client, components.backend))
Ok(cmd.run(components.client, components.backend, None))
}),

Some(Subcommand::Key(cmd)) => cmd.run(&cli),
Expand Down Expand Up @@ -385,36 +419,49 @@ pub fn run() -> Result<()> {

Ok(())
},
Some(Subcommand::Benchmark(cmd)) =>
if cfg!(feature = "runtime-benchmarks") {
let runner = cli.create_runner(cmd)?;

if !runner.config().chain_spec.is_dev() {
return Err("Only dev chain should be used in benchmark".into())
}
Some(Subcommand::Benchmark(cmd)) => {
let runner = cli.create_runner(cmd)?;

if runner.config().chain_spec.is_litmus() {
runner
.sync_run(|config| cmd.run::<Block, LitmusParachainRuntimeExecutor>(config))
} else if runner.config().chain_spec.is_litentry() {
runner.sync_run(|config| {
cmd.run::<Block, LitentryParachainRuntimeExecutor>(config)
// Switch on the concrete benchmark sub-command-
match cmd {
BenchmarkCmd::Pallet(cmd) =>
if cfg!(feature = "runtime-benchmarks") {
if !runner.config().chain_spec.is_dev() {
return Err("Only dev chain should be used in benchmark".into())
}

runner.sync_run(|config| {
if config.chain_spec.is_litmus() {
cmd.run::<Block, LitmusParachainRuntimeExecutor>(config)
} else if config.chain_spec.is_litentry() {
cmd.run::<Block, LitentryParachainRuntimeExecutor>(config)
} else if config.chain_spec.is_rococo() {
cmd.run::<Block, RococoParachainRuntimeExecutor>(config)
} else if config.chain_spec.is_moonbase() {
cmd.run::<Block, MoonbaseParachainRuntimeExecutor>(config)
} else {
Err(UNSUPPORTED_CHAIN_MESSAGE.into())
}
})
} else {
Err("Benchmarking wasn't enabled when building the node. \
You can enable it with `--features runtime-benchmarks`."
.into())
},
BenchmarkCmd::Block(cmd) => runner.sync_run(|config| {
construct_benchmark_partials!(config, |partials| cmd.run(partials.client))
}),
BenchmarkCmd::Storage(cmd) => runner.sync_run(|config| {
construct_benchmark_partials!(config, |partials| {
let db = partials.backend.expose_db();
let storage = partials.backend.expose_storage();

cmd.run(config, partials.client.clone(), db, storage)
})
} else if runner.config().chain_spec.is_rococo() {
runner
.sync_run(|config| cmd.run::<Block, RococoParachainRuntimeExecutor>(config))
} else if runner.config().chain_spec.is_moonbase() {
runner.sync_run(|config| {
cmd.run::<Block, MoonbaseParachainRuntimeExecutor>(config)
})
} else {
Err(UNSUPPORTED_CHAIN_MESSAGE.into())
}
} else {
Err("Benchmarking wasn't enabled when building the node. \
You can enable it with `--features runtime-benchmarks`."
.into())
},
}),
BenchmarkCmd::Overhead(_) => Err("Unsupported benchmarking command".into()),
}
},
Some(Subcommand::TryRuntime(cmd)) => {
if cfg!(feature = "try-runtime") {
let runner = cli.create_runner(cmd)?;
Expand Down Expand Up @@ -471,7 +518,7 @@ pub fn run() -> Result<()> {
let id = ParaId::from(para_id);

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

let state_version =
RelayChainCli::native_runtime_version(&config.chain_spec).state_version();
Expand Down
20 changes: 10 additions & 10 deletions pallets/bridge-transfer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }

# primitives
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false }

# frame dependencies
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false, optional = true }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false, optional = true }

pallet-bridge = { path = "../bridge", default-features = false }
hex = { version = "0.4", default-features = false }

[dev-dependencies]
hex-literal = "0.3"
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19", default-features = false }

[features]
default = ["std"]
Expand Down
Loading

0 comments on commit 188fb1e

Please sign in to comment.