Skip to content

Commit

Permalink
Bump Substrate to RC5 (paritytech#243)
Browse files Browse the repository at this point in the history
* Bump Substrate to rc5

* Bump async-std to v1.6.2

There was a bug in v.1.6.0 which kept us locked to v1.5 releases.
I think that's fixed now so I'm bumping this.

* Update bridge node runtime

* Update node service

* Update CLI

* Add SystemWeightInfo type to test runtimes

* Add RPC extension builder to service

* Directly return rpc_extensions_builder

* Allow complex types in service

This comes from Substrate, so I'd rather just keep the code as is

* Update benchmarking code for new CLI
  • Loading branch information
HCastano authored and serban300 committed Apr 8, 2024
1 parent 3b904a9 commit 43d15d3
Show file tree
Hide file tree
Showing 15 changed files with 448 additions and 371 deletions.
94 changes: 47 additions & 47 deletions bridges/bin/node/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,124 +25,124 @@ default-features = false
features = ["std"]

[dependencies.sc-cli]
version = "0.8.0-rc4"
tag = 'v2.0.0-rc4'
version = "0.8.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sc-rpc]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sp-core]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sc-executor]
version = "0.8.0-rc4"
tag = 'v2.0.0-rc4'
version = "0.8.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sc-service]
version = "0.8.0-rc4"
tag = 'v2.0.0-rc4'
version = "0.8.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sp-inherents]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sc-transaction-pool]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sp-transaction-pool]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sc-network]
version = "0.8.0-rc4"
tag = 'v2.0.0-rc4'
version = "0.8.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sc-consensus-aura]
version = "0.8.0-rc4"
tag = 'v2.0.0-rc4'
version = "0.8.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sp-consensus-aura]
version = "0.8.0-rc4"
tag = 'v2.0.0-rc4'
version = "0.8.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sp-consensus]
version = "0.8.0-rc4"
tag = 'v2.0.0-rc4'
version = "0.8.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.grandpa]
[dependencies.sc-finality-grandpa]
package = "sc-finality-grandpa"
version = "0.8.0-rc4"
tag = 'v2.0.0-rc4'
version = "0.8.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.grandpa-primitives]
package = "sp-finality-grandpa"
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sc-consensus]
version = "0.8.0-rc4"
tag = 'v2.0.0-rc4'
version = "0.8.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sc-client-api]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sp-runtime]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.sc-basic-authorship]
version = "0.8.0-rc4"
tag = 'v2.0.0-rc4'
version = "0.8.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.substrate-frame-rpc-system]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.frame-benchmarking]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[dependencies.frame-benchmarking-cli]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[build-dependencies]
vergen = "3.1.0"

[build-dependencies.build-script-utils]
package = "substrate-build-script-utils"
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[build-dependencies.frame-benchmarking-cli]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
git = "https://github.com/paritytech/substrate.git"

[features]
Expand Down
52 changes: 36 additions & 16 deletions bridges/bin/node/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,37 +32,42 @@

use crate::cli::{Cli, Subcommand};
use crate::service;
use crate::service::new_full_params;
use bridge_node_runtime::Block;
use sc_cli::SubstrateCli;
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
use sc_cli::{ChainSpec, Role, RuntimeVersion, SubstrateCli};
use sc_service::ServiceParams;

impl SubstrateCli for Cli {
fn impl_name() -> &'static str {
"Bridge Node"
fn impl_name() -> String {
"Bridge Node".into()
}

fn impl_version() -> &'static str {
env!("CARGO_PKG_VERSION")
fn impl_version() -> String {
env!("CARGO_PKG_VERSION").into()
}

fn description() -> &'static str {
"Bridge Node"
fn description() -> String {
"Bridge Node".into()
}

fn author() -> &'static str {
"Parity Technologies"
fn author() -> String {
"Parity Technologies".into()
}

fn support_url() -> &'static str {
"https://github.com/paritytech/parity-bridges-common/"
fn support_url() -> String {
"https://github.com/paritytech/parity-bridges-common/".into()
}

fn copyright_start_year() -> i32 {
2019
}

fn executable_name() -> &'static str {
"bridge-node"
fn executable_name() -> String {
"bridge-node".into()
}

fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
&bridge_node_runtime::VERSION
}

fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
Expand Down Expand Up @@ -97,11 +102,26 @@ pub fn run() -> sc_cli::Result<()> {
}
Some(Subcommand::Base(subcommand)) => {
let runner = cli.create_runner(subcommand)?;
runner.run_subcommand(subcommand, |config| Ok(new_full_start!(config).0))
runner.run_subcommand(subcommand, |config| {
let (
ServiceParams {
client,
backend,
task_manager,
import_queue,
..
},
..,
) = new_full_params(config)?;
Ok((client, backend, import_queue, task_manager))
})
}
None => {
let runner = cli.create_runner(&cli.run)?;
runner.run_node(service::new_light, service::new_full, bridge_node_runtime::VERSION)
runner.run_node_until_exit(|config| match config.role {
Role::Light => service::new_light(config),
_ => service::new_full(config),
})
}
}
}
Loading

0 comments on commit 43d15d3

Please sign in to comment.