mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 08:51:09 +00:00
Migrate to new substrate (#79)
* new substrate version + actually verify justification * cargo update + fix remaining stuff * add weight=0 comments * cargo fmt --all * fix hash types
This commit is contained in:
committed by
Bastian Köcher
parent
4bbef4d45a
commit
50d6ed186f
@@ -19,95 +19,100 @@ bridge-node-runtime = { version = "0.1.0", path = "../runtime" }
|
||||
sp-bridge-eth-poa = { version = "0.1.0", path = "../../../primitives/ethereum-poa" }
|
||||
|
||||
[dependencies.sc-cli]
|
||||
version = "0.8.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "0.8.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sc-rpc]
|
||||
version = "2.0.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "2.0.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sp-core]
|
||||
version = "2.0.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "2.0.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sc-executor]
|
||||
version = "0.8.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "0.8.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sc-service]
|
||||
version = "0.8.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "0.8.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sp-inherents]
|
||||
version = "2.0.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "2.0.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sc-transaction-pool]
|
||||
version = "2.0.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "2.0.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sp-transaction-pool]
|
||||
version = "2.0.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "2.0.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sc-network]
|
||||
version = "0.8.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "0.8.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sc-consensus-aura]
|
||||
version = "0.8.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "0.8.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sp-consensus-aura]
|
||||
version = "0.8.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "0.8.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sp-consensus]
|
||||
version = "0.8.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "0.8.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.grandpa]
|
||||
package = "sc-finality-grandpa"
|
||||
version = "0.8.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "0.8.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.grandpa-primitives]
|
||||
package = "sp-finality-grandpa"
|
||||
version = "2.0.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "2.0.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sc-client-api]
|
||||
version = "2.0.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sc-client]
|
||||
version = "0.8.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "0.8.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sp-runtime]
|
||||
version = "2.0.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "2.0.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.sc-basic-authorship]
|
||||
version = "0.8.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "0.8.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[dependencies.substrate-frame-rpc-system]
|
||||
version = "2.0.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "2.0.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
[build-dependencies]
|
||||
@@ -115,6 +120,6 @@ vergen = "3.1.0"
|
||||
|
||||
[build-dependencies.build-script-utils]
|
||||
package = "substrate-build-script-utils"
|
||||
version = "2.0.0-alpha.2"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
version = "2.0.0-alpha.6"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate.git"
|
||||
|
||||
@@ -25,7 +25,7 @@ use sp_core::{sr25519, Pair, Public};
|
||||
use sp_runtime::traits::{IdentifyAccount, Verify};
|
||||
|
||||
/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
|
||||
pub type ChainSpec = sc_service::ChainSpec<GenesisConfig>;
|
||||
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig>;
|
||||
|
||||
/// The chain specification option. This is expected to come in from the CLI and
|
||||
/// is little more than one of a number of alternatives which can easily be converted
|
||||
@@ -71,6 +71,7 @@ impl Alternative {
|
||||
Alternative::Development => ChainSpec::from_genesis(
|
||||
"Development",
|
||||
"dev",
|
||||
sc_service::ChainType::Development,
|
||||
|| {
|
||||
testnet_genesis(
|
||||
vec![get_authority_keys_from_seed("Alice")],
|
||||
@@ -93,6 +94,7 @@ impl Alternative {
|
||||
Alternative::LocalTestnet => ChainSpec::from_genesis(
|
||||
"Local Testnet",
|
||||
"local_testnet",
|
||||
sc_service::ChainType::Local,
|
||||
|| {
|
||||
testnet_genesis(
|
||||
vec![
|
||||
@@ -128,14 +130,6 @@ impl Alternative {
|
||||
),
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn from(s: &str) -> Option<Self> {
|
||||
match s {
|
||||
"" | "dev" => Some(Alternative::Development),
|
||||
"local" => Some(Alternative::LocalTestnet),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn session_keys(aura: AuraId, grandpa: GrandpaId) -> SessionKeys {
|
||||
@@ -173,13 +167,6 @@ fn testnet_genesis(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn load_spec(id: &str) -> Result<Option<ChainSpec>, String> {
|
||||
Ok(match Alternative::from(id) {
|
||||
Some(spec) => Some(spec.load()?),
|
||||
None => None,
|
||||
})
|
||||
}
|
||||
|
||||
fn load_kovan_config() -> Option<BridgeEthPoAConfig> {
|
||||
Some(BridgeEthPoAConfig {
|
||||
initial_header: sp_bridge_eth_poa::Header {
|
||||
|
||||
@@ -30,28 +30,64 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::chain_spec;
|
||||
use crate::cli::Cli;
|
||||
use crate::service;
|
||||
use sc_cli::VersionInfo;
|
||||
use sc_cli::SubstrateCli;
|
||||
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
|
||||
|
||||
impl SubstrateCli for Cli {
|
||||
fn impl_name() -> &'static str {
|
||||
"Bridge Node"
|
||||
}
|
||||
|
||||
fn impl_version() -> &'static str {
|
||||
env!("CARGO_PKG_VERSION")
|
||||
}
|
||||
|
||||
fn description() -> &'static str {
|
||||
"Bridge Node"
|
||||
}
|
||||
|
||||
fn author() -> &'static str {
|
||||
"Parity Technologies"
|
||||
}
|
||||
|
||||
fn support_url() -> &'static str {
|
||||
"https://github.com/paritytech/parity-bridges-common/"
|
||||
}
|
||||
|
||||
fn copyright_start_year() -> i32 {
|
||||
2019
|
||||
}
|
||||
|
||||
fn executable_name() -> &'static str {
|
||||
"bridge-node"
|
||||
}
|
||||
|
||||
fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
|
||||
Ok(Box::new(
|
||||
match id {
|
||||
"" | "dev" => crate::chain_spec::Alternative::Development,
|
||||
"local" => crate::chain_spec::Alternative::LocalTestnet,
|
||||
_ => return Err(format!("Unsupported chain specification: {}", id)),
|
||||
}
|
||||
.load()?,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
/// Parse and run command line arguments
|
||||
pub fn run(version: VersionInfo) -> sc_cli::Result<()> {
|
||||
let opt = sc_cli::from_args::<Cli>(&version);
|
||||
pub fn run() -> sc_cli::Result<()> {
|
||||
let cli = Cli::from_args();
|
||||
|
||||
let mut config = sc_service::Configuration::from_version(&version);
|
||||
|
||||
match opt.subcommand {
|
||||
match &cli.subcommand {
|
||||
Some(subcommand) => {
|
||||
subcommand.init(&version)?;
|
||||
subcommand.update_config(&mut config, chain_spec::load_spec, &version)?;
|
||||
subcommand.run(config, |config: _| Ok(new_full_start!(config).0))
|
||||
let runner = cli.create_runner(subcommand)?;
|
||||
runner.run_subcommand(subcommand, |config| Ok(new_full_start!(config).0))
|
||||
}
|
||||
None => {
|
||||
opt.run.init(&version)?;
|
||||
opt.run.update_config(&mut config, chain_spec::load_spec, &version)?;
|
||||
opt.run.run(config, service::new_light, service::new_full, &version)
|
||||
let runner = cli.create_runner(&cli.run)?;
|
||||
runner.run_node(service::new_light, service::new_full, bridge_node_runtime::VERSION)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,16 +24,5 @@ mod cli;
|
||||
mod command;
|
||||
|
||||
fn main() -> sc_cli::Result<()> {
|
||||
let version = sc_cli::VersionInfo {
|
||||
name: "Bridge Node",
|
||||
commit: env!("VERGEN_SHA_SHORT"),
|
||||
version: env!("CARGO_PKG_VERSION"),
|
||||
executable_name: "bridge-node",
|
||||
author: "Parity Technologies",
|
||||
description: "Bridge Node",
|
||||
support_url: "https://github.com/paritytech/parity-bridges-common/",
|
||||
copyright_start_year: 2019,
|
||||
};
|
||||
|
||||
command::run(version)
|
||||
command::run()
|
||||
}
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
|
||||
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
|
||||
|
||||
use bridge_node_runtime::{self, opaque::Block, GenesisConfig, RuntimeApi};
|
||||
use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider};
|
||||
use bridge_node_runtime::{self, opaque::Block, RuntimeApi};
|
||||
use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider, StorageAndProofProvider};
|
||||
use sc_client::LongestChain;
|
||||
use sc_client_api::ExecutorProvider;
|
||||
use sc_executor::native_executor_instance;
|
||||
pub use sc_executor::NativeExecutor;
|
||||
use sc_service::{error::Error as ServiceError, AbstractService, Configuration, ServiceBuilder};
|
||||
@@ -40,6 +41,8 @@ native_executor_instance!(
|
||||
/// be able to perform chain operations.
|
||||
macro_rules! new_full_start {
|
||||
($config:expr) => {{
|
||||
use std::sync::Arc;
|
||||
|
||||
let mut import_setup = None;
|
||||
let inherent_data_providers = sp_inherents::InherentDataProviders::new();
|
||||
|
||||
@@ -49,11 +52,12 @@ macro_rules! new_full_start {
|
||||
crate::service::Executor,
|
||||
>($config)?
|
||||
.with_select_chain(|_config, backend| Ok(sc_client::LongestChain::new(backend.clone())))?
|
||||
.with_transaction_pool(|config, client, _fetcher| {
|
||||
.with_transaction_pool(|config, client, _fetcher, prometheus_registry| {
|
||||
let pool_api = sc_transaction_pool::FullChainApi::new(client.clone());
|
||||
Ok(sc_transaction_pool::BasicPool::new(
|
||||
config,
|
||||
std::sync::Arc::new(pool_api),
|
||||
prometheus_registry,
|
||||
))
|
||||
})?
|
||||
.with_import_queue(|_config, client, mut select_chain, _transaction_pool| {
|
||||
@@ -61,7 +65,8 @@ macro_rules! new_full_start {
|
||||
.take()
|
||||
.ok_or_else(|| sc_service::Error::SelectChainRequired)?;
|
||||
|
||||
let (grandpa_block_import, grandpa_link) = grandpa::block_import(client.clone(), &*client, select_chain)?;
|
||||
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(),
|
||||
@@ -97,17 +102,12 @@ macro_rules! new_full_start {
|
||||
}
|
||||
|
||||
/// Builds a new service for a full client.
|
||||
pub fn new_full(config: Configuration<GenesisConfig>) -> Result<impl AbstractService, ServiceError> {
|
||||
let is_authority = config.roles.is_authority();
|
||||
pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceError> {
|
||||
let role = config.role.clone();
|
||||
let force_authoring = config.force_authoring;
|
||||
let name = config.name.clone();
|
||||
let name = config.network.node_name.clone();
|
||||
let disable_grandpa = config.disable_grandpa;
|
||||
|
||||
// sentry nodes announce themselves as authorities to the network
|
||||
// and should run the same protocols authorities do, but it should
|
||||
// never actively participate in any consensus process.
|
||||
let participates_in_consensus = is_authority && !config.sentry_mode;
|
||||
|
||||
let (builder, mut import_setup, inherent_data_providers) = new_full_start!(config);
|
||||
|
||||
let (block_import, grandpa_link) = import_setup
|
||||
@@ -116,15 +116,13 @@ pub fn new_full(config: Configuration<GenesisConfig>) -> Result<impl AbstractSer
|
||||
|
||||
let service = builder
|
||||
.with_finality_proof_provider(|client, backend| {
|
||||
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, client)) as _)
|
||||
let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
|
||||
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
|
||||
})?
|
||||
.build()?;
|
||||
|
||||
if participates_in_consensus {
|
||||
let proposer = sc_basic_authorship::ProposerFactory {
|
||||
client: service.client(),
|
||||
transaction_pool: service.transaction_pool(),
|
||||
};
|
||||
if role.is_authority() {
|
||||
let proposer = sc_basic_authorship::ProposerFactory::new(service.client(), service.transaction_pool());
|
||||
|
||||
let client = service.client();
|
||||
let select_chain = service.select_chain().ok_or(ServiceError::SelectChainRequired)?;
|
||||
@@ -151,7 +149,7 @@ pub fn new_full(config: Configuration<GenesisConfig>) -> Result<impl AbstractSer
|
||||
|
||||
// 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 participates_in_consensus {
|
||||
let keystore = if role.is_authority() {
|
||||
Some(service.keystore())
|
||||
} else {
|
||||
None
|
||||
@@ -164,7 +162,7 @@ pub fn new_full(config: Configuration<GenesisConfig>) -> Result<impl AbstractSer
|
||||
name: Some(name),
|
||||
observer_enabled: false,
|
||||
keystore,
|
||||
is_authority,
|
||||
is_authority: role.is_network_authority(),
|
||||
};
|
||||
|
||||
let enable_grandpa = !disable_grandpa;
|
||||
@@ -180,9 +178,9 @@ pub fn new_full(config: Configuration<GenesisConfig>) -> Result<impl AbstractSer
|
||||
link: grandpa_link,
|
||||
network: service.network(),
|
||||
inherent_data_providers: inherent_data_providers.clone(),
|
||||
on_exit: service.on_exit(),
|
||||
telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
|
||||
voting_rule: grandpa::VotingRulesBuilder::default().build(),
|
||||
prometheus_registry: service.prometheus_registry(),
|
||||
};
|
||||
|
||||
// the GRANDPA voter task is considered infallible, i.e.
|
||||
@@ -196,18 +194,19 @@ pub fn new_full(config: Configuration<GenesisConfig>) -> Result<impl AbstractSer
|
||||
}
|
||||
|
||||
/// Builds a new service for a light client.
|
||||
pub fn new_light(config: Configuration<GenesisConfig>) -> Result<impl AbstractService, ServiceError> {
|
||||
pub fn new_light(config: Configuration) -> Result<impl AbstractService, ServiceError> {
|
||||
let inherent_data_providers = InherentDataProviders::new();
|
||||
|
||||
ServiceBuilder::new_light::<Block, RuntimeApi, Executor>(config)?
|
||||
.with_select_chain(|_config, backend| Ok(LongestChain::new(backend.clone())))?
|
||||
.with_transaction_pool(|config, client, fetcher| {
|
||||
.with_transaction_pool(|config, client, fetcher, prometheus_registry| {
|
||||
let fetcher = fetcher.ok_or_else(|| "Trying to start light transaction pool without active fetcher")?;
|
||||
|
||||
let pool_api = sc_transaction_pool::LightChainApi::new(client.clone(), fetcher.clone());
|
||||
let pool = sc_transaction_pool::BasicPool::with_revalidation_type(
|
||||
config,
|
||||
Arc::new(pool_api),
|
||||
prometheus_registry,
|
||||
sc_transaction_pool::RevalidationType::Light,
|
||||
);
|
||||
Ok(pool)
|
||||
@@ -216,8 +215,12 @@ pub fn new_light(config: Configuration<GenesisConfig>) -> Result<impl AbstractSe
|
||||
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(client.clone(), backend, &*client.clone(), Arc::new(fetch_checker))?;
|
||||
let grandpa_block_import = grandpa::light_block_import(
|
||||
client.clone(),
|
||||
backend,
|
||||
&(client.clone() as Arc<_>),
|
||||
Arc::new(fetch_checker),
|
||||
)?;
|
||||
let finality_proof_import = grandpa_block_import.clone();
|
||||
let finality_proof_request_builder = finality_proof_import.create_finality_proof_request_builder();
|
||||
|
||||
@@ -233,7 +236,8 @@ pub fn new_light(config: Configuration<GenesisConfig>) -> Result<impl AbstractSe
|
||||
Ok((import_queue, finality_proof_request_builder))
|
||||
})?
|
||||
.with_finality_proof_provider(|client, backend| {
|
||||
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, client)) as _)
|
||||
let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
|
||||
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
|
||||
})?
|
||||
.build()
|
||||
}
|
||||
|
||||
@@ -19,15 +19,15 @@ features = ["derive"]
|
||||
|
||||
# Substrate Dependencies
|
||||
[dependencies.pallet-aura]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.pallet-balances]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.pallet-bridge-eth-poa]
|
||||
@@ -36,76 +36,76 @@ default-features = false
|
||||
path = "../../../modules/ethereum"
|
||||
|
||||
[dependencies.frame-support]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.pallet-grandpa]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.pallet-randomness-collective-flip]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.pallet-sudo]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.pallet-session]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.frame-system]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.frame-system-rpc-runtime-api]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.pallet-timestamp]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.pallet-transaction-payment]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.frame-executive]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
# Substrate Primitives
|
||||
[dependencies.sp-api]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.sp-block-builder]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.sp-bridge-eth-poa]
|
||||
@@ -114,75 +114,75 @@ default-features = false
|
||||
path = "../../../primitives/ethereum-poa"
|
||||
|
||||
[dependencies.sp-consensus-aura]
|
||||
version = "0.8.0-alpha.2"
|
||||
version = "0.8.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.sp-core]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.sp-inherents]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.sp-io]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.sp-offchain]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.sp-runtime]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.sp-session]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.sp-staking]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.sp-std]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.sp-transaction-pool]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[dependencies.sp-version]
|
||||
version = "2.0.0-alpha.2"
|
||||
version = "2.0.0-alpha.6"
|
||||
default-features = false
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[build-dependencies.wasm-builder-runner]
|
||||
version = "1.0.5"
|
||||
package = "substrate-wasm-builder-runner"
|
||||
rev = "2afecf81ee19b8a6edb364b419190ea47c4a4a31"
|
||||
rev = "c13ad41634d0bd7cf07897c2aa062b917d520520"
|
||||
git = "https://github.com/paritytech/substrate/"
|
||||
|
||||
[features]
|
||||
|
||||
@@ -34,8 +34,9 @@ use sp_runtime::traits::{
|
||||
BlakeTwo256, Block as BlockT, ConvertInto, IdentifyAccount, IdentityLookup, OpaqueKeys, Verify,
|
||||
};
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys, transaction_validity::TransactionValidity, ApplyExtrinsicResult,
|
||||
MultiSignature,
|
||||
create_runtime_str, generic, impl_opaque_keys,
|
||||
transaction_validity::{TransactionSource, TransactionValidity},
|
||||
ApplyExtrinsicResult, MultiSignature,
|
||||
};
|
||||
use sp_std::prelude::*;
|
||||
#[cfg(feature = "std")]
|
||||
@@ -43,7 +44,12 @@ use sp_version::NativeVersion;
|
||||
use sp_version::RuntimeVersion;
|
||||
|
||||
// A few exports that help ease life for downstream crates.
|
||||
pub use frame_support::{construct_runtime, parameter_types, traits::Randomness, weights::Weight, StorageValue};
|
||||
pub use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
traits::Randomness,
|
||||
weights::{RuntimeDbWeight, Weight},
|
||||
StorageValue,
|
||||
};
|
||||
pub use pallet_balances::Call as BalancesCall;
|
||||
pub use pallet_bridge_eth_poa::Call as BridgeEthPoACall;
|
||||
pub use pallet_timestamp::Call as TimestampCall;
|
||||
@@ -109,6 +115,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
spec_version: 1,
|
||||
impl_version: 1,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
transaction_version: 1,
|
||||
};
|
||||
|
||||
pub const MILLISECS_PER_BLOCK: u64 = 6000;
|
||||
@@ -131,10 +138,15 @@ pub fn native_version() -> NativeVersion {
|
||||
|
||||
parameter_types! {
|
||||
pub const BlockHashCount: BlockNumber = 250;
|
||||
pub const MaximumBlockWeight: Weight = 1_000_000;
|
||||
pub const MaximumBlockWeight: Weight = 2_000_000_000_000;
|
||||
pub const ExtrinsicBaseWeight: Weight = 10_000_000;
|
||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
||||
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
|
||||
pub const Version: RuntimeVersion = VERSION;
|
||||
pub const DbWeight: RuntimeDbWeight = RuntimeDbWeight {
|
||||
read: 60_000_000, // ~0.06 ms = ~60 µs
|
||||
write: 200_000_000, // ~0.2 ms = 200 µs
|
||||
};
|
||||
}
|
||||
|
||||
impl frame_system::Trait for Runtime {
|
||||
@@ -162,6 +174,14 @@ impl frame_system::Trait for Runtime {
|
||||
type BlockHashCount = BlockHashCount;
|
||||
/// Maximum weight of each block.
|
||||
type MaximumBlockWeight = MaximumBlockWeight;
|
||||
/// The weight of database operations that the runtime can invoke.
|
||||
type DbWeight = DbWeight;
|
||||
/// The weight of the overhead invoked on the block import process, independent of the
|
||||
/// extrinsics included in that block.
|
||||
type BlockExecutionWeight = ();
|
||||
/// The base weight of any extrinsic processed by the runtime, independent of the
|
||||
/// logic of that extrinsic. (Signature verification, nonce increment, fee, etc...)
|
||||
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
||||
/// Maximum size of all encoded transactions (in bytes) that are allowed in one block.
|
||||
type MaximumBlockLength = MaximumBlockLength;
|
||||
/// Portion of the block weight that is available to all normal transactions.
|
||||
@@ -225,7 +245,6 @@ parameter_types! {
|
||||
impl pallet_transaction_payment::Trait for Runtime {
|
||||
type Currency = pallet_balances::Module<Runtime>;
|
||||
type OnTransactionPayment = ();
|
||||
type TransactionBaseFee = TransactionBaseFee;
|
||||
type TransactionByteFee = TransactionByteFee;
|
||||
type WeightToFee = ConvertInto;
|
||||
type FeeMultiplierUpdate = ();
|
||||
@@ -246,6 +265,7 @@ impl pallet_session::Trait for Runtime {
|
||||
type ValidatorId = <Self as frame_system::Trait>::AccountId;
|
||||
type ValidatorIdOf = ();
|
||||
type ShouldEndSession = pallet_session::PeriodicSessions<Period, Offset>;
|
||||
type NextSessionRotation = pallet_session::PeriodicSessions<Period, Offset>;
|
||||
type SessionManager = ShiftSessionManager;
|
||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||
type Keys = SessionKeys;
|
||||
@@ -279,6 +299,7 @@ impl ShiftSessionManager {
|
||||
|
||||
impl pallet_session::SessionManager<AccountId> for ShiftSessionManager {
|
||||
fn end_session(_: sp_staking::SessionIndex) {}
|
||||
fn start_session(_: sp_staking::SessionIndex) {}
|
||||
fn new_session(session_index: sp_staking::SessionIndex) -> Option<Vec<AccountId>> {
|
||||
// can't access genesis config here :/
|
||||
if session_index == 0 || session_index == 1 {
|
||||
@@ -376,10 +397,6 @@ impl_runtime_apis! {
|
||||
Executive::apply_extrinsic(extrinsic)
|
||||
}
|
||||
|
||||
fn apply_trusted_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
|
||||
Executive::apply_trusted_extrinsic(extrinsic)
|
||||
}
|
||||
|
||||
fn finalize_block() -> <Block as BlockT>::Header {
|
||||
Executive::finalize_block()
|
||||
}
|
||||
@@ -421,8 +438,11 @@ impl_runtime_apis! {
|
||||
}
|
||||
|
||||
impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {
|
||||
fn validate_transaction(tx: <Block as BlockT>::Extrinsic) -> TransactionValidity {
|
||||
Executive::validate_transaction(tx)
|
||||
fn validate_transaction(
|
||||
source: TransactionSource,
|
||||
tx: <Block as BlockT>::Extrinsic,
|
||||
) -> TransactionValidity {
|
||||
Executive::validate_transaction(source, tx)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user