Bump Substrate to RC5 (#243)

* 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
This commit is contained in:
Hernando Castano
2020-08-03 06:55:30 -04:00
committed by Bastian Köcher
parent 80cc9e793e
commit 6fd1651b21
15 changed files with 435 additions and 358 deletions
+47 -47
View File
@@ -25,110 +25,110 @@ 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]
@@ -136,13 +136,13 @@ 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]
+36 -16
View File
@@ -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> {
@@ -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),
})
}
}
}
+171 -129
View File
@@ -17,12 +17,13 @@
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
use bridge_node_runtime::{self, opaque::Block, RuntimeApi};
use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider, SharedVoterState, StorageAndProofProvider};
use sc_client_api::ExecutorProvider;
use sc_consensus::LongestChain;
use sc_client_api::{ExecutorProvider, RemoteBackend};
use sc_executor::native_executor_instance;
pub use sc_executor::NativeExecutor;
use sc_service::{error::Error as ServiceError, AbstractService, Configuration, ServiceBuilder};
use sc_finality_grandpa::{
FinalityProofProvider as GrandpaFinalityProofProvider, SharedVoterState, StorageAndProofProvider,
};
use sc_service::{error::Error as ServiceError, Configuration, ServiceComponents, TaskManager};
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
use sp_inherents::InherentDataProviders;
use std::sync::Arc;
@@ -36,137 +37,175 @@ native_executor_instance!(
frame_benchmarking::benchmarking::HostFunctions,
);
/// Starts a `ServiceBuilder` for a full service.
///
/// Use this macro if you don't actually need the full service, but just the builder in order to
/// be able to perform chain operations.
macro_rules! new_full_start {
($config:expr) => {{
use std::sync::Arc;
type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;
type FullBackend = sc_service::TFullBackend<Block>;
type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
let mut import_setup = None;
#[allow(clippy::type_complexity)]
pub fn new_full_params(
config: Configuration,
) -> Result<
(
sc_service::ServiceParams<
Block,
FullClient,
sc_consensus_aura::AuraImportQueue<Block, FullClient>,
sc_transaction_pool::FullPool<Block, FullClient>,
jsonrpc_core::IoHandler<sc_rpc::Metadata>,
FullBackend,
>,
FullSelectChain,
sp_inherents::InherentDataProviders,
sc_finality_grandpa::GrandpaBlockImport<FullBackend, Block, FullClient, FullSelectChain>,
sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
),
ServiceError,
> {
let inherent_data_providers = sp_inherents::InherentDataProviders::new();
let builder = sc_service::ServiceBuilder::new_full::<
bridge_node_runtime::opaque::Block,
bridge_node_runtime::RuntimeApi,
crate::service::Executor,
>($config)?
.with_select_chain(|_config, backend| Ok(sc_consensus::LongestChain::new(backend.clone())))?
.with_transaction_pool(|builder| {
let pool_api = sc_transaction_pool::FullChainApi::new(builder.client().clone());
Ok(sc_transaction_pool::BasicPool::new(
builder.config().transaction_pool.clone(),
let (client, backend, keystore, task_manager) = sc_service::new_full_parts::<Block, RuntimeApi, Executor>(&config)?;
let client = Arc::new(client);
let select_chain = sc_consensus::LongestChain::new(backend.clone());
let pool_api = sc_transaction_pool::FullChainApi::new(client.clone(), config.prometheus_registry());
let transaction_pool = sc_transaction_pool::BasicPool::new_full(
config.transaction_pool.clone(),
std::sync::Arc::new(pool_api),
builder.prometheus_registry(),
))
})?
.with_import_queue(
|_config, client, mut select_chain, _transaction_pool, spawn_task_handle, registry| {
let select_chain = select_chain
.take()
.ok_or_else(|| sc_service::Error::SelectChainRequired)?;
let (grandpa_block_import, grandpa_link) =
grandpa::block_import(client.clone(), &(client.clone() as Arc<_>), select_chain)?;
let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(
grandpa_block_import.clone(),
config.prometheus_registry(),
task_manager.spawn_handle(),
client.clone(),
);
let (grandpa_block_import, grandpa_link) =
sc_finality_grandpa::block_import(client.clone(), &(client.clone() as Arc<_>), select_chain.clone())?;
let aura_block_import =
sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(grandpa_block_import.clone(), client.clone());
let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _>(
sc_consensus_aura::slot_duration(&*client)?,
aura_block_import,
Some(Box::new(grandpa_block_import.clone())),
None,
client,
client.clone(),
inherent_data_providers.clone(),
spawn_task_handle,
registry,
&task_manager.spawn_handle(),
config.prometheus_registry(),
)?;
import_setup = Some((grandpa_block_import, grandpa_link));
Ok(import_queue)
},
)?
.with_rpc_extensions(|builder| -> Result<jsonrpc_core::IoHandler<sc_rpc::Metadata>, _> {
let rpc_extensions_builder = {
use sc_rpc::DenyUnsafe;
use substrate_frame_rpc_system::{FullSystem, SystemApi};
let client = client.clone();
let pool = transaction_pool.clone();
Box::new(move |_| {
let mut io = jsonrpc_core::IoHandler::default();
io.extend_with(SystemApi::to_delegate(FullSystem::new(
builder.client().clone(),
builder.pool(),
client.clone(),
pool.clone(),
DenyUnsafe::No,
)));
Ok(io)
})?;
(builder, import_setup, inherent_data_providers)
}};
io
})
};
let provider = client.clone() as Arc<dyn StorageAndProofProvider<_, _>>;
let finality_proof_provider = Arc::new(GrandpaFinalityProofProvider::new(backend.clone(), provider));
let params = sc_service::ServiceParams {
backend,
client,
import_queue,
keystore,
task_manager,
transaction_pool,
config,
block_announce_validator_builder: None,
finality_proof_request_builder: None,
finality_proof_provider: Some(finality_proof_provider),
on_demand: None,
remote_blockchain: None,
rpc_extensions_builder,
};
Ok((
params,
select_chain,
inherent_data_providers,
grandpa_block_import,
grandpa_link,
))
}
/// Builds a new service for a full client.
pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceError> {
let role = config.role.clone();
let force_authoring = config.force_authoring;
let name = config.network.node_name.clone();
let disable_grandpa = config.disable_grandpa;
pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
let (params, select_chain, inherent_data_providers, block_import, grandpa_link) = new_full_params(config)?;
let (builder, mut import_setup, inherent_data_providers) = new_full_start!(config);
let (role, force_authoring, name, enable_grandpa, prometheus_registry, client, transaction_pool, keystore) = {
let sc_service::ServiceParams {
config,
client,
transaction_pool,
keystore,
..
} = &params;
let (block_import, grandpa_link) = import_setup
.take()
.expect("Link Half and Block Import are present for Full Services or setup failed before. qed");
(
config.role.clone(),
config.force_authoring,
config.network.node_name.clone(),
!config.disable_grandpa,
config.prometheus_registry().cloned(),
client.clone(),
transaction_pool.clone(),
keystore.clone(),
)
};
let service = builder
.with_finality_proof_provider(|client, backend| {
let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
})?
.build_full()?;
let ServiceComponents {
task_manager,
network,
telemetry_on_connect_sinks,
..
} = sc_service::build(params)?;
if role.is_authority() {
let proposer = sc_basic_authorship::ProposerFactory::new(
service.client(),
service.transaction_pool(),
service.prometheus_registry().as_ref(),
);
let client = service.client();
let select_chain = service.select_chain().ok_or(ServiceError::SelectChainRequired)?;
let proposer =
sc_basic_authorship::ProposerFactory::new(client.clone(), transaction_pool, prometheus_registry.as_ref());
let can_author_with = sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());
let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _>(
sc_consensus_aura::slot_duration(&*client)?,
client,
client.clone(),
select_chain,
block_import,
proposer,
service.network(),
network.clone(),
inherent_data_providers.clone(),
force_authoring,
service.keystore(),
keystore.clone(),
can_author_with,
)?;
// the AURA authoring task is considered essential, i.e. if it
// fails we take down the service with it.
service.spawn_essential_task_handle().spawn_blocking("aura", aura);
task_manager.spawn_essential_handle().spawn_blocking("aura", aura);
}
// if the node isn't actively participating in consensus then it doesn't
// need a keystore, regardless of which protocol we use below.
let keystore = if role.is_authority() {
Some(service.keystore() as sp_core::traits::BareCryptoStorePtr)
Some(keystore as sp_core::traits::BareCryptoStorePtr)
} else {
None
};
let grandpa_config = grandpa::Config {
let grandpa_config = sc_finality_grandpa::Config {
// FIXME #1578 make this available through chainspec
gossip_duration: Duration::from_millis(333),
justification_period: 512,
@@ -176,7 +215,6 @@ pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceEr
is_authority: role.is_network_authority(),
};
let enable_grandpa = !disable_grandpa;
if enable_grandpa {
// start the full GRANDPA voter
// NOTE: non-authorities could run the GRANDPA observer protocol, but at
@@ -184,59 +222,50 @@ pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceEr
// and vote data availability than the observer. The observer has not
// been tested extensively yet and having most nodes in a network run it
// could lead to finality stalls.
let grandpa_config = grandpa::GrandpaParams {
let grandpa_config = sc_finality_grandpa::GrandpaParams {
config: grandpa_config,
link: grandpa_link,
network: service.network(),
network,
inherent_data_providers,
telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
voting_rule: grandpa::VotingRulesBuilder::default().build(),
prometheus_registry: service.prometheus_registry(),
telemetry_on_connect: Some(telemetry_on_connect_sinks.on_connect_stream()),
voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(),
prometheus_registry,
shared_voter_state: SharedVoterState::empty(),
};
// the GRANDPA voter task is considered infallible, i.e.
// if it fails we take down the service with it.
service
.spawn_essential_task_handle()
.spawn_blocking("grandpa-voter", grandpa::run_grandpa_voter(grandpa_config)?);
task_manager
.spawn_essential_handle()
.spawn_blocking("grandpa-voter", sc_finality_grandpa::run_grandpa_voter(grandpa_config)?);
} else {
grandpa::setup_disabled_grandpa(service.client(), &inherent_data_providers, service.network())?;
sc_finality_grandpa::setup_disabled_grandpa(client, &inherent_data_providers, network)?;
}
Ok(service)
Ok(task_manager)
}
/// Builds a new service for a light client.
pub fn new_light(config: Configuration) -> Result<impl AbstractService, ServiceError> {
let inherent_data_providers = InherentDataProviders::new();
pub fn new_light(config: Configuration) -> Result<TaskManager, ServiceError> {
let (client, backend, keystore, task_manager, on_demand) =
sc_service::new_light_parts::<Block, RuntimeApi, Executor>(&config)?;
ServiceBuilder::new_light::<Block, RuntimeApi, Executor>(config)?
.with_select_chain(|_config, backend| Ok(LongestChain::new(backend.clone())))?
.with_transaction_pool(|builder| {
let fetcher = builder
.fetcher()
.ok_or_else(|| "Trying to start light transaction pool without active fetcher")?;
let pool_api = sc_transaction_pool::LightChainApi::new(builder.client().clone(), fetcher);
let pool = sc_transaction_pool::BasicPool::with_revalidation_type(
builder.config().transaction_pool.clone(),
Arc::new(pool_api),
builder.prometheus_registry(),
sc_transaction_pool::RevalidationType::Light,
);
Ok(pool)
})?
.with_import_queue_and_fprb(
|_config, client, backend, fetcher, _select_chain, _tx_pool, spawn_task_handle, prometheus_registry| {
let fetch_checker = fetcher
.map(|fetcher| fetcher.checker().clone())
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
let grandpa_block_import = grandpa::light_block_import(
let transaction_pool_api = Arc::new(sc_transaction_pool::LightChainApi::new(
client.clone(),
backend,
on_demand.clone(),
));
let transaction_pool = sc_transaction_pool::BasicPool::new_light(
config.transaction_pool.clone(),
transaction_pool_api,
config.prometheus_registry(),
task_manager.spawn_handle(),
);
let grandpa_block_import = sc_finality_grandpa::light_block_import(
client.clone(),
backend.clone(),
&(client.clone() as Arc<_>),
Arc::new(fetch_checker),
Arc::new(on_demand.checker().clone()) as Arc<_>,
)?;
let finality_proof_import = grandpa_block_import.clone();
let finality_proof_request_builder = finality_proof_import.create_finality_proof_request_builder();
@@ -246,18 +275,31 @@ pub fn new_light(config: Configuration) -> Result<impl AbstractService, ServiceE
grandpa_block_import,
None,
Some(Box::new(finality_proof_import)),
client,
inherent_data_providers.clone(),
spawn_task_handle,
prometheus_registry,
client.clone(),
InherentDataProviders::new(),
&task_manager.spawn_handle(),
config.prometheus_registry(),
)?;
Ok((import_queue, finality_proof_request_builder))
},
)?
.with_finality_proof_provider(|client, backend| {
let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
})?
.build_light()
let finality_proof_provider = Arc::new(GrandpaFinalityProofProvider::new(
backend.clone(),
client.clone() as Arc<_>,
));
sc_service::build(sc_service::ServiceParams {
block_announce_validator_builder: None,
finality_proof_request_builder: Some(finality_proof_request_builder),
finality_proof_provider: Some(finality_proof_provider),
on_demand: Some(on_demand),
remote_blockchain: Some(backend.remote_blockchain()),
rpc_extensions_builder: Box::new(|_| ()),
transaction_pool: Arc::new(transaction_pool),
config,
client,
import_queue,
keystore,
backend,
task_manager,
})
.map(|ServiceComponents { task_manager, .. }| task_manager)
}
+53 -53
View File
@@ -29,14 +29,14 @@ features = ["derive"]
# Substrate Dependencies
[dependencies.pallet-aura]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.pallet-balances]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
@@ -51,75 +51,75 @@ default-features = false
path = "../../../modules/currency-exchange"
[dependencies.frame-support]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.pallet-grandpa]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.pallet-randomness-collective-flip]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.pallet-sudo]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.pallet-session]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.frame-system]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.frame-system-rpc-runtime-api]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.pallet-timestamp]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.pallet-transaction-payment]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.frame-executive]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
# Substrate Primitives
[dependencies.sp-api]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-block-builder]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
@@ -134,75 +134,75 @@ default-features = false
path = "../../../primitives/currency-exchange"
[dependencies.sp-consensus-aura]
version = "0.8.0-rc4"
tag = 'v2.0.0-rc4'
version = "0.8.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-core]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-inherents]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-io]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-offchain]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-runtime]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-session]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-staking]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-std]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-transaction-pool]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-version]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.frame-benchmarking]
optional = true
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
@@ -219,7 +219,7 @@ path = "../../../primitives/ethereum-poa"
[build-dependencies.wasm-builder-runner]
version = "1.0.5"
tag = 'v2.0.0-rc4'
tag = 'v2.0.0-rc5'
package = "substrate-wasm-builder-runner"
git = "https://github.com/paritytech/substrate/"
+22 -10
View File
@@ -35,9 +35,6 @@ pub mod benches;
pub mod kovan;
pub mod rialto;
#[cfg(feature = "runtime-benchmarks")]
pub use benches as bridge;
use codec::{Decode, Encode};
use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};
use sp_api::impl_runtime_apis;
@@ -223,6 +220,8 @@ impl frame_system::Trait for Runtime {
type OnKilledAccount = ();
/// The data to be stored in an account.
type AccountData = pallet_balances::AccountData<Balance>;
/// Weight information for the extrinsics of this pallet.
type SystemWeightInfo = ();
}
impl pallet_aura::Trait for Runtime {
@@ -349,6 +348,7 @@ impl pallet_timestamp::Trait for Runtime {
type Moment = u64;
type OnTimestampSet = Aura;
type MinimumPeriod = MinimumPeriod;
type WeightInfo = ();
}
parameter_types! {
@@ -363,6 +363,7 @@ impl pallet_balances::Trait for Runtime {
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
}
parameter_types! {
@@ -398,6 +399,7 @@ impl pallet_session::Trait for Runtime {
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisabledValidatorsThreshold = ();
type WeightInfo = ();
}
pub struct ShiftSessionManager;
@@ -464,7 +466,7 @@ construct_runtime!(
System: frame_system::{Module, Call, Config, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
Aura: pallet_aura::{Module, Config<T>, Inherent(Timestamp)},
Aura: pallet_aura::{Module, Config<T>, Inherent},
Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Module, Storage},
@@ -650,14 +652,19 @@ impl_runtime_apis! {
Grandpa::grandpa_authorities()
}
fn submit_report_equivocation_extrinsic(
_equivocation_proof: fg_primitives::EquivocationProof<
fn submit_report_equivocation_unsigned_extrinsic(
equivocation_proof: fg_primitives::EquivocationProof<
<Block as BlockT>::Hash,
NumberFor<Block>,
>,
_key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,
key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,
) -> Option<()> {
None
let key_owner_proof = key_owner_proof.decode()?;
Grandpa::submit_unsigned_equivocation_report(
equivocation_proof,
key_owner_proof,
)
}
fn generate_key_ownership_proof(
@@ -737,8 +744,13 @@ impl_runtime_apis! {
}
}
add_benchmark!(params, batches, b"bridge-eth-poa", BridgeKovan);
add_benchmark!(params, batches, b"bridge-currency-exchange", BridgeCurrencyExchangeBench::<Runtime, KovanCurrencyExchange>);
add_benchmark!(params, batches, pallet_bridge_eth_poa, BridgeKovan);
add_benchmark!(
params,
batches,
pallet_bridge_currency_exchange,
BridgeCurrencyExchangeBench::<Runtime, KovanCurrencyExchange>
);
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
Ok(batches)
+14 -14
View File
@@ -13,44 +13,44 @@ sp-currency-exchange = { path = "../../primitives/currency-exchange", default-fe
# Substrate Based Dependencies
[dependencies.frame-support]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.frame-system]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-std]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-runtime]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.frame-benchmarking]
optional = true
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dev-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/"
[dev-dependencies.sp-io]
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/"
[features]
@@ -362,6 +362,7 @@ mod tests {
type OnNewAccount = ();
type OnKilledAccount = ();
type BaseCallFilter = ();
type SystemWeightInfo = ();
}
impl Trait for TestRuntime {
@@ -21,29 +21,29 @@ log = "0.4.11"
bridge-node-runtime = { path = "../../../bin/node/runtime" }
[dependencies.sp-blockchain]
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/"
[dependencies.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/"
[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/"
[dependencies.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/"
[dev-dependencies]
hex = "0.4"
[dev-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/"
+12 -12
View File
@@ -14,39 +14,39 @@ primitives = { package = "sp-bridge-eth-poa", path = "../../primitives/ethereum-
# Substrate Based Dependencies
[dependencies.frame-support]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.frame-system]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-std]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-io]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-runtime]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.frame-benchmarking]
optional = true
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
+1
View File
@@ -69,6 +69,7 @@ impl frame_system::Trait for TestRuntime {
type OnNewAccount = ();
type OnKilledAccount = ();
type BaseCallFilter = ();
type SystemWeightInfo = ();
}
parameter_types! {
+18 -18
View File
@@ -14,57 +14,57 @@ hash-db = { version = "0.15.2", default-features = false }
# Substrate Based Dependencies
[dependencies.frame-support]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.frame-system]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.pallet-session]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-core]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-finality-grandpa]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-runtime]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dependencies.sp-trie]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
# Dev Dependencies
[dev-dependencies.sp-io]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate/"
[dev-dependencies.sp-state-machine]
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/"
[features]
+1
View File
@@ -274,6 +274,7 @@ mod tests {
type OnNewAccount = ();
type OnKilledAccount = ();
type BaseCallFilter = ();
type SystemWeightInfo = ();
}
impl Trait for Test {}
@@ -12,20 +12,20 @@ codec = { package = "parity-scale-codec", version = "1.3.1", default-features =
# Substrate Based Dependencies
[dependencies.sp-api]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate.git"
[dependencies.sp-std]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate.git"
[dependencies.frame-support]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate.git"
+8 -8
View File
@@ -23,26 +23,26 @@ plain_hasher = { version = "0.2.2", default-features = false }
# Substrate Based Dependencies
[dependencies.sp-api]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate.git"
[dependencies.sp-std]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
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'
default-features = false
git = "https://github.com/paritytech/substrate.git"
[dependencies.sp-io]
version = "2.0.0-rc4"
tag = 'v2.0.0-rc4'
version = "2.0.0-rc5"
tag = 'v2.0.0-rc5'
default-features = false
git = "https://github.com/paritytech/substrate.git"
+15 -15
View File
@@ -7,7 +7,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
ansi_term = "0.12"
async-std = "=1.5.0"
async-std = "1.6.2"
async-stream = "0.2.0"
async-trait = "0.1.36"
backoff = "0.2"
@@ -43,38 +43,38 @@ features = ["http"]
# Substrate Based Dependencies
[dependencies.frame-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/"
[dependencies.pallet-transaction-payment]
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.node-primitives]
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.sp-keyring]
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.substrate-prometheus-endpoint]
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.bridge-node-runtime]