From bac8bce88b91f55c952c18e37676ecd20f3350de Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 12 Oct 2020 14:51:14 +0800 Subject: [PATCH 01/11] Comment Subcommand::Base and SubDb --- bin/node-template/node/src/cli.rs | 6 +++--- bin/node-template/node/src/command.rs | 27 ++++++++++++++------------- client/cli/src/lib.rs | 4 ++-- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/bin/node-template/node/src/cli.rs b/bin/node-template/node/src/cli.rs index 56df974426..2911ebdfd8 100644 --- a/bin/node-template/node/src/cli.rs +++ b/bin/node-template/node/src/cli.rs @@ -22,9 +22,9 @@ pub struct Cli { /// Possible subcommands of the main binary. #[derive(Debug, StructOpt)] pub enum Subcommand { - /// A set of base subcommands handled by `sc_cli`. - #[structopt(flatten)] - Base(sc_cli::Subcommand), + // aki: /// A set of base subcommands handled by `sc_cli`. + // #[structopt(flatten)] + // Base(sc_cli::Subcommand), /// Key management cli utilities Key(KeySubcommand), diff --git a/bin/node-template/node/src/command.rs b/bin/node-template/node/src/command.rs index d4e8e1d984..3f2725fcc1 100644 --- a/bin/node-template/node/src/command.rs +++ b/bin/node-template/node/src/command.rs @@ -108,19 +108,20 @@ pub fn run() -> sc_cli::Result<()> { _ => service::node_template_new_full(config).map(|(components, _)| components), }) } - Some(Subcommand::Base(subcommand)) => { - let runtime = cli.create_runner(subcommand)?; - let chain_spec = &runtime.config().chain_spec; - - set_default_ss58_version(chain_spec); - - runtime.run_subcommand(subcommand, |config| { - service::new_chain_ops::< - service::node_template_runtime::RuntimeApi, - service::NodeTemplateExecutor, - >(config) - }) - } + // aki: + // Some(Subcommand::Base(subcommand)) => { + // let runtime = cli.create_runner(subcommand)?; + // let chain_spec = &runtime.config().chain_spec; + // + // set_default_ss58_version(chain_spec); + // + // runtime.run_subcommand(subcommand, |config| { + // service::new_chain_ops::< + // service::node_template_runtime::RuntimeApi, + // service::NodeTemplateExecutor, + // >(config) + // }) + // } Some(Subcommand::Key(cmd)) => cmd.run(), Some(Subcommand::Sign(cmd)) => cmd.run(), Some(Subcommand::Verify(cmd)) => cmd.run(), diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 16baafcede..9be7848742 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -666,7 +666,7 @@ impl DatabaseConfig { .unwrap_or(origin_data_base_cache_size.unwrap_or(128)), } } - Database::SubDb => sc_service::config::DatabaseConfig::SubDb { path }, + // aki: Database::SubDb => sc_service::config::DatabaseConfig::SubDb { path }, Database::ParityDb => sc_service::config::DatabaseConfig::ParityDb { path }, } } else { @@ -689,7 +689,7 @@ enum Database { // Facebooks RocksDB RocksDb, // Subdb. https://github.com/paritytech/subdb/ - SubDb, + // aki: SubDb, // ParityDb. https://github.com/paritytech/parity-db/ ParityDb, } From 069a399c232fff599742990321076793c027dc4f Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 12 Oct 2020 14:55:51 +0800 Subject: [PATCH 02/11] Bump jsonrpc-* dependencies to v15, companion: for #7157 --- bin/node-template/node/Cargo.toml | 4 ++-- frame/balances/rpc/Cargo.toml | 6 +++--- frame/header-mmr/rpc/Cargo.toml | 6 +++--- frame/staking/rpc/Cargo.toml | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bin/node-template/node/Cargo.toml b/bin/node-template/node/Cargo.toml index 5d2992327d..f62ae838f0 100644 --- a/bin/node-template/node/Cargo.toml +++ b/bin/node-template/node/Cargo.toml @@ -18,8 +18,8 @@ node-template-runtime = { path = "../runtime" } # crates codec = { package = "parity-scale-codec", version = "1.3.5" } futures = { version = "0.3.5" } -jsonrpc-core = { version = "14.2.0" } -jsonrpc-pubsub = { version = "14.2.0" } +jsonrpc-core = { version = "15.0.0" } +jsonrpc-pubsub = { version = "15.0.0" } log = { version = "0.4.11" } structopt = { version = "0.3.16" } tokio = { version = "0.2.22", optional = true, features = ["rt-threaded"] } diff --git a/frame/balances/rpc/Cargo.toml b/frame/balances/rpc/Cargo.toml index 105a2a3090..5af22c292d 100644 --- a/frame/balances/rpc/Cargo.toml +++ b/frame/balances/rpc/Cargo.toml @@ -11,9 +11,9 @@ version = "1.0.0" [dependencies] # crates codec = { package = "parity-scale-codec", version = "1.3.5" } -jsonrpc-core = "14.2.0" -jsonrpc-core-client = "14.2.0" -jsonrpc-derive = "14.2.1" +jsonrpc-core = "15.0.0" +jsonrpc-core-client = "15.0.0" +jsonrpc-derive = "15.0.0" # darwinia darwinia-balances-rpc-runtime-api = { path = "./runtime-api" } # substrate diff --git a/frame/header-mmr/rpc/Cargo.toml b/frame/header-mmr/rpc/Cargo.toml index 9839a6dfbb..c77a314390 100644 --- a/frame/header-mmr/rpc/Cargo.toml +++ b/frame/header-mmr/rpc/Cargo.toml @@ -11,9 +11,9 @@ version = "1.0.0" [dependencies] # crates codec = { package = "parity-scale-codec", version = "1.3.5" } -jsonrpc-core = "14.2.0" -jsonrpc-core-client = "14.2.0" -jsonrpc-derive = "14.2.1" +jsonrpc-core = "15.0.0" +jsonrpc-core-client = "15.0.0" +jsonrpc-derive = "15.0.0" # darwinia darwinia-header-mmr-rpc-runtime-api = { path = "./runtime-api" } # substrate diff --git a/frame/staking/rpc/Cargo.toml b/frame/staking/rpc/Cargo.toml index 1b4c3dc78f..9261fb74f6 100644 --- a/frame/staking/rpc/Cargo.toml +++ b/frame/staking/rpc/Cargo.toml @@ -11,9 +11,9 @@ version = "1.0.0" [dependencies] # crates codec = { package = "parity-scale-codec", version = "1.3.5" } -jsonrpc-core = "14.2.0" -jsonrpc-core-client = "14.2.0" -jsonrpc-derive = "14.2.1" +jsonrpc-core = "15.0.0" +jsonrpc-core-client = "15.0.0" +jsonrpc-derive = "15.0.0" # darwinia darwinia-staking-rpc-runtime-api = { path = "./runtime-api" } # substrate From 997257a1e8d41324321b0b2682e83ef10d57ba20 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 12 Oct 2020 14:58:42 +0800 Subject: [PATCH 03/11] Rename `ModuleToIndex` to PalletInfo, companion: for #7148 --- bin/node-template/runtime/src/lib.rs | 2 +- frame/balances/src/lib.rs | 2 +- frame/balances/src/tests_local.rs | 2 +- frame/bridge/crab/issuing/src/mock.rs | 2 +- frame/bridge/ethereum/backing/src/mock.rs | 2 +- frame/bridge/ethereum/linear-relay/src/mock.rs | 2 +- frame/bridge/ethereum/offchain/src/mock.rs | 2 +- frame/bridge/ethereum/relay/src/mock.rs | 2 +- frame/bridge/relayer-game/src/mock.rs | 2 +- frame/claims/src/lib.rs | 2 +- frame/democracy/src/tests.rs | 2 +- frame/elections-phragmen/src/lib.rs | 2 +- frame/header-mmr/src/mock.rs | 2 +- frame/staking/src/mock.rs | 2 +- frame/treasury/src/mock.rs | 2 +- frame/vesting/src/lib.rs | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs index f3bb21805e..090260e75c 100644 --- a/bin/node-template/runtime/src/lib.rs +++ b/bin/node-template/runtime/src/lib.rs @@ -457,7 +457,7 @@ impl frame_system::Trait for Runtime { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = Version; - type ModuleToIndex = ModuleToIndex; + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/balances/src/lib.rs b/frame/balances/src/lib.rs index 602c6d71e9..1f9ca83668 100644 --- a/frame/balances/src/lib.rs +++ b/frame/balances/src/lib.rs @@ -822,7 +822,7 @@ impl, I: Instance> frame_system::Trait for ElevatedTrait { type MaximumBlockLength = T::MaximumBlockLength; type AvailableBlockRatio = T::AvailableBlockRatio; type Version = T::Version; - type ModuleToIndex = T::ModuleToIndex; + type PalletInfo = T::PalletInfo; type AccountData = T::AccountData; type OnNewAccount = T::OnNewAccount; type OnKilledAccount = T::OnKilledAccount; diff --git a/frame/balances/src/tests_local.rs b/frame/balances/src/tests_local.rs index b1b0652104..0efd65aff1 100644 --- a/frame/balances/src/tests_local.rs +++ b/frame/balances/src/tests_local.rs @@ -95,7 +95,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = Ring; diff --git a/frame/bridge/crab/issuing/src/mock.rs b/frame/bridge/crab/issuing/src/mock.rs index b18dec5b03..eff7d6def1 100644 --- a/frame/bridge/crab/issuing/src/mock.rs +++ b/frame/bridge/crab/issuing/src/mock.rs @@ -96,7 +96,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = (); type AvailableBlockRatio = (); type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/bridge/ethereum/backing/src/mock.rs b/frame/bridge/ethereum/backing/src/mock.rs index 7bcbee707c..04716cdc34 100644 --- a/frame/bridge/ethereum/backing/src/mock.rs +++ b/frame/bridge/ethereum/backing/src/mock.rs @@ -115,7 +115,7 @@ macro_rules! decl_tests { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/bridge/ethereum/linear-relay/src/mock.rs b/frame/bridge/ethereum/linear-relay/src/mock.rs index f82bbaeea0..2527916acf 100644 --- a/frame/bridge/ethereum/linear-relay/src/mock.rs +++ b/frame/bridge/ethereum/linear-relay/src/mock.rs @@ -96,7 +96,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/bridge/ethereum/offchain/src/mock.rs b/frame/bridge/ethereum/offchain/src/mock.rs index 6d139e2455..b9f1b3dd1d 100644 --- a/frame/bridge/ethereum/offchain/src/mock.rs +++ b/frame/bridge/ethereum/offchain/src/mock.rs @@ -91,7 +91,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/bridge/ethereum/relay/src/mock.rs b/frame/bridge/ethereum/relay/src/mock.rs index d36dd1c06c..070a13de3d 100644 --- a/frame/bridge/ethereum/relay/src/mock.rs +++ b/frame/bridge/ethereum/relay/src/mock.rs @@ -89,7 +89,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/bridge/relayer-game/src/mock.rs b/frame/bridge/relayer-game/src/mock.rs index aa9527cdf0..b7f9cbe001 100644 --- a/frame/bridge/relayer-game/src/mock.rs +++ b/frame/bridge/relayer-game/src/mock.rs @@ -292,7 +292,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/claims/src/lib.rs b/frame/claims/src/lib.rs index 5b7959eb83..20a82ca182 100644 --- a/frame/claims/src/lib.rs +++ b/frame/claims/src/lib.rs @@ -663,7 +663,7 @@ mod tests { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/democracy/src/tests.rs b/frame/democracy/src/tests.rs index b9b8699954..343b59a416 100644 --- a/frame/democracy/src/tests.rs +++ b/frame/democracy/src/tests.rs @@ -134,7 +134,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/elections-phragmen/src/lib.rs b/frame/elections-phragmen/src/lib.rs index 1072399dfa..d032572212 100644 --- a/frame/elections-phragmen/src/lib.rs +++ b/frame/elections-phragmen/src/lib.rs @@ -1186,7 +1186,7 @@ mod tests { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/header-mmr/src/mock.rs b/frame/header-mmr/src/mock.rs index 74cdc5d514..2655eab932 100644 --- a/frame/header-mmr/src/mock.rs +++ b/frame/header-mmr/src/mock.rs @@ -54,7 +54,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/staking/src/mock.rs b/frame/staking/src/mock.rs index e63130011d..4712a2f6e1 100644 --- a/frame/staking/src/mock.rs +++ b/frame/staking/src/mock.rs @@ -223,7 +223,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/treasury/src/mock.rs b/frame/treasury/src/mock.rs index 1603f06c76..33a7d27b93 100644 --- a/frame/treasury/src/mock.rs +++ b/frame/treasury/src/mock.rs @@ -91,7 +91,7 @@ impl frame_system::Trait for Test { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); diff --git a/frame/vesting/src/lib.rs b/frame/vesting/src/lib.rs index fa45cf86ca..de7d85e514 100644 --- a/frame/vesting/src/lib.rs +++ b/frame/vesting/src/lib.rs @@ -481,7 +481,7 @@ mod tests { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); From 922687aba1657481969dd0d23b8a85355288b4fd Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 12 Oct 2020 15:06:34 +0800 Subject: [PATCH 04/11] Use tracing-based subscriber logging, companion: for #6825 --- frame/bridge/relayer-game/src/mock.rs | 2 +- frame/staking/Cargo.toml | 2 +- frame/staking/src/mock.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frame/bridge/relayer-game/src/mock.rs b/frame/bridge/relayer-game/src/mock.rs index b7f9cbe001..c35b5b5bbb 100644 --- a/frame/bridge/relayer-game/src/mock.rs +++ b/frame/bridge/relayer-game/src/mock.rs @@ -387,7 +387,7 @@ impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { self.set_associated_constants(); - let _ = env_logger::try_init(); + sp_tracing::try_init_simple(); let mut storage = frame_system::GenesisConfig::default() .build_storage::() .unwrap(); diff --git a/frame/staking/Cargo.toml b/frame/staking/Cargo.toml index 539d64ec33..a72d25f6d1 100644 --- a/frame/staking/Cargo.toml +++ b/frame/staking/Cargo.toml @@ -34,7 +34,6 @@ sp-std = { default-features = false, git = "https://github.com/darwin [dev-dependencies] # crates -env_logger = "0.7.1" rand_chacha = { version = "0.2" } # darwinia darwinia-balances = { path = "../../frame/balances" } @@ -43,6 +42,7 @@ darwinia-support = { features = ["easy-testing"], path = "../support" } pallet-timestamp = { git = "https://github.com/darwinia-network/substrate.git", branch = "common-library" } sp-storage = { git = "https://github.com/darwinia-network/substrate.git", branch = "common-library" } substrate-test-utils = { git = "https://github.com/darwinia-network/substrate.git", branch = "common-library" } +sp-tracing = { git = "https://github.com/darwinia-network/substrate.git", branch = "common-library" } [features] default = ["std"] diff --git a/frame/staking/src/mock.rs b/frame/staking/src/mock.rs index 4712a2f6e1..5eef98beaf 100644 --- a/frame/staking/src/mock.rs +++ b/frame/staking/src/mock.rs @@ -429,7 +429,7 @@ impl ExtBuilder { MAX_ITERATIONS.with(|v| *v.borrow_mut() = self.max_offchain_iterations); } pub fn build(self) -> sp_io::TestExternalities { - let _ = env_logger::try_init(); + sp_tracing::try_init_simple(); self.set_associated_constants(); let mut storage = frame_system::GenesisConfig::default() .build_storage::() From 9c28541f8e1d88c95f1cf63fa2fb35a7e196840d Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 12 Oct 2020 15:10:38 +0800 Subject: [PATCH 05/11] Bounties, companion: for #5715 --- bin/node-template/runtime/src/lib.rs | 20 +- frame/treasury/src/default_weights.rs | 139 +++++ frame/treasury/src/lib.rs | 754 +++++++++++++++++++++++--- frame/treasury/src/mock.rs | 43 +- frame/treasury/src/tests.rs | 574 +++++++++++++++++--- 5 files changed, 1365 insertions(+), 165 deletions(-) create mode 100644 frame/treasury/src/default_weights.rs diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs index 090260e75c..a35fcbb99d 100644 --- a/bin/node-template/runtime/src/lib.rs +++ b/bin/node-template/runtime/src/lib.rs @@ -839,7 +839,13 @@ parameter_types! { pub const TipCountdown: BlockNumber = 1 * DAYS; pub const TipFindersFee: Percent = Percent::from_percent(20); pub const TipReportDepositBase: Balance = 1 * COIN; - pub const TipReportDepositPerByte: Balance = 1 * MILLI; + pub const DataDepositPerByte: Balance = 1 * MILLI; + pub const BountyDepositBase: Balance = 1 * COIN; + pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS; + pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS; + pub const MaximumReasonLength: u32 = 16384; + pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); + pub const BountyValueMinimum: Balance = 5 * COIN; } impl darwinia_treasury::Trait for Runtime { type ModuleId = TreasuryModuleId; @@ -851,15 +857,21 @@ impl darwinia_treasury::Trait for Runtime { type TipCountdown = TipCountdown; type TipFindersFee = TipFindersFee; type TipReportDepositBase = TipReportDepositBase; - type TipReportDepositPerByte = TipReportDepositPerByte; + type DataDepositPerByte = DataDepositPerByte; type Event = Event; - type RingProposalRejection = Treasury; - type KtonProposalRejection = Treasury; + type RingOnSlash = Treasury; + type KtonOnSlash = Treasury; type ProposalBond = ProposalBond; type RingProposalBondMinimum = RingProposalBondMinimum; type KtonProposalBondMinimum = KtonProposalBondMinimum; type SpendPeriod = SpendPeriod; type Burn = Burn; + type BountyDepositBase = BountyDepositBase; + type BountyDepositPayoutDelay = BountyDepositPayoutDelay; + type BountyUpdatePeriod = BountyUpdatePeriod; + type BountyCuratorDeposit = BountyCuratorDeposit; + type BountyValueMinimum = BountyValueMinimum; + type MaximumReasonLength = MaximumReasonLength; type RingBurnDestination = (); // TODO type KtonBurnDestination = (); diff --git a/frame/treasury/src/default_weights.rs b/frame/treasury/src/default_weights.rs new file mode 100644 index 0000000000..faf6c1a045 --- /dev/null +++ b/frame/treasury/src/default_weights.rs @@ -0,0 +1,139 @@ +// This file is part of Substrate. + +// Copyright (C) 2020 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc6 + +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight}; + +impl crate::WeightInfo for () { + fn propose_spend() -> Weight { + (79604000 as Weight) + .saturating_add(DbWeight::get().reads(1 as Weight)) + .saturating_add(DbWeight::get().writes(2 as Weight)) + } + fn reject_proposal() -> Weight { + (61001000 as Weight) + .saturating_add(DbWeight::get().reads(2 as Weight)) + .saturating_add(DbWeight::get().writes(2 as Weight)) + } + fn approve_proposal() -> Weight { + (17835000 as Weight) + .saturating_add(DbWeight::get().reads(2 as Weight)) + .saturating_add(DbWeight::get().writes(1 as Weight)) + } + fn report_awesome(r: u32, ) -> Weight { + (101602000 as Weight) + .saturating_add((2000 as Weight).saturating_mul(r as Weight)) + .saturating_add(DbWeight::get().reads(2 as Weight)) + .saturating_add(DbWeight::get().writes(2 as Weight)) + } + // WARNING! Some components were not used: ["r"] + fn retract_tip() -> Weight { + (82970000 as Weight) + .saturating_add(DbWeight::get().reads(1 as Weight)) + .saturating_add(DbWeight::get().writes(2 as Weight)) + } + fn tip_new(r: u32, t: u32, ) -> Weight { + (63995000 as Weight) + .saturating_add((2000 as Weight).saturating_mul(r as Weight)) + .saturating_add((153000 as Weight).saturating_mul(t as Weight)) + .saturating_add(DbWeight::get().reads(2 as Weight)) + .saturating_add(DbWeight::get().writes(2 as Weight)) + } + fn tip(t: u32, ) -> Weight { + (46765000 as Weight) + .saturating_add((711000 as Weight).saturating_mul(t as Weight)) + .saturating_add(DbWeight::get().reads(2 as Weight)) + .saturating_add(DbWeight::get().writes(1 as Weight)) + } + fn close_tip(t: u32, ) -> Weight { + (160874000 as Weight) + .saturating_add((379000 as Weight).saturating_mul(t as Weight)) + .saturating_add(DbWeight::get().reads(3 as Weight)) + .saturating_add(DbWeight::get().writes(3 as Weight)) + } + fn propose_bounty(d: u32, ) -> Weight { + (86198000 as Weight) + .saturating_add((1000 as Weight).saturating_mul(d as Weight)) + .saturating_add(DbWeight::get().reads(2 as Weight)) + .saturating_add(DbWeight::get().writes(4 as Weight)) + } + fn approve_bounty() -> Weight { + (23063000 as Weight) + .saturating_add(DbWeight::get().reads(2 as Weight)) + .saturating_add(DbWeight::get().writes(2 as Weight)) + } + fn propose_curator() -> Weight { + (18890000 as Weight) + .saturating_add(DbWeight::get().reads(1 as Weight)) + .saturating_add(DbWeight::get().writes(1 as Weight)) + } + fn unassign_curator() -> Weight { + (66768000 as Weight) + .saturating_add(DbWeight::get().reads(2 as Weight)) + .saturating_add(DbWeight::get().writes(2 as Weight)) + } + fn accept_curator() -> Weight { + (69131000 as Weight) + .saturating_add(DbWeight::get().reads(2 as Weight)) + .saturating_add(DbWeight::get().writes(2 as Weight)) + } + fn award_bounty() -> Weight { + (48184000 as Weight) + .saturating_add(DbWeight::get().reads(1 as Weight)) + .saturating_add(DbWeight::get().writes(1 as Weight)) + } + fn claim_bounty() -> Weight { + (243104000 as Weight) + .saturating_add(DbWeight::get().reads(4 as Weight)) + .saturating_add(DbWeight::get().writes(5 as Weight)) + } + fn close_bounty_proposed() -> Weight { + (65917000 as Weight) + .saturating_add(DbWeight::get().reads(2 as Weight)) + .saturating_add(DbWeight::get().writes(3 as Weight)) + } + fn close_bounty_active() -> Weight { + (157232000 as Weight) + .saturating_add(DbWeight::get().reads(3 as Weight)) + .saturating_add(DbWeight::get().writes(4 as Weight)) + } + fn extend_bounty_expiry() -> Weight { + (46216000 as Weight) + .saturating_add(DbWeight::get().reads(1 as Weight)) + .saturating_add(DbWeight::get().writes(1 as Weight)) + } + fn on_initialize_proposals(p: u32, ) -> Weight { + (119765000 as Weight) + .saturating_add((108368000 as Weight).saturating_mul(p as Weight)) + .saturating_add(DbWeight::get().reads(2 as Weight)) + .saturating_add(DbWeight::get().reads((3 as Weight).saturating_mul(p as Weight))) + .saturating_add(DbWeight::get().writes(2 as Weight)) + .saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(p as Weight))) + } + fn on_initialize_bounties(b: u32, ) -> Weight { + (112536000 as Weight) + .saturating_add((107132000 as Weight).saturating_mul(b as Weight)) + .saturating_add(DbWeight::get().reads(2 as Weight)) + .saturating_add(DbWeight::get().reads((3 as Weight).saturating_mul(b as Weight))) + .saturating_add(DbWeight::get().writes(2 as Weight)) + .saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) + } +} diff --git a/frame/treasury/src/lib.rs b/frame/treasury/src/lib.rs index b3661b0a93..a37a6ea01e 100644 --- a/frame/treasury/src/lib.rs +++ b/frame/treasury/src/lib.rs @@ -27,6 +27,23 @@ //! countdown period, the median of all declared tips is paid to the reported beneficiary, along //! with any finders fee, in case of a public (and bonded) original report. //! +//! ### Bounty +//! +//! A Bounty Spending is a reward for a specified body of work - or specified set of objectives - that +//! needs to be executed for a predefined Treasury amount to be paid out. A curator is assigned after +//! the bounty is approved and funded by Council, to be delegated +//! with the responsibility of assigning a payout address once the specified set of objectives is completed. +//! +//! After the Council has activated a bounty, it delegates the work that requires expertise to a curator +//! in exchange of a deposit. Once the curator accepts the bounty, they +//! get to close the Active bounty. Closing the Active bounty enacts a delayed payout to the payout +//! address, the curator fee and the return of the curator deposit. The +//! delay allows for intervention through regular democracy. The Council gets to unassign the curator, +//! resulting in a new curator election. The Council also gets to cancel +//! the bounty if deemed necessary before assigning a curator or once the bounty is active or payout +//! is pending, resulting in the slash of the curator's deposit. +//! +//! //! ### Terminology //! //! - **Proposal:** A suggestion to allocate funds from the pot to a beneficiary. @@ -47,6 +64,22 @@ //! - **Finders Fee:** Some proportion of the tip amount that is paid to the reporter of the tip, //! rather than the main beneficiary. //! +//! Bounty: +//! - **Bounty spending proposal:** A proposal to reward a predefined body of work upon completion by +//! the Treasury. +//! - **Proposer:** An account proposing a bounty spending. +//! - **Curator:** An account managing the bounty and assigning a payout address receiving the reward +//! for the completion of work. +//! - **Deposit:** The amount held on deposit for placing a bounty proposal plus the amount held on +//! deposit per byte within the bounty description. +//! - **Curator deposit:** The payment from a candidate willing to curate an approved bounty. The deposit +//! is returned when/if the bounty is completed. +//! - **Bounty value:** The total amount that should be paid to the Payout Address if the bounty is +//! rewarded. +//! - **Payout address:** The account to which the total or part of the bounty is assigned to. +//! - **Payout Delay:** The delay period for which a bounty beneficiary needs to wait before claiming. +//! - **Curator fee:** The reserved upfront payment for a curator for work related to the bounty. +//! //! ## Interface //! //! ### Dispatchable Functions @@ -65,6 +98,19 @@ //! - `tip` - Declare or redeclare an amount to tip for a particular reason. //! - `close_tip` - Close and pay out a tip. //! +//! Bounty protocol: +//! - `propose_bounty` - Propose a specific treasury amount to be earmarked for a predefined set of +//! tasks and stake the required deposit. +//! - `approve_bounty` - Accept a specific treasury amount to be earmarked for a predefined body of work. +//! - `propose_curator` - Assign an account to a bounty as candidate curator. +//! - `accept_curator` - Accept a bounty assignment from the Council, setting a curator deposit. +//! - `extend_bounty_expiry` - Extend the expiry block number of the bounty and stay active. +//! - `award_bounty` - Close and pay out the specified amount for the completed work. +//! - `claim_bounty` - Claim a specific bounty amount from the Payout Address. +//! - `unassign_curator` - Unassign an accepted curator from a specific earmark. +//! - `close_bounty` - Cancel the earmark for a specific treasury amount and close the bounty. +//! +//! //! ## GenesisConfig //! //! The Treasury module depends on the [`GenesisConfig`](./struct.GenesisConfig.html). @@ -107,24 +153,28 @@ use serde::{Deserialize, Serialize}; use frame_support::{ decl_error, decl_event, decl_module, decl_storage, ensure, print, traits::{ - Contains, ContainsLengthBound, Currency, EnsureOrigin, ExistenceRequirement::KeepAlive, + Contains, ContainsLengthBound, Currency, EnsureOrigin, ExistenceRequirement::{KeepAlive, AllowDeath}, Get, Imbalance, OnUnbalanced, ReservableCurrency, WithdrawReason, }, weights::{DispatchClass, Weight}, Parameter, }; use frame_system::ensure_signed; +use frame_system as system; use sp_runtime::{ traits::{ AccountIdConversion, AtLeast32BitUnsigned, BadOrigin, Hash, Saturating, StaticLookup, Zero, }, - ModuleId, Percent, Permill, RuntimeDebug, + ModuleId, Percent, Permill, RuntimeDebug, DispatchResult, }; +use frame_support::dispatch::DispatchResultWithPostInfo; use sp_std::prelude::*; // --- darwinia --- use darwinia_support::balance::{lock::LockableCurrency, OnUnbalancedKton}; use types::*; +mod default_weights; + pub trait Trait: frame_system::Trait { /// The treasury's module id, used for deriving its sovereign account ID. type ModuleId: Get; @@ -157,16 +207,16 @@ pub trait Trait: frame_system::Trait { /// The amount held on deposit for placing a tip report. type TipReportDepositBase: Get>; - /// The amount held on deposit per byte within the tip report reason. - type TipReportDepositPerByte: Get>; + /// The amount held on deposit per byte within the tip report reason or bounty description. + type DataDepositPerByte: Get>; /// The overarching event type. type Event: From> + Into<::Event>; - /// Handler for the unbalanced decrease when slashing for a rejected proposal. - type RingProposalRejection: OnUnbalanced>; - /// Handler for the unbalanced decrease when slashing for a rejected proposal. - type KtonProposalRejection: OnUnbalancedKton>; + /// Handler for the unbalanced decrease when slashing for a rejected proposal or bounty. + type RingOnSlash: OnUnbalanced>; + /// Handler for the unbalanced decrease when slashing for a rejected proposal or bounty. + type KtonOnSlash: OnUnbalancedKton>; /// Fraction of a proposal's value that should be bonded in order to place the proposal. /// An accepted proposal gets these back. A rejected proposal does not. @@ -183,6 +233,24 @@ pub trait Trait: frame_system::Trait { /// Percentage of spare funds (if any) that are burnt per spend period. type Burn: Get; + /// The amount held on deposit for placing a bounty proposal. + type BountyDepositBase: Get>; + + /// The delay period for which a bounty beneficiary need to wait before claim the payout. + type BountyDepositPayoutDelay: Get; + + /// Bounty duration in blocks. + type BountyUpdatePeriod: Get; + + /// Percentage of the curator fee that will be reserved upfront as deposit for bounty curator. + type BountyCuratorDeposit: Get; + + /// Minimum value for a bounty. + type BountyValueMinimum: Get>; + + /// Maximum acceptable reason length. + type MaximumReasonLength: Get; + /// Handler for the unbalanced decrease when treasury funds are burned. type RingBurnDestination: OnUnbalanced>; @@ -193,6 +261,58 @@ pub trait Trait: frame_system::Trait { type WeightInfo: WeightInfo; } +/// An index of a bounty. Just a `u32`. +pub type BountyIndex = u32; + +/// A bounty proposal. +#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)] +pub struct Bounty { + /// The account proposing it. + proposer: AccountId, + /// The (total) amount that should be paid if the bounty is rewarded. + value: Balance, + /// The curator fee. Included in value. + fee: Balance, + /// The deposit of curator. + curator_deposit: Balance, + /// The amount held on deposit (reserved) for making this proposal. + bond: Balance, + /// The status of this bounty. + status: BountyStatus, +} + +/// The status of a bounty proposal. +#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)] +pub enum BountyStatus { + /// The bounty is proposed and waiting for approval. + Proposed, + /// The bounty is approved and waiting to become active at next spend period. + Approved, + /// The bounty is funded and waiting for curator assignment. + Funded, + /// A curator has been proposed by the `ApproveOrigin`. Waiting for acceptance from the curator. + CuratorProposed { + /// The assigned curator of this bounty. + curator: AccountId, + }, + /// The bounty is active and waiting to be awarded. + Active { + /// The curator of this bounty. + curator: AccountId, + /// An update from the curator is due by this block, else they are considered inactive. + update_due: BlockNumber, + }, + /// The bounty is awarded and waiting to released after a delay. + PendingPayout { + /// The curator of this bounty. + curator: AccountId, + /// The beneficiary of the bounty. + beneficiary: AccountId, + /// When the bounty can be claimed. + unlock_at: BlockNumber, + }, +} + decl_storage! { trait Store for Module as DarwiniaTreasury { /// Number of proposals that have been made. @@ -212,6 +332,21 @@ decl_storage! { /// Simple preimage lookup from the reason's hash to the original data. Again, has an /// insecure enumerable hash since the key is guaranteed to be the result of a secure hash. pub Reasons get(fn reasons): map hasher(identity) T::Hash => Option>; + + + /// Number of bounty proposals that have been made. + pub BountyCount get(fn bounty_count): BountyIndex; + + /// Bounties that have been made. + pub Bounties get(fn bounties): + map hasher(twox_64_concat) BountyIndex + => Option, T::BlockNumber>>; + + /// The description of each bounty. + pub BountyDescriptions get(fn bounty_descriptions): map hasher(twox_64_concat) BountyIndex => Option>; + + /// Bounty indices that have been approved but not yet funded. + pub BountyApprovals get(fn bounty_approvals): Vec; } add_extra_genesis { build(|_config| { @@ -261,6 +396,20 @@ decl_event!( TipClosed(Hash, AccountId, RingBalance), /// A tip suggestion has been retracted. [tip_hash] TipRetracted(Hash), + /// New bounty proposal. [index] + BountyProposed(BountyIndex), + /// A bounty proposal was rejected; funds were slashed. [index, bond] + BountyRejected(BountyIndex, RingBalance), + /// A bounty proposal is funded and became active. [index] + BountyBecameActive(BountyIndex), + /// A bounty is awarded to a beneficiary. [index, beneficiary] + BountyAwarded(BountyIndex, AccountId), + /// A bounty is claimed by beneficiary. [index, payout, beneficiary] + BountyClaimed(BountyIndex, RingBalance, AccountId), + /// A bounty is cancelled. [index] + BountyCanceled(BountyIndex), + /// A bounty expiry is extended. [index] + BountyExtended(BountyIndex), } ); @@ -269,8 +418,8 @@ decl_error! { pub enum Error for Module { /// Proposer's balance is too low. InsufficientProposersBalance, - /// No proposal at that index. - InvalidProposalIndex, + /// No proposal or bounty at that index. + InvalidIndex, /// The reason given is just too big. ReasonTooBig, /// The tip was already found/started. @@ -283,6 +432,17 @@ decl_error! { StillOpen, /// The tip cannot be claimed/closed because it's still in the countdown period. Premature, + /// The bounty status is unexpected. + UnexpectedStatus, + /// Require bounty curator. + RequireCurator, + /// Invalid bounty value. + InvalidValue, + /// Invalid bounty fee. + InvalidFee, + /// A bounty payout is pending. + /// To cancel the bounty, you must unassign and slash the curator. + PendingPayout, } } @@ -314,12 +474,26 @@ decl_module! { /// The amount held on deposit for placing a tip report. const TipReportDepositBase: RingBalance = T::TipReportDepositBase::get(); - /// The amount held on deposit per byte within the tip report reason. - const TipReportDepositPerByte: RingBalance = T::TipReportDepositPerByte::get(); + /// The amount held on deposit per byte within the tip report reason or bounty description. + const DataDepositPerByte: RingBalance = T::DataDepositPerByte::get(); /// The treasury's module id, used for deriving its sovereign account ID. const ModuleId: ModuleId = T::ModuleId::get(); + /// The amount held on deposit for placing a bounty proposal. + const BountyDepositBase: RingBalance = T::BountyDepositBase::get(); + + /// The delay period for which a bounty beneficiary need to wait before claim the payout. + const BountyDepositPayoutDelay: T::BlockNumber = T::BountyDepositPayoutDelay::get(); + + /// Percentage of the curator fee that will be reserved upfront as deposit for bounty curator. + const BountyCuratorDeposit: Permill = T::BountyCuratorDeposit::get(); + + const BountyValueMinimum: RingBalance = T::BountyValueMinimum::get(); + + /// Maximum acceptable reason length. + const MaximumReasonLength: u32 = T::MaximumReasonLength::get(); + fn deposit_event() = default; /// Put forward a suggestion for spending. A deposit proportional to the value @@ -331,7 +505,7 @@ decl_module! { /// - DbReads: `ProposalCount`, `origin account` /// - DbWrites: `ProposalCount`, `Proposals`, `origin account` /// # - #[weight = 120_000_000 + T::DbWeight::get().reads_writes(1, 2)] + #[weight = T::WeightInfo::propose_spend()] fn propose_spend( origin, #[compact] ring_value: RingBalance, @@ -372,19 +546,19 @@ decl_module! { /// - DbReads: `Proposals`, `rejected proposer account` /// - DbWrites: `Proposals`, `rejected proposer account` /// # - #[weight = (130_000_000 + T::DbWeight::get().reads_writes(2, 2), DispatchClass::Operational)] + #[weight = (T::WeightInfo::reject_proposal(), DispatchClass::Operational)] fn reject_proposal(origin, #[compact] proposal_id: ProposalIndex) { T::RejectOrigin::ensure_origin(origin)?; - let proposal = >::take(&proposal_id).ok_or(>::InvalidProposalIndex)?; + let proposal = >::take(&proposal_id).ok_or(>::InvalidIndex)?; let ring_bond = proposal.ring_bond; let imbalance_ring = T::RingCurrency::slash_reserved(&proposal.proposer, ring_bond).0; - T::RingProposalRejection::on_unbalanced(imbalance_ring); + T::RingOnSlash::on_unbalanced(imbalance_ring); let kton_bond = proposal.kton_bond; let imbalance_kton = T::KtonCurrency::slash_reserved(&proposal.proposer, kton_bond).0; - T::KtonProposalRejection::on_unbalanced(imbalance_kton); + T::KtonOnSlash::on_unbalanced(imbalance_kton); Self::deposit_event(>::Rejected(proposal_id, ring_bond, kton_bond)); } @@ -399,12 +573,12 @@ decl_module! { /// - DbReads: `Proposals`, `Approvals` /// - DbWrite: `Approvals` /// # - #[weight = (34_000_000 + T::DbWeight::get().reads_writes(2, 1), DispatchClass::Operational)] + #[weight = (T::WeightInfo::approve_proposal(), DispatchClass::Operational)] fn approve_proposal(origin, #[compact] proposal_id: ProposalIndex) { T::ApproveOrigin::ensure_origin(origin)?; - ensure!(>::contains_key(proposal_id), >::InvalidProposalIndex); - Approvals::mutate(|v| v.push(proposal_id)); + ensure!(>::contains_key(proposal_id), >::InvalidIndex); + Approvals::append(proposal_id); } /// Report something `reason` that deserves a tip and claim any eventual the finder's fee. @@ -412,7 +586,7 @@ decl_module! { /// The dispatch origin for this call must be _Signed_. /// /// Payment: `TipReportDepositBase` will be reserved from the origin account, as well as - /// `TipReportDepositPerByte` for each byte in `reason`. + /// `DataDepositPerByte` for each byte in `reason`. /// /// - `reason`: The reason for, or the thing that deserves, the tip; generally this will be /// a UTF-8-encoded URL. @@ -423,15 +597,14 @@ decl_module! { /// # /// - Complexity: `O(R)` where `R` length of `reason`. /// - encoding and hashing of 'reason' - /// - DbReads: `Reasons`, `Tips`, `who account data` - /// - DbWrites: `Tips`, `who account data` + /// - DbReads: `Reasons`, `Tips` + /// - DbWrites: `Reasons`, `Tips` /// # - #[weight = 140_000_000 + 4_000 * reason.len() as Weight + T::DbWeight::get().reads_writes(3, 2)] + #[weight = T::WeightInfo::report_awesome(reason.len() as u32)] fn report_awesome(origin, reason: Vec, who: T::AccountId) { let finder = ensure_signed(origin)?; - const MAX_SENSIBLE_REASON_LENGTH: usize = 16384; - ensure!(reason.len() <= MAX_SENSIBLE_REASON_LENGTH, >::ReasonTooBig); + ensure!(reason.len() <= T::MaximumReasonLength::get() as usize, Error::::ReasonTooBig); let reason_hash = T::Hashing::hash(&reason[..]); ensure!(!>::contains_key(&reason_hash), >::AlreadyKnown); @@ -439,7 +612,7 @@ decl_module! { ensure!(!>::contains_key(&hash), >::AlreadyKnown); let deposit = T::TipReportDepositBase::get() - + T::TipReportDepositPerByte::get() * (reason.len() as u32).into(); + + T::DataDepositPerByte::get() * (reason.len() as u32).into(); T::RingCurrency::reserve(&finder, deposit)?; >::insert(&reason_hash, &reason); @@ -475,7 +648,7 @@ decl_module! { /// - DbReads: `Tips`, `origin account` /// - DbWrites: `Reasons`, `Tips`, `origin account` /// # - #[weight = 120_000_000 + T::DbWeight::get().reads_writes(1, 2)] + #[weight = T::WeightInfo::retract_tip()] fn retract_tip(origin, hash: T::Hash) { let who = ensure_signed(origin)?; let tip = >::get(&hash).ok_or(>::UnknownTip)?; @@ -511,11 +684,8 @@ decl_module! { /// - DbReads: `Tippers`, `Reasons` /// - DbWrites: `Reasons`, `Tips` /// # - #[weight = 110_000_000 - + 4_000 * reason.len() as Weight - + 480_000 * T::Tippers::max_len() as Weight - + T::DbWeight::get().reads_writes(2, 2)] - fn tip_new(origin, reason: Vec, who: T::AccountId, tip_value: RingBalance) { + #[weight = T::WeightInfo::tip_new(reason.len() as u32, T::Tippers::max_len() as u32)] + fn tip_new(origin, reason: Vec, who: T::AccountId, #[compact] tip_value: RingBalance) { let tipper = ensure_signed(origin)?; ensure!(T::Tippers::contains(&tipper), BadOrigin); let reason_hash = T::Hashing::hash(&reason[..]); @@ -562,9 +732,8 @@ decl_module! { /// - DbReads: `Tippers`, `Tips` /// - DbWrites: `Tips` /// # - #[weight = 68_000_000 + 2_000_000 * T::Tippers::max_len() as Weight - + T::DbWeight::get().reads_writes(2, 1)] - fn tip(origin, hash: T::Hash, tip_value: RingBalance) { + #[weight = T::WeightInfo::tip(T::Tippers::max_len() as u32)] + fn tip(origin, hash: T::Hash, #[compact] tip_value: RingBalance) { let tipper = ensure_signed(origin)?; ensure!(T::Tippers::contains(&tipper), BadOrigin); @@ -592,8 +761,7 @@ decl_module! { /// - DbReads: `Tips`, `Tippers`, `tip finder` /// - DbWrites: `Reasons`, `Tips`, `Tippers`, `tip finder` /// # - #[weight = 220_000_000 + 1_100_000 * T::Tippers::max_len() as Weight - + T::DbWeight::get().reads_writes(3, 3)] + #[weight = T::WeightInfo::close_tip(T::Tippers::max_len() as u32)] fn close_tip(origin, hash: T::Hash) { ensure_signed(origin)?; @@ -606,6 +774,371 @@ decl_module! { Self::payout_tip(hash, tip); } + /// Propose a new bounty. + /// + /// The dispatch origin for this call must be _Signed_. + /// + /// Payment: `TipReportDepositBase` will be reserved from the origin account, as well as + /// `DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval, + /// or slashed when rejected. + /// + /// - `curator`: The curator account whom will manage this bounty. + /// - `fee`: The curator fee. + /// - `value`: The total payment amount of this bounty, curator fee included. + /// - `description`: The description of this bounty. + #[weight = T::WeightInfo::propose_bounty(description.len() as u32)] + fn propose_bounty( + origin, + #[compact] value: RingBalance, + description: Vec, + ) { + let proposer = ensure_signed(origin)?; + Self::create_bounty(proposer, description, value)?; + } + + /// Approve a bounty proposal. At a later time, the bounty will be funded and become active + /// and the original deposit will be returned. + /// + /// May only be called from `T::ApproveOrigin`. + /// + /// # + /// - O(1). + /// - Limited storage reads. + /// - One DB change. + /// # + #[weight = T::WeightInfo::approve_bounty()] + fn approve_bounty(origin, #[compact] bounty_id: ProposalIndex) { + T::ApproveOrigin::ensure_origin(origin)?; + + Bounties::::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult { + let mut bounty = maybe_bounty.as_mut().ok_or(Error::::InvalidIndex)?; + ensure!(bounty.status == BountyStatus::Proposed, Error::::UnexpectedStatus); + + bounty.status = BountyStatus::Approved; + + BountyApprovals::append(bounty_id); + + Ok(()) + })?; + } + + /// Assign a curator to a funded bounty. + /// + /// May only be called from `T::ApproveOrigin`. + /// + /// # + /// - O(1). + /// - Limited storage reads. + /// - One DB change. + /// # + #[weight = T::WeightInfo::propose_curator()] + fn propose_curator( + origin, + #[compact] bounty_id: ProposalIndex, + curator: ::Source, + #[compact] fee: RingBalance, + ) { + T::ApproveOrigin::ensure_origin(origin)?; + + let curator = T::Lookup::lookup(curator)?; + Bounties::::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult { + let mut bounty = maybe_bounty.as_mut().ok_or(Error::::InvalidIndex)?; + match bounty.status { + BountyStatus::Funded | BountyStatus::CuratorProposed { .. } => {}, + _ => return Err(Error::::UnexpectedStatus.into()), + }; + + ensure!(fee < bounty.value, Error::::InvalidFee); + + bounty.status = BountyStatus::CuratorProposed { curator }; + bounty.fee = fee; + + Ok(()) + })?; + } + + /// Unassign curator from a bounty. + /// + /// This function can only be called by the `RejectOrigin` a signed origin. + /// + /// If this function is called by the `RejectOrigin`, we assume that the curator is malicious + /// or inactive. As a result, we will slash the curator when possible. + /// + /// If the origin is the curator, we take this as a sign they are unable to do their job and + /// they willingly give up. We could slash them, but for now we allow them to recover their + /// deposit and exit without issue. (We may want to change this if it is abused.) + /// + /// Finally, the origin can be anyone if and only if the curator is "inactive". This allows + /// anyone in the community to call out that a curator is not doing their due diligence, and + /// we should pick a new curator. In this case the curator should also be slashed. + /// + /// # + /// - O(1). + /// - Limited storage reads. + /// - One DB change. + /// # + #[weight = T::WeightInfo::unassign_curator()] + fn unassign_curator( + origin, + #[compact] bounty_id: ProposalIndex, + ) { + let maybe_sender = ensure_signed(origin.clone()) + .map(Some) + .or_else(|_| T::RejectOrigin::ensure_origin(origin).map(|_| None))?; + + Bounties::::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult { + let mut bounty = maybe_bounty.as_mut().ok_or(Error::::InvalidIndex)?; + + let slash_curator = |curator: &T::AccountId, curator_deposit: &mut RingBalance| { + let imbalance = T::RingCurrency::slash_reserved(curator, *curator_deposit).0; + T::RingOnSlash::on_unbalanced(imbalance); + *curator_deposit = Zero::zero(); + }; + + match bounty.status { + BountyStatus::Proposed | BountyStatus::Approved | BountyStatus::Funded => { + // No curator to unassign at this point. + return Err(Error::::UnexpectedStatus.into()) + } + BountyStatus::CuratorProposed { ref curator } => { + // A curator has been proposed, but not accepted yet. + // Either `RejectOrigin` or the proposed curator can unassign the curator. + ensure!(maybe_sender.map_or(true, |sender| sender == *curator), BadOrigin); + }, + BountyStatus::Active { ref curator, ref update_due } => { + // The bounty is active. + match maybe_sender { + // If the `RejectOrigin` is calling this function, slash the curator. + None => { + slash_curator(curator, &mut bounty.curator_deposit); + // Continue to change bounty status below... + }, + Some(sender) => { + // If the sender is not the curator, and the curator is inactive, + // slash the curator. + if sender != *curator { + let block_number = system::Module::::block_number(); + if *update_due < block_number { + slash_curator(curator, &mut bounty.curator_deposit); + // Continue to change bounty status below... + } else { + // Curator has more time to give an update. + return Err(Error::::Premature.into()) + } + } else { + // Else this is the curator, willingly giving up their role. + // Give back their deposit. + let _ = T::RingCurrency::unreserve(&curator, bounty.curator_deposit); + // Continue to change bounty status below... + } + }, + } + }, + BountyStatus::PendingPayout { ref curator, .. } => { + // The bounty is pending payout, so only council can unassign a curator. + // By doing so, they are claiming the curator is acting maliciously, so + // we slash the curator. + ensure!(maybe_sender.is_none(), BadOrigin); + slash_curator(curator, &mut bounty.curator_deposit); + // Continue to change bounty status below... + } + }; + + bounty.status = BountyStatus::Funded; + Ok(()) + })?; + } + + /// Accept the curator role for a bounty. + /// A deposit will be reserved from curator and refund upon successful payout. + /// + /// May only be called from the curator. + /// + /// # + /// - O(1). + /// - Limited storage reads. + /// - One DB change. + /// # + #[weight = T::WeightInfo::accept_curator()] + fn accept_curator(origin, #[compact] bounty_id: ProposalIndex) { + let signer = ensure_signed(origin)?; + + Bounties::::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult { + let mut bounty = maybe_bounty.as_mut().ok_or(Error::::InvalidIndex)?; + + match bounty.status { + BountyStatus::CuratorProposed { ref curator } => { + ensure!(signer == *curator, Error::::RequireCurator); + + let deposit = T::BountyCuratorDeposit::get() * bounty.fee; + T::RingCurrency::reserve(curator, deposit)?; + bounty.curator_deposit = deposit; + + let update_due = system::Module::::block_number() + T::BountyUpdatePeriod::get(); + bounty.status = BountyStatus::Active { curator: curator.clone(), update_due }; + + Ok(()) + }, + _ => Err(Error::::UnexpectedStatus.into()), + } + })?; + } + + /// Award bounty to a beneficiary account. The beneficiary will be able to claim the funds after a delay. + /// + /// The dispatch origin for this call must be the curator of this bounty. + /// + /// - `bounty_id`: Bounty ID to award. + /// - `beneficiary`: The beneficiary account whom will receive the payout. + #[weight = T::WeightInfo::award_bounty()] + fn award_bounty(origin, #[compact] bounty_id: ProposalIndex, beneficiary: ::Source) { + let signer = ensure_signed(origin)?; + let beneficiary = T::Lookup::lookup(beneficiary)?; + + Bounties::::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult { + let mut bounty = maybe_bounty.as_mut().ok_or(Error::::InvalidIndex)?; + match &bounty.status { + BountyStatus::Active { + curator, + .. + } => { + ensure!(signer == *curator, Error::::RequireCurator); + }, + _ => return Err(Error::::UnexpectedStatus.into()), + } + bounty.status = BountyStatus::PendingPayout { + curator: signer, + beneficiary: beneficiary.clone(), + unlock_at: system::Module::::block_number() + T::BountyDepositPayoutDelay::get(), + }; + + Ok(()) + })?; + + Self::deposit_event(Event::::BountyAwarded(bounty_id, beneficiary)); + } + + /// Claim the payout from an awarded bounty after payout delay. + /// + /// The dispatch origin for this call must be the beneficiary of this bounty. + /// + /// - `bounty_id`: Bounty ID to claim. + #[weight = T::WeightInfo::claim_bounty()] + fn claim_bounty(origin, #[compact] bounty_id: BountyIndex) { + let _ = ensure_signed(origin)?; // anyone can trigger claim + + Bounties::::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult { + let bounty = maybe_bounty.take().ok_or(Error::::InvalidIndex)?; + if let BountyStatus::PendingPayout { curator, beneficiary, unlock_at } = bounty.status { + ensure!(system::Module::::block_number() >= unlock_at, Error::::Premature); + let bounty_account = Self::bounty_account_id(bounty_id); + let balance = T::RingCurrency::free_balance(&bounty_account); + let fee = bounty.fee.min(balance); // just to be safe + let payout = balance.saturating_sub(fee); + let _ = T::RingCurrency::unreserve(&curator, bounty.curator_deposit); + let _ = T::RingCurrency::transfer(&bounty_account, &curator, fee, AllowDeath); // should not fail + let _ = T::RingCurrency::transfer(&bounty_account, &beneficiary, payout, AllowDeath); // should not fail + *maybe_bounty = None; + + BountyDescriptions::remove(bounty_id); + + Self::deposit_event(Event::::BountyClaimed(bounty_id, payout, beneficiary)); + Ok(()) + } else { + Err(Error::::UnexpectedStatus.into()) + } + })?; + } + + /// Cancel a proposed or active bounty. All the funds will be sent to treasury and + /// the curator deposit will be unreserved if possible. + /// + /// Only `T::RejectOrigin` is able to cancel a bounty. + /// + /// - `bounty_id`: Bounty ID to cancel. + #[weight = T::WeightInfo::close_bounty_proposed().max(T::WeightInfo::close_bounty_active())] + fn close_bounty(origin, #[compact] bounty_id: BountyIndex) -> DispatchResultWithPostInfo { + T::RejectOrigin::ensure_origin(origin)?; + + Bounties::::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResultWithPostInfo { + let bounty = maybe_bounty.as_ref().ok_or(Error::::InvalidIndex)?; + + match &bounty.status { + BountyStatus::Proposed => { + // The reject origin would like to cancel a proposed bounty. + BountyDescriptions::remove(bounty_id); + let value = bounty.bond; + let imbalance = T::RingCurrency::slash_reserved(&bounty.proposer, value).0; + T::RingOnSlash::on_unbalanced(imbalance); + *maybe_bounty = None; + + Self::deposit_event(Event::::BountyRejected(bounty_id, value)); + // Return early, nothing else to do. + return Ok(Some(T::WeightInfo::close_bounty_proposed()).into()) + }, + BountyStatus::Approved => { + // For weight reasons, we don't allow a council to cancel in this phase. + // We ask for them to wait until it is funded before they can cancel. + return Err(Error::::UnexpectedStatus.into()) + }, + BountyStatus::Funded | + BountyStatus::CuratorProposed { .. } => { + // Nothing extra to do besides the removal of the bounty below. + }, + BountyStatus::Active { curator, .. } => { + // Cancelled by council, refund deposit of the working curator. + let _ = T::RingCurrency::unreserve(&curator, bounty.curator_deposit); + // Then execute removal of the bounty below. + }, + BountyStatus::PendingPayout { .. } => { + // Bounty is already pending payout. If council wants to cancel + // this bounty, it should mean the curator was acting maliciously. + // So the council should first unassign the curator, slashing their + // deposit. + return Err(Error::::PendingPayout.into()) + } + } + + let bounty_account = Self::bounty_account_id(bounty_id); + + BountyDescriptions::remove(bounty_id); + + let balance = T::RingCurrency::free_balance(&bounty_account); + let _ = T::RingCurrency::transfer(&bounty_account, &Self::account_id(), balance, AllowDeath); // should not fail + *maybe_bounty = None; + + Self::deposit_event(Event::::BountyCanceled(bounty_id)); + Ok(Some(T::WeightInfo::close_bounty_active()).into()) + }) + } + + /// Extend the expiry time of an active bounty. + /// + /// The dispatch origin for this call must be the curator of this bounty. + /// + /// - `bounty_id`: Bounty ID to extend. + /// - `remark`: additional information. + #[weight = T::WeightInfo::extend_bounty_expiry()] + fn extend_bounty_expiry(origin, #[compact] bounty_id: BountyIndex, _remark: Vec) { + let signer = ensure_signed(origin)?; + + Bounties::::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult { + let bounty = maybe_bounty.as_mut().ok_or(Error::::InvalidIndex)?; + + match bounty.status { + BountyStatus::Active { ref curator, ref mut update_due } => { + ensure!(*curator == signer, Error::::RequireCurator); + *update_due = (system::Module::::block_number() + T::BountyUpdatePeriod::get()).max(*update_due); + }, + _ => return Err(Error::::UnexpectedStatus.into()), + } + + Ok(()) + })?; + + Self::deposit_event(Event::::BountyExtended(bounty_id)); + } + /// # /// - Complexity: `O(A)` where `A` is the number of approvals /// - Db reads and writes: `Approvals`, `pot account data` @@ -615,10 +1148,7 @@ decl_module! { /// # fn on_initialize(n: T::BlockNumber) -> Weight { // Check to see if we should spend some funds! if (n % T::SpendPeriod::get()).is_zero() { - let approvals_len = Self::spend_funds(); - - 270_000_000 * approvals_len - + T::DbWeight::get().reads_writes(2 + approvals_len * 3, 2 + approvals_len * 3) + Self::spend_funds() } else { 0 } @@ -637,6 +1167,13 @@ impl Module { T::ModuleId::get().into_account() } + /// The account ID of a bounty account + pub fn bounty_account_id(id: BountyIndex) -> T::AccountId { + // only use two byte prefix to support 16 byte account id (used by test) + // "modl" ++ "py/trsry" ++ "bt" is 14 bytes, and two bytes remaining for bounty index + T::ModuleId::get().into_sub_account(("bt", id)) + } + /// Return the amount of money in the pot. // The existential deposit is not part of the pot so treasury account never gets deleted. fn pot>() -> C::Balance { @@ -645,6 +1182,36 @@ impl Module { .saturating_sub(C::minimum_balance()) } + fn create_bounty( + proposer: T::AccountId, + description: Vec, + value: RingBalance, + ) -> DispatchResult { + ensure!(description.len() <= T::MaximumReasonLength::get() as usize, Error::::ReasonTooBig); + ensure!(value >= T::BountyValueMinimum::get(), Error::::InvalidValue); + + let index = Self::bounty_count(); + + // reserve deposit for new bounty + let bond = T::BountyDepositBase::get() + + T::DataDepositPerByte::get() * (description.len() as u32).into(); + T::RingCurrency::reserve(&proposer, bond) + .map_err(|_| Error::::InsufficientProposersBalance)?; + + BountyCount::put(index + 1); + + let bounty = Bounty { + proposer, value, fee: 0.into(), curator_deposit: 0.into(), bond, status: BountyStatus::Proposed, + }; + + Bounties::::insert(index, &bounty); + BountyDescriptions::insert(index, description); + + Self::deposit_event(RawEvent::BountyProposed(index)); + + Ok(()) + } + /// The needed bond for a proposal whose spend is `value`. fn calculate_bond(value: Balance) -> Balance where @@ -731,7 +1298,9 @@ impl Module { } /// Spend some money! returns number of approvals before spend. - fn spend_funds() -> u64 { + fn spend_funds() -> Weight { + let mut total_weight: Weight = Zero::zero(); + let mut budget_remaining_ring = Self::pot::(); let mut budget_remaining_kton = Self::pot::(); @@ -739,6 +1308,7 @@ impl Module { budget_remaining_ring, budget_remaining_kton, )); + let account_id = Self::account_id(); let mut miss_any_ring = false; let mut imbalance_ring = >::zero(); @@ -746,8 +1316,8 @@ impl Module { let mut miss_any_kton = false; let mut imbalance_kton = >::zero(); - let prior_approvals_len = Approvals::mutate(|v| { - let prior_approvals_len = v.len() as u64; + let proposals_len = Approvals::mutate(|v| { + let proposals_approvals_len = v.len() as u32; v.retain(|&index| { // Should always be true, but shouldn't panic if false or we're screwed. if let Some(p) = Self::proposals(index) { @@ -802,9 +1372,44 @@ impl Module { } }); - prior_approvals_len + proposals_approvals_len + }); + + total_weight += T::WeightInfo::on_initialize_proposals(proposals_len); + + let bounties_len = BountyApprovals::mutate(|v| { + let bounties_approval_len = v.len() as u32; + v.retain(|&index| { + Bounties::::mutate(index, |bounty| { + // Should always be true, but shouldn't panic if false or we're screwed. + if let Some(bounty) = bounty { + if bounty.value <= budget_remaining_ring { + budget_remaining_ring -= bounty.value; + + bounty.status = BountyStatus::Funded; + + // return their deposit. + let _ = T::RingCurrency::unreserve(&bounty.proposer, bounty.bond); + + // fund the bounty account + imbalance_ring.subsume(T::RingCurrency::deposit_creating(&Self::bounty_account_id(index), bounty.value)); + + Self::deposit_event(RawEvent::BountyBecameActive(index)); + false + } else { + miss_any_ring = true; + true + } + } else { + false + } + }) + }); + bounties_approval_len }); + total_weight += T::WeightInfo::on_initialize_bounties(bounties_len); + { let burn_ring = if !miss_any_ring { // burn some proportion of the remaining budget if we run a surplus. @@ -840,7 +1445,7 @@ impl Module { // Thus we can't spend more than account free balance minus ED; // Thus account is kept alive; qed; if let Err(problem) = T::RingCurrency::settle( - &Self::account_id(), + &account_id, imbalance_ring, WithdrawReason::Transfer.into(), KeepAlive, @@ -851,7 +1456,7 @@ impl Module { } if let Err(problem) = T::KtonCurrency::settle( - &Self::account_id(), + &account_id, imbalance_kton, WithdrawReason::Transfer.into(), KeepAlive, @@ -866,7 +1471,7 @@ impl Module { budget_remaining_kton, )); - prior_approvals_len + total_weight } } @@ -893,46 +1498,29 @@ impl OnUnbalancedKton> for Module { } pub trait WeightInfo { - fn propose_spend(u: u32) -> Weight; - fn reject_proposal(u: u32) -> Weight; - fn approve_proposal(u: u32) -> Weight; + fn propose_spend() -> Weight; + fn reject_proposal() -> Weight; + fn approve_proposal() -> Weight; fn report_awesome(r: u32) -> Weight; - fn retract_tip(r: u32) -> Weight; + fn retract_tip() -> Weight; fn tip_new(r: u32, t: u32) -> Weight; fn tip(t: u32) -> Weight; fn close_tip(t: u32) -> Weight; - fn on_initialize(p: u32) -> Weight; + fn propose_bounty(r: u32, ) -> Weight; + fn approve_bounty() -> Weight; + fn propose_curator() -> Weight; + fn unassign_curator() -> Weight; + fn accept_curator() -> Weight; + fn award_bounty() -> Weight; + fn claim_bounty() -> Weight; + fn close_bounty_proposed() -> Weight; + fn close_bounty_active() -> Weight; + fn extend_bounty_expiry() -> Weight; + fn on_initialize_proposals(p: u32, ) -> Weight; + fn on_initialize_bounties(b: u32, ) -> Weight; } -impl WeightInfo for () { - fn propose_spend(_u: u32) -> Weight { - 1_000_000_000 - } - fn reject_proposal(_u: u32) -> Weight { - 1_000_000_000 - } - fn approve_proposal(_u: u32) -> Weight { - 1_000_000_000 - } - fn report_awesome(_r: u32) -> Weight { - 1_000_000_000 - } - fn retract_tip(_r: u32) -> Weight { - 1_000_000_000 - } - fn tip_new(_r: u32, _t: u32) -> Weight { - 1_000_000_000 - } - fn tip(_t: u32) -> Weight { - 1_000_000_000 - } - fn close_tip(_t: u32) -> Weight { - 1_000_000_000 - } - fn on_initialize(_p: u32) -> Weight { - 1_000_000_000 - } -} + /// A spending proposal. #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] diff --git a/frame/treasury/src/mock.rs b/frame/treasury/src/mock.rs index 33a7d27b93..18b50834a9 100644 --- a/frame/treasury/src/mock.rs +++ b/frame/treasury/src/mock.rs @@ -45,7 +45,7 @@ darwinia_support::impl_account_data! { } thread_local! { - static TEN_TO_FOURTEEN: RefCell> = RefCell::new(vec![10, 11, 12, 13, 14]); + static TEN_TO_FOURTEEN: RefCell> = RefCell::new(vec![10,11,12,13,14]); } impl_outer_event! { @@ -78,7 +78,7 @@ impl frame_system::Trait for Test { type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; - type AccountId = u64; + type AccountId = u128; // u64 is not enough to hold bytes used to generate bounty account type Lookup = IdentityLookup; type Header = Header; type Event = MockEvent; @@ -99,12 +99,12 @@ impl frame_system::Trait for Test { } pub struct TenToFourteen; -impl Contains for TenToFourteen { - fn sorted_members() -> Vec { +impl Contains for TenToFourteen { + fn sorted_members() -> Vec { TEN_TO_FOURTEEN.with(|v| v.borrow().clone()) } #[cfg(feature = "runtime-benchmarks")] - fn add(new: &u64) { + fn add(new: &u128) { TEN_TO_FOURTEEN.with(|v| { let mut members = v.borrow_mut(); members.push(*new); @@ -150,32 +150,44 @@ parameter_types! { pub const TipCountdown: u64 = 1; pub const TipFindersFee: Percent = Percent::from_percent(20); pub const TipReportDepositBase: Balance = 1; - pub const TipReportDepositPerByte: Balance = 1; + pub const DataDepositPerByte: u64 = 1; + pub const BountyDepositBase: u64 = 80; + pub const BountyDepositPayoutDelay: u64 = 3; pub const ProposalBond: Permill = Permill::from_percent(5); pub const RingProposalBondMinimum: Balance = 1; pub const KtonProposalBondMinimum: Balance = 1; pub const SpendPeriod: u64 = 2; pub const Burn: Permill = Permill::from_percent(50); + pub const BountyUpdatePeriod: u32 = 20; + pub const MaximumReasonLength: u32 = 16384; + pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); + pub const BountyValueMinimum: u64 = 1; } impl Trait for Test { type ModuleId = TreasuryModuleId; type RingCurrency = Ring; type KtonCurrency = Kton; - type ApproveOrigin = frame_system::EnsureRoot; - type RejectOrigin = frame_system::EnsureRoot; + type ApproveOrigin = frame_system::EnsureRoot; + type RejectOrigin = frame_system::EnsureRoot; type Tippers = TenToFourteen; type TipCountdown = TipCountdown; type TipFindersFee = TipFindersFee; type TipReportDepositBase = TipReportDepositBase; - type TipReportDepositPerByte = TipReportDepositPerByte; + type DataDepositPerByte = DataDepositPerByte; type Event = MockEvent; - type RingProposalRejection = (); - type KtonProposalRejection = (); + type RingOnSlash = (); + type KtonOnSlash = (); type ProposalBond = ProposalBond; type RingProposalBondMinimum = RingProposalBondMinimum; type KtonProposalBondMinimum = KtonProposalBondMinimum; type SpendPeriod = SpendPeriod; type Burn = Burn; + type BountyDepositBase = BountyDepositBase; + type BountyDepositPayoutDelay = BountyDepositPayoutDelay; + type BountyUpdatePeriod = BountyUpdatePeriod; + type BountyCuratorDeposit = BountyCuratorDeposit; + type BountyValueMinimum = BountyValueMinimum; + type MaximumReasonLength = MaximumReasonLength; type RingBurnDestination = (); // Just gets burned. type KtonBurnDestination = (); // Just gets burned. type WeightInfo = (); @@ -204,3 +216,12 @@ pub fn new_test_ext() -> sp_io::TestExternalities { t.into() } + +pub fn last_event() -> RawEvent { + System::events().into_iter().map(|r| r.event) + .filter_map(|e| { + if let Event::treasury(inner) = e { Some(inner) } else { None } + }) + .last() + .unwrap() +} diff --git a/frame/treasury/src/tests.rs b/frame/treasury/src/tests.rs index 2492b5f07e..7df07d2a90 100644 --- a/frame/treasury/src/tests.rs +++ b/frame/treasury/src/tests.rs @@ -16,7 +16,7 @@ fn genesis_config_works() { } fn tip_hash() -> H256 { - BlakeTwo256::hash_of(&(BlakeTwo256::hash(b"awesome.darwinia"), 3u64)) + BlakeTwo256::hash_of(&(BlakeTwo256::hash(b"awesome.darwinia"), 3u128)) } #[test] @@ -78,7 +78,7 @@ fn report_awesome_from_beneficiary_and_tip_works() { )); assert_eq!(Ring::reserved_balance(0), 17); assert_eq!(Ring::free_balance(0), 83); - let h = BlakeTwo256::hash_of(&(BlakeTwo256::hash(b"awesome.darwinia"), 0u64)); + let h = BlakeTwo256::hash_of(&(BlakeTwo256::hash(b"awesome.darwinia"), 0u128)); assert_ok!(Treasury::tip(Origin::signed(10), h.clone(), 10)); assert_ok!(Treasury::tip(Origin::signed(11), h.clone(), 10)); assert_ok!(Treasury::tip(Origin::signed(12), h.clone(), 10)); @@ -106,21 +106,7 @@ fn close_tip_works() { let h = tip_hash(); - assert_eq!( - System::events() - .into_iter() - .map(|r| r.event) - .filter_map(|e| { - if let MockEvent::treasury(inner) = e { - Some(inner) - } else { - None - } - }) - .last() - .unwrap(), - RawEvent::NewTip(h), - ); + assert_eq!(last_event(), RawEvent::NewTip(h)); assert_ok!(Treasury::tip(Origin::signed(11), h.clone(), 10)); @@ -131,21 +117,7 @@ fn close_tip_works() { assert_ok!(Treasury::tip(Origin::signed(12), h.clone(), 10)); - assert_eq!( - System::events() - .into_iter() - .map(|r| r.event) - .filter_map(|e| { - if let MockEvent::treasury(inner) = e { - Some(inner) - } else { - None - } - }) - .last() - .unwrap(), - RawEvent::TipClosing(h), - ); + assert_eq!(last_event(), RawEvent::TipClosing(h)); assert_noop!( Treasury::close_tip(Origin::signed(0), h.into()), @@ -157,26 +129,9 @@ fn close_tip_works() { assert_ok!(Treasury::close_tip(Origin::signed(0), h.into())); assert_eq!(Ring::free_balance(3), 10); - assert_eq!( - System::events() - .into_iter() - .map(|r| r.event) - .filter_map(|e| { - if let MockEvent::treasury(inner) = e { - Some(inner) - } else { - None - } - }) - .last() - .unwrap(), - RawEvent::TipClosed(h, 3, 10), - ); + assert_eq!(last_event(), RawEvent::TipClosed(h, 3, 10)); - assert_noop!( - Treasury::close_tip(Origin::signed(100), h.into()), - >::UnknownTip - ); + assert_noop!(Treasury::reject_proposal(Origin::root(), 0), Error::::InvalidIndex); }); } @@ -353,30 +308,21 @@ fn reject_already_rejected_spend_proposal_fails() { Ring::make_free_balance_be(&Treasury::account_id(), 101); assert_ok!(Treasury::propose_spend(Origin::signed(0), 100, 0, 3)); assert_ok!(Treasury::reject_proposal(Origin::root(), 0)); - assert_noop!( - Treasury::reject_proposal(Origin::root(), 0), - >::InvalidProposalIndex - ); + assert_noop!(Treasury::reject_proposal(Origin::root(), 0), Error::::InvalidIndex); }); } #[test] fn reject_non_existent_spend_proposal_fails() { new_test_ext().execute_with(|| { - assert_noop!( - Treasury::reject_proposal(Origin::root(), 0), - >::InvalidProposalIndex - ); + assert_noop!(Treasury::reject_proposal(Origin::root(), 0), Error::::InvalidIndex); }); } #[test] fn accept_non_existent_spend_proposal_fails() { new_test_ext().execute_with(|| { - assert_noop!( - Treasury::approve_proposal(Origin::root(), 0), - >::InvalidProposalIndex - ); + assert_noop!(Treasury::approve_proposal(Origin::root(), 0), Error::::InvalidIndex); }); } @@ -386,10 +332,8 @@ fn accept_already_rejected_spend_proposal_fails() { Ring::make_free_balance_be(&Treasury::account_id(), 101); assert_ok!(Treasury::propose_spend(Origin::signed(0), 100, 100, 3)); assert_ok!(Treasury::reject_proposal(Origin::root(), 0)); - assert_noop!( - Treasury::approve_proposal(Origin::root(), 0), - >::InvalidProposalIndex - ); + assert_noop!(Treasury::approve_proposal(Origin::root(), 0), Error::::InvalidIndex); + ; }); } @@ -749,3 +693,499 @@ fn no_accept_no_reject_keep_burning() { assert_eq!(Treasury::pot::(), 25); // No changes from last perid }); } + +#[test] +fn propose_bounty_works() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + + Balances::make_free_balance_be(&Treasury::account_id(), 101); + assert_eq!(Treasury::pot::(), 100); + + assert_ok!(Treasury::propose_bounty(Origin::signed(0), 10, b"1234567890".to_vec())); + + assert_eq!(last_event(), RawEvent::BountyProposed(0)); + + let deposit: u64 = 85 + 5; + assert_eq!(Ring::reserved_balance(0), deposit); + assert_eq!(Ring::free_balance(0), 100 - deposit); + + assert_eq!(Treasury::bounties(0).unwrap(), Bounty { + proposer: 0, + fee: 0, + curator_deposit: 0, + value: 10, + bond: deposit, + status: BountyStatus::Proposed, + }); + + assert_eq!(Treasury::bounty_descriptions(0).unwrap(), b"1234567890".to_vec()); + + assert_eq!(Treasury::bounty_count(), 1); + }); +} + +#[test] +fn propose_bounty_validation_works() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + + Ring::make_free_balance_be(&Treasury::account_id(), 101); + assert_eq!(Treasury::pot::(), 100); + + assert_noop!( + Treasury::propose_bounty(Origin::signed(1), 0, [0; 17_000].to_vec()), + Error::::ReasonTooBig + ); + + assert_noop!( + Treasury::propose_bounty(Origin::signed(1), 10, b"12345678901234567890".to_vec()), + Error::::InsufficientProposersBalance + ); + + assert_noop!( + Treasury::propose_bounty(Origin::signed(1), 0, b"12345678901234567890".to_vec()), + Error::::InvalidValue + ); + }); +} + +#[test] +fn close_bounty_works() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + Ring::make_free_balance_be(&Treasury::account_id(), 101); + assert_noop!(Treasury::close_bounty(Origin::root(), 0), Error::::InvalidIndex); + + assert_ok!(Treasury::propose_bounty(Origin::signed(0), 10, b"12345".to_vec())); + + assert_ok!(Treasury::close_bounty(Origin::root(), 0)); + + let deposit: u64 = 80 + 5; + + assert_eq!(last_event(), RawEvent::BountyRejected(0, deposit)); + + assert_eq!(Ring::reserved_balance(0), 0); + assert_eq!(Ring::free_balance(0), 100 - deposit); + + assert_eq!(Treasury::bounties(0), None); + assert!(!Bounties::::contains_key(0)); + assert_eq!(Treasury::bounty_descriptions(0), None); + }); +} + +#[test] +fn approve_bounty_works() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + Ring::make_free_balance_be(&Treasury::account_id(), 101); + assert_noop!(Treasury::approve_bounty(Origin::root(), 0), Error::::InvalidIndex); + + assert_ok!(Treasury::propose_bounty(Origin::signed(0), 50, b"12345".to_vec())); + + assert_ok!(Treasury::approve_bounty(Origin::root(), 0)); + + let deposit: u64 = 80 + 5; + + assert_eq!(Treasury::bounties(0).unwrap(), Bounty { + proposer: 0, + fee: 0, + value: 50, + curator_deposit: 0, + bond: deposit, + status: BountyStatus::Approved, + }); + assert_eq!(Treasury::bounty_approvals(), vec![0]); + + assert_noop!(Treasury::close_bounty(Origin::root(), 0), Error::::UnexpectedStatus); + + // deposit not returned yet + assert_eq!(Ring::reserved_balance(0), deposit); + assert_eq!(Ring::free_balance(0), 100 - deposit); + + >::on_initialize(2); + + // return deposit + assert_eq!(ring::reserved_balance(0), 0); + assert_eq!(Ring::free_balance(0), 100); + + assert_eq!(Treasury::bounties(0).unwrap(), Bounty { + proposer: 0, + fee: 0, + curator_deposit: 0, + value: 50, + bond: deposit, + status: BountyStatus::Funded, + }); + assert_eq!(Treasury::pot::(), 100 - 50 - 25); // burn 25 + assert_eq!(Ring::free_balance(Treasury::bounty_account_id(0)), 50); + }); +} + +#[test] +fn assign_curator_works() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + Ring::make_free_balance_be(&Treasury::account_id(), 101); + + assert_noop!(Treasury::propose_curator(Origin::root(), 0, 4, 4), Error::::InvalidIndex); + + assert_ok!(Treasury::propose_bounty(Origin::signed(0), 50, b"12345".to_vec())); + + assert_ok!(Treasury::approve_bounty(Origin::root(), 0)); + + System::set_block_number(2); + >::on_initialize(2); + + assert_noop!(Treasury::propose_curator(Origin::root(), 0, 4, 50), Error::::InvalidFee); + + assert_ok!(Treasury::propose_curator(Origin::root(), 0, 4, 4)); + + assert_eq!(Treasury::bounties(0).unwrap(), Bounty { + proposer: 0, + fee: 4, + curator_deposit: 0, + value: 50, + bond: 85, + status: BountyStatus::CuratorProposed { + curator: 4, + }, + }); + + assert_noop!(Treasury::accept_curator(Origin::signed(1), 0), Error::::RequireCurator); + assert_noop!(Treasury::accept_curator(Origin::signed(4), 0), pallet_balances::Error::::InsufficientBalance); + + Ring::make_free_balance_be(&4, 10); + + assert_ok!(Treasury::accept_curator(Origin::signed(4), 0)); + + assert_eq!(Treasury::bounties(0).unwrap(), Bounty { + proposer: 0, + fee: 4, + curator_deposit: 2, + value: 50, + bond: 85, + status: BountyStatus::Active { + curator: 4, + update_due: 22, + }, + }); + + assert_eq!(Ring::free_balance(&4), 8); + assert_eq!(Ring::reserved_balance(&4), 2); + }); +} + +#[test] +fn unassign_curator_works() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + Ring::make_free_balance_be(&Treasury::account_id(), 101); + assert_ok!(Treasury::propose_bounty(Origin::signed(0), 50, b"12345".to_vec())); + + assert_ok!(Treasury::approve_bounty(Origin::root(), 0)); + + System::set_block_number(2); + >::on_initialize(2); + + assert_ok!(Treasury::propose_curator(Origin::root(), 0, 4, 4)); + + assert_noop!(Treasury::unassign_curator(Origin::signed(1), 0), BadOrigin); + + assert_ok!(Treasury::unassign_curator(Origin::signed(4), 0)); + + assert_eq!(Treasury::bounties(0).unwrap(), Bounty { + proposer: 0, + fee: 4, + curator_deposit: 0, + value: 50, + bond: 85, + status: BountyStatus::Funded, + }); + + assert_ok!(Treasury::propose_curator(Origin::root(), 0, 4, 4)); + + Ring::make_free_balance_be(&4, 10); + + assert_ok!(Treasury::accept_curator(Origin::signed(4), 0)); + + assert_ok!(Treasury::unassign_curator(Origin::root(), 0)); + + assert_eq!(Treasury::bounties(0).unwrap(), Bounty { + proposer: 0, + fee: 4, + curator_deposit: 0, + value: 50, + bond: 85, + status: BountyStatus::Funded, + }); + + assert_eq!(Ring::free_balance(&4), 8); + assert_eq!(Ring::reserved_balance(&4), 0); // slashed 2 + }); +} + +#[test] +fn award_and_claim_bounty_works() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + Ring::make_free_balance_be(&Treasury::account_id(), 101); + Ring::make_free_balance_be(&4, 10); + assert_ok!(Treasury::propose_bounty(Origin::signed(0), 50, b"12345".to_vec())); + + assert_ok!(Treasury::approve_bounty(Origin::root(), 0)); + + System::set_block_number(2); + >::on_initialize(2); + + assert_ok!(Treasury::propose_curator(Origin::root(), 0, 4, 4)); + assert_ok!(Treasury::accept_curator(Origin::signed(4), 0)); + + assert_eq!(Ring::free_balance(4), 8); // inital 10 - 2 deposit + + assert_noop!(Treasury::award_bounty(Origin::signed(1), 0, 3), Error::::RequireCurator); + + assert_ok!(Treasury::award_bounty(Origin::signed(4), 0, 3)); + + assert_eq!(Treasury::bounties(0).unwrap(), Bounty { + proposer: 0, + fee: 4, + curator_deposit: 2, + value: 50, + bond: 85, + status: BountyStatus::PendingPayout { + curator: 4, + beneficiary: 3, + unlock_at: 5 + }, + }); + + assert_noop!(Treasury::claim_bounty(Origin::signed(1), 0), Error::::Premature); + + System::set_block_number(5); + >::on_initialize(5); + + assert_ok!(Ring::transfer(Origin::signed(0), Treasury::bounty_account_id(0), 10)); + + assert_ok!(Treasury::claim_bounty(Origin::signed(1), 0)); + + assert_eq!(last_event(), RawEvent::BountyClaimed(0, 56, 3)); + + assert_eq!(Ring::free_balance(4), 14); // initial 10 + fee 4 + assert_eq!(Ring::free_balance(3), 56); + assert_eq!(Ring::free_balance(Treasury::bounty_account_id(0)), 0); + + assert_eq!(Treasury::bounties(0), None); + assert_eq!(Treasury::bounty_descriptions(0), None); + }); +} + +#[test] +fn claim_handles_high_fee() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + Ring::make_free_balance_be(&Treasury::account_id(), 101); + Ring::make_free_balance_be(&4, 30); + assert_ok!(Treasury::propose_bounty(Origin::signed(0), 50, b"12345".to_vec())); + + assert_ok!(Treasury::approve_bounty(Origin::root(), 0)); + + System::set_block_number(2); + >::on_initialize(2); + + assert_ok!(Treasury::propose_curator(Origin::root(), 0, 4, 49)); + assert_ok!(Treasury::accept_curator(Origin::signed(4), 0)); + + assert_ok!(Treasury::award_bounty(Origin::signed(4), 0, 3)); + + System::set_block_number(5); + >::on_initialize(5); + + // make fee > balance + let _ = Ring::slash(&Treasury::bounty_account_id(0), 10); + + assert_ok!(Treasury::claim_bounty(Origin::signed(1), 0)); + + assert_eq!(last_event(), RawEvent::BountyClaimed(0, 0, 3)); + + assert_eq!(Ring::free_balance(4), 70); // 30 + 50 - 10 + assert_eq!(Ring::free_balance(3), 0); + assert_eq!(Ring::free_balance(Treasury::bounty_account_id(0)), 0); + + assert_eq!(Treasury::bounties(0), None); + assert_eq!(Treasury::bounty_descriptions(0), None); + }); +} + +#[test] +fn cancel_and_refund() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + Ring::make_free_balance_be(&Treasury::account_id(), 101); + assert_ok!(Treasury::propose_bounty(Origin::signed(0), 50, b"12345".to_vec())); + + assert_ok!(Treasury::approve_bounty(Origin::root(), 0)); + + System::set_block_number(2); + >::on_initialize(2); + + assert_ok!(Ring::transfer(Origin::signed(0), Treasury::bounty_account_id(0), 10)); + + assert_eq!(Treasury::bounties(0).unwrap(), Bounty { + proposer: 0, + fee: 0, + curator_deposit: 0, + value: 50, + bond: 85, + status: BountyStatus::Funded, + }); + + assert_eq!(Ring::free_balance(Treasury::bounty_account_id(0)), 60); + + assert_noop!(Treasury::close_bounty(Origin::signed(0), 0), BadOrigin); + + assert_ok!(Treasury::close_bounty(Origin::root(), 0)); + + assert_eq!(Treasury::pot::(), 85); // - 25 + 10 + }); +} + +#[test] +fn award_and_cancel() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + Ring::make_free_balance_be(&Treasury::account_id(), 101); + assert_ok!(Treasury::propose_bounty(Origin::signed(0), 50, b"12345".to_vec())); + + assert_ok!(Treasury::approve_bounty(Origin::root(), 0)); + + System::set_block_number(2); + >::on_initialize(2); + + assert_ok!(Treasury::propose_curator(Origin::root(), 0, 0, 10)); + assert_ok!(Treasury::accept_curator(Origin::signed(0), 0)); + + assert_eq!(Ring::free_balance(0), 95); + assert_eq!(Ring::reserved_balance(0), 5); + + assert_ok!(Treasury::award_bounty(Origin::signed(0), 0, 3)); + + // Cannot close bounty directly when payout is happening... + assert_noop!(Treasury::close_bounty(Origin::root(), 0), Error::::PendingPayout); + + // Instead unassign the curator to slash them and then close. + assert_ok!(Treasury::unassign_curator(Origin::root(), 0)); + assert_ok!(Treasury::close_bounty(Origin::root(), 0)); + + assert_eq!(last_event(), RawEvent::BountyCanceled(0)); + + assert_eq!(Ring::free_balance(Treasury::bounty_account_id(0)), 0); + // Slashed. + assert_eq!(Ring::free_balance(0), 95); + assert_eq!(Ring::reserved_balance(0), 0); + + assert_eq!(Treasury::bounties(0), None); + assert_eq!(Treasury::bounty_descriptions(0), None); + }); +} + +#[test] +fn expire_and_unassign() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + Ring::make_free_balance_be(&Treasury::account_id(), 101); + assert_ok!(Treasury::propose_bounty(Origin::signed(0), 50, b"12345".to_vec())); + + assert_ok!(Treasury::approve_bounty(Origin::root(), 0)); + + System::set_block_number(2); + >::on_initialize(2); + + assert_ok!(Treasury::propose_curator(Origin::root(), 0, 1, 10)); + assert_ok!(Treasury::accept_curator(Origin::signed(1), 0)); + + assert_eq!(Ring::free_balance(1), 93); + assert_eq!(Ring::reserved_balance(1), 5); + + System::set_block_number(22); + >::on_initialize(22); + + assert_noop!(Treasury::unassign_curator(Origin::signed(0), 0), Error::::Premature); + + System::set_block_number(23); + >::on_initialize(23); + + assert_ok!(Treasury::unassign_curator(Origin::signed(0), 0)); + + assert_eq!(Treasury::bounties(0).unwrap(), Bounty { + proposer: 0, + fee: 10, + curator_deposit: 0, + value: 50, + bond: 85, + status: BountyStatus::Funded, + }); + + assert_eq!(Ring::free_balance(1), 93); + assert_eq!(Ring::reserved_balance(1), 0); // slashed + + }); +} + +#[test] +fn extend_expiry() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + Ring::make_free_balance_be(&Treasury::account_id(), 101); + Ring::make_free_balance_be(&4, 10); + assert_ok!(Treasury::propose_bounty(Origin::signed(0), 50, b"12345".to_vec())); + + assert_ok!(Treasury::approve_bounty(Origin::root(), 0)); + + assert_noop!(Treasury::extend_bounty_expiry(Origin::signed(1), 0, Vec::new()), Error::::UnexpectedStatus); + + System::set_block_number(2); + >::on_initialize(2); + + assert_ok!(Treasury::propose_curator(Origin::root(), 0, 4, 10)); + assert_ok!(Treasury::accept_curator(Origin::signed(4), 0)); + + assert_eq!(Ring::free_balance(4), 5); + assert_eq!(Ring::reserved_balance(4), 5); + + System::set_block_number(10); + >::on_initialize(10); + + assert_noop!(Treasury::extend_bounty_expiry(Origin::signed(0), 0, Vec::new()), Error::::RequireCurator); + assert_ok!(Treasury::extend_bounty_expiry(Origin::signed(4), 0, Vec::new())); + + assert_eq!(Treasury::bounties(0).unwrap(), Bounty { + proposer: 0, + fee: 10, + curator_deposit: 5, + value: 50, + bond: 85, + status: BountyStatus::Active { curator: 4, update_due: 30 }, + }); + + assert_ok!(Treasury::extend_bounty_expiry(Origin::signed(4), 0, Vec::new())); + + assert_eq!(Treasury::bounties(0).unwrap(), Bounty { + proposer: 0, + fee: 10, + curator_deposit: 5, + value: 50, + bond: 85, + status: BountyStatus::Active { curator: 4, update_due: 30 }, // still the same + }); + + System::set_block_number(25); + >::on_initialize(25); + + assert_noop!(Treasury::unassign_curator(Origin::signed(0), 0), Error::::Premature); + assert_ok!(Treasury::unassign_curator(Origin::signed(4), 0)); + + assert_eq!(Ring::free_balance(4), 10); // not slashed + assert_eq!(Ring::reserved_balance(4), 0); + }); +} From 1f17573560044f4bfc442e4d5add98bf8a15750b Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 12 Oct 2020 15:17:15 +0800 Subject: [PATCH 06/11] grandpa-rpc: use FinalityProofProvider to check finality for rpc, companion: for #6215 --- bin/node-template/node/src/rpc.rs | 14 ++++++++++---- bin/node-template/node/src/service.rs | 20 ++++++++++++-------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/bin/node-template/node/src/rpc.rs b/bin/node-template/node/src/rpc.rs index 3c91797f33..14226eabca 100644 --- a/bin/node-template/node/src/rpc.rs +++ b/bin/node-template/node/src/rpc.rs @@ -42,7 +42,7 @@ pub struct BabeDeps { } /// Extra dependencies for GRANDPA -pub struct GrandpaDeps { +pub struct GrandpaDeps { /// Voting round info. pub shared_voter_state: sc_finality_grandpa::SharedVoterState, /// Authority set info. @@ -51,10 +51,12 @@ pub struct GrandpaDeps { pub justification_stream: sc_finality_grandpa::GrandpaJustificationStream, /// Subscription manager to keep track of pubsub subscribers. pub subscriptions: jsonrpc_pubsub::manager::SubscriptionManager, + /// Finality proof provider. + pub finality_provider: Arc>, } /// Full client dependencies. -pub struct FullDeps { +pub struct FullDeps { /// The client instance to use. pub client: Arc, /// Transaction pool instance. @@ -66,7 +68,7 @@ pub struct FullDeps { /// BABE specific dependencies. pub babe: BabeDeps, /// GRANDPA specific dependencies. - pub grandpa: GrandpaDeps, + pub grandpa: GrandpaDeps, } /// Light client extra dependencies. @@ -82,7 +84,7 @@ pub struct LightDeps { } /// Instantiate all RPC extensions. -pub fn create_full(deps: FullDeps) -> RpcExtension +pub fn create_full(deps: FullDeps) -> RpcExtension where C: 'static + Send + Sync, C: ProvideRuntimeApi, @@ -97,6 +99,8 @@ where C::Api: darwinia_staking_rpc::StakingRuntimeApi, P: 'static + sp_transaction_pool::TransactionPool, SC: 'static + sp_consensus::SelectChain, + B: sc_client_api::Backend + Send + Sync + 'static, + B::State: sc_client_api::backend::StateBackend>, { // --- substrate --- use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; @@ -147,6 +151,7 @@ where shared_authority_set, justification_stream, subscriptions, + finality_provider, } = grandpa; io.extend_with(sc_finality_grandpa_rpc::GrandpaApi::to_delegate( GrandpaRpcHandler::new( @@ -154,6 +159,7 @@ where shared_voter_state, justification_stream, subscriptions, + finality_provider, ), )); } diff --git a/bin/node-template/node/src/service.rs b/bin/node-template/node/src/service.rs index 844f786cb6..3b98489334 100644 --- a/bin/node-template/node/src/service.rs +++ b/bin/node-template/node/src/service.rs @@ -20,7 +20,7 @@ use sc_finality_grandpa::{ }; use sc_service::{ config::{KeystoreConfig, PrometheusConfig}, - BuildNetworkParams, Configuration, Error as ServiceError, NoopRpcExtensionBuilder, + BuildNetworkParams, Configuration, Error as ServiceError, PartialComponents, SpawnTasksParams, TaskManager, TelemetryConnectionSinks, }; use sc_transaction_pool::{BasicPool, FullPool}; @@ -161,7 +161,10 @@ fn new_partial( LinkHalf, FullSelectChain>, BabeLink, ), - GrandpaSharedVoterState, + ( + GrandpaSharedVoterState, + Arc>, + ), ), >, ServiceError, @@ -215,8 +218,10 @@ where let justification_stream = grandpa_link.justification_stream(); let shared_authority_set = grandpa_link.shared_authority_set().clone(); let shared_voter_state = GrandpaSharedVoterState::empty(); + let finality_proof_provider = + GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone()); let import_setup = (babe_import.clone(), grandpa_link, babe_link.clone()); - let rpc_setup = shared_voter_state.clone(); + let rpc_setup = (shared_voter_state.clone(), finality_proof_provider.clone()); let babe_config = babe_link.config().clone(); let shared_epoch_changes = babe_link.epoch_changes().clone(); let rpc_extensions_builder = { @@ -241,6 +246,7 @@ where shared_authority_set: shared_authority_set.clone(), justification_stream: justification_stream.clone(), subscriptions, + finality_provider: finality_proof_provider.clone(), }, }; @@ -289,8 +295,7 @@ where other: (rpc_extensions_builder, import_setup, rpc_setup), } = new_partial::(&mut config)?; let prometheus_registry = config.prometheus_registry().cloned(); - let finality_proof_provider = - GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone()); + let (shared_voter_state, finality_proof_provider) = rpc_setup; let (network, network_status_sinks, system_rpc_tx, network_starter) = sc_service::build_network(BuildNetworkParams { config: &config, @@ -333,7 +338,6 @@ where })?; let (block_import, link_half, babe_link) = import_setup; - let shared_voter_state = rpc_setup; if role.is_authority() { let can_author_with = CanAuthorWithNativeVersion::new(client.executor().clone()); @@ -485,12 +489,12 @@ where client: client.clone(), pool: transaction_pool.clone(), }; - let rpc_extension = rpc::create_light(light_deps); + let _rpc_extension = rpc::create_light(light_deps); sc_service::spawn_tasks(SpawnTasksParams { on_demand: Some(on_demand), remote_blockchain: Some(backend.remote_blockchain()), - rpc_extensions_builder: Box::new(NoopRpcExtensionBuilder(rpc_extension)), + rpc_extensions_builder: Box::new(|_, _| ()), task_manager: &mut task_manager, telemetry_connection_sinks: TelemetryConnectionSinks::default(), config, From 958e32adcc1be5636ca8c6cf928568bf9e74a645 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 12 Oct 2020 15:20:13 +0800 Subject: [PATCH 07/11] Change subscriptions type from SubscriptionManager to SubscriptionTaskExecutor --- bin/node-template/node/src/rpc.rs | 2 +- bin/node-template/node/src/service.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/node-template/node/src/rpc.rs b/bin/node-template/node/src/rpc.rs index 14226eabca..34463d11cd 100644 --- a/bin/node-template/node/src/rpc.rs +++ b/bin/node-template/node/src/rpc.rs @@ -50,7 +50,7 @@ pub struct GrandpaDeps { /// Receives notifications about justification events from Grandpa. pub justification_stream: sc_finality_grandpa::GrandpaJustificationStream, /// Subscription manager to keep track of pubsub subscribers. - pub subscriptions: jsonrpc_pubsub::manager::SubscriptionManager, + pub subscriptions: sc_rpc::SubscriptionTaskExecutor, /// Finality proof provider. pub finality_provider: Arc>, } diff --git a/bin/node-template/node/src/service.rs b/bin/node-template/node/src/service.rs index 3b98489334..1ace049718 100644 --- a/bin/node-template/node/src/service.rs +++ b/bin/node-template/node/src/service.rs @@ -35,12 +35,13 @@ use sp_trie::PrefixedMemoryDB; use substrate_prometheus_endpoint::Registry; // --- darwinia --- use crate::rpc::{ - self, BabeDeps, DenyUnsafe, FullDeps, GrandpaDeps, LightDeps, RpcExtension, SubscriptionManager, + self, BabeDeps, DenyUnsafe, FullDeps, GrandpaDeps, LightDeps, RpcExtension, }; use node_template_runtime::{ opaque::Block, primitives::{AccountId, Balance, Hash, Nonce, Power}, }; +use sc_rpc::SubscriptionTaskExecutor; type FullBackend = sc_service::TFullBackend; type FullSelectChain = sc_consensus::LongestChain; @@ -151,7 +152,7 @@ fn new_partial( DefaultImportQueue>, FullPool>, ( - impl Fn(DenyUnsafe, SubscriptionManager) -> RpcExtension, + impl Fn(DenyUnsafe, SubscriptionTaskExecutor) -> RpcExtension, ( BabeBlockImport< Block, From a623af4d7d6d3993446b79ef6b401c9dc800a738 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 12 Oct 2020 15:21:50 +0800 Subject: [PATCH 08/11] Runtime "type WeightInfo" adjustment --- bin/node-template/runtime/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs index a35fcbb99d..e0cb94cf1b 100644 --- a/bin/node-template/runtime/src/lib.rs +++ b/bin/node-template/runtime/src/lib.rs @@ -493,6 +493,7 @@ impl pallet_babe::Trait for Runtime { )>>::IdentificationTuple; type HandleEquivocation = pallet_babe::EquivocationHandler; + type WeightInfo = (); } parameter_types! { @@ -625,7 +626,6 @@ impl pallet_offences::Trait for Runtime { type IdentificationTuple = pallet_session::historical::IdentificationTuple; type OnOffenceHandler = Staking; type WeightSoftLimit = OffencesWeightSoftLimit; - type WeightInfo = (); } impl pallet_session::historical::Trait for Runtime { @@ -679,6 +679,7 @@ impl pallet_grandpa::Trait for Runtime { type KeyOwnerProofSystem = Historical; type HandleEquivocation = pallet_grandpa::EquivocationHandler; + type WeightInfo = (); } parameter_types! { From 95b18ab4944f41c79c255c10b577fba0e7b2b305 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 12 Oct 2020 15:31:56 +0800 Subject: [PATCH 09/11] pallet_scheduler::Trait add MaxScheduledPerBlock --- bin/node-template/runtime/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs index e0cb94cf1b..d34d230ea3 100644 --- a/bin/node-template/runtime/src/lib.rs +++ b/bin/node-template/runtime/src/lib.rs @@ -464,6 +464,10 @@ impl frame_system::Trait for Runtime { type SystemWeightInfo = weights::frame_system::WeightInfo; } +parameter_types! { + pub const MaxScheduledPerBlock: u32 = 50; +} + impl pallet_scheduler::Trait for Runtime { type Event = Event; type Origin = Origin; @@ -471,6 +475,7 @@ impl pallet_scheduler::Trait for Runtime { type Call = Call; type MaximumWeight = MaximumBlockWeight; type ScheduleOrigin = EnsureRoot; + type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = (); } From dcc39046e52294942a853949309befdecbab96cc Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 12 Oct 2020 16:36:29 +0800 Subject: [PATCH 10/11] add generated weight info for pallet-collective. companion for #6789 --- bin/node-template/runtime/src/lib.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs index d34d230ea3..b837a0f15e 100644 --- a/bin/node-template/runtime/src/lib.rs +++ b/bin/node-template/runtime/src/lib.rs @@ -761,11 +761,13 @@ impl darwinia_democracy::Trait for Runtime { parameter_types! { pub const CouncilMotionDuration: BlockNumber = 3 * DAYS; pub const CouncilMaxProposals: u32 = 100; + pub const CouncilMaxMembers: u32 = 100; pub const TechnicalMotionDuration: BlockNumber = 3 * DAYS; pub const TechnicalMaxProposals: u32 = 100; + pub const TechnicalMaxMembers: u32 = 100; } -// Make sure that there are no more than `MAX_MEMBERS` members elected via elections-phragmen. -const_assert!(DesiredMembers::get() <= pallet_collective::MAX_MEMBERS); +// Make sure that there are no more than `MaxMembers` members elected via elections-phragmen. +const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get()); type CouncilCollective = pallet_collective::Instance0; impl pallet_collective::Trait for Runtime { type Origin = Origin; @@ -773,6 +775,8 @@ impl pallet_collective::Trait for Runtime { type Event = Event; type MotionDuration = CouncilMotionDuration; type MaxProposals = CouncilMaxProposals; + type MaxMembers = CouncilMaxMembers; + type DefaultVote = pallet_collective::PrimeDefaultVote; type WeightInfo = (); } type TechnicalCollective = pallet_collective::Instance1; @@ -782,6 +786,8 @@ impl pallet_collective::Trait for Runtime { type Event = Event; type MotionDuration = TechnicalMotionDuration; type MaxProposals = TechnicalMaxProposals; + type MaxMembers = TechnicalMaxMembers; + type DefaultVote = pallet_collective::PrimeDefaultVote; type WeightInfo = (); } From 2175b6b55af694c85dd239e3d1fa039160c018c2 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 12 Oct 2020 17:09:37 +0800 Subject: [PATCH 11/11] Cargo.lock update --- Cargo.lock | 1541 +++++++++++++++++++++++++--------------------------- 1 file changed, 753 insertions(+), 788 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8661bac408..c6be98612a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,32 +36,20 @@ dependencies = [ [[package]] name = "aes" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7001367fde4c768a19d1029f0a8be5abd9308e1119846d5bd9ad26297b8faf5" +checksum = "dd2bc6d3f370b5666245ff421e231cba4353df936e26986d2918e61a8fd6aef6" dependencies = [ - "aes-soft 0.4.0", - "aesni 0.7.0", + "aes-soft", + "aesni", "block-cipher", ] -[[package]] -name = "aes-ctr" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2e5b0458ea3beae0d1d8c0f3946564f8e10f90646cf78c06b4351052058d1ee" -dependencies = [ - "aes-soft 0.3.3", - "aesni 0.6.0", - "ctr", - "stream-cipher 0.3.2", -] - [[package]] name = "aes-gcm" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f5007801316299f922a6198d1d09a0bae95786815d066d5880d13f7c45ead1" +checksum = "0301c9e9c443494d970a07885e8cf3e587bae8356a1d5abd0999068413f7205f" dependencies = [ "aead", "aes", @@ -72,52 +60,30 @@ dependencies = [ [[package]] name = "aes-soft" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" -dependencies = [ - "block-cipher-trait", - "byteorder 1.3.4", - "opaque-debug 0.2.3", -] - -[[package]] -name = "aes-soft" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4925647ee64e5056cf231608957ce7c81e12d6d6e316b9ce1404778cc1d35fa7" +checksum = "63dd91889c49327ad7ef3b500fd1109dbd3c509a03db0d4a9ce413b79f575cb6" dependencies = [ "block-cipher", "byteorder 1.3.4", - "opaque-debug 0.2.3", -] - -[[package]] -name = "aesni" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" -dependencies = [ - "block-cipher-trait", - "opaque-debug 0.2.3", - "stream-cipher 0.3.2", + "opaque-debug 0.3.0", ] [[package]] name = "aesni" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050d39b0b7688b3a3254394c3e30a9d66c41dcf9b05b0e2dbdc623f6505d264" +checksum = "0a6fe808308bb07d393e2ea47780043ec47683fcf19cf5efc8ca51c50cc8c68a" dependencies = [ "block-cipher", - "opaque-debug 0.2.3", + "opaque-debug 0.3.0", ] [[package]] name = "ahash" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" +checksum = "29661b60bec623f0586702976ff4d0c9942dcb6723161c2df0eea78455cfedfb" dependencies = [ "const-random", ] @@ -168,9 +134,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b" +checksum = "a1fd36ffbb1fb7c834eac128ea8d0e310c5aeb635548f9d58861e1308d46e71c" [[package]] name = "approx" @@ -191,7 +157,7 @@ checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" name = "array-bytes" version = "1.0.0" dependencies = [ - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] @@ -236,9 +202,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.4.2" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21279cfaa4f47df10b1816007e738ca3747ef2ee53ffc51cdbf57a8bb266fee3" +checksum = "59740d83946db6a5af71ae25ddf9562c2b176b2ca42cf99a455f09f4a220d6b9" dependencies = [ "concurrent-queue", "event-listener", @@ -251,7 +217,7 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d373d78ded7d0b3fa8039375718cde0aace493f2e34fb60f51cbf567562ca801" dependencies = [ - "async-task 4.0.2", + "async-task", "concurrent-queue", "fastrand", "futures-lite", @@ -261,9 +227,9 @@ dependencies = [ [[package]] name = "async-global-executor" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5586e693d02f9b439742e9d5d68bd64d923c6861954f7d78f91001a0e152d589" +checksum = "fefeb39da249f4c33af940b779a56723ce45809ef5c54dad84bb538d4ffb6d9e" dependencies = [ "async-executor", "async-io", @@ -274,13 +240,14 @@ dependencies = [ [[package]] name = "async-io" -version = "1.1.3" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9951f92a2b4f7793f8fc06a80bdb89b62c618c993497d4606474fb8c34941b5" +checksum = "d54bc4c1c7292475efb2253227dbcfad8fe1ca4c02bc62c510cc2f3da5c4704e" dependencies = [ "concurrent-queue", "fastrand", "futures-lite", + "libc", "log", "nb-connect", "once_cell 1.4.1", @@ -288,6 +255,7 @@ dependencies = [ "polling", "vec-arena", "waker-fn", + "winapi 0.3.9", ] [[package]] @@ -301,14 +269,13 @@ dependencies = [ [[package]] name = "async-std" -version = "1.6.4" +version = "1.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c92085acfce8b32e5b261d0b59b8f3309aee69fea421ea3f271f8b93225754f" +checksum = "a9fa76751505e8df1c7a77762f60486f60c71bbd9b8557f4da6ad47d083732ed" dependencies = [ "async-global-executor", "async-io", "async-mutex", - "async-task 3.0.0", "blocking", "crossbeam-utils", "futures-channel", @@ -327,12 +294,6 @@ dependencies = [ "wasm-bindgen-futures", ] -[[package]] -name = "async-task" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17772156ef2829aadc587461c7753af20b7e8db1529bc66855add962a3b35d3" - [[package]] name = "async-task" version = "4.0.2" @@ -345,7 +306,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df097e3f506bec0e1a24f06bb3c962c228f36671de841ff579cb99f371772634" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "rustls", "webpki", "webpki-roots 0.19.0", @@ -353,9 +314,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "687c230d85c0a52504709705fc8a53e4a692b83a2184f03dae73e38e1e93a783" +checksum = "b246867b8b3b6ae56035f1eb1ed557c1d8eae97f0d53696138a50fa0e3a3b8c0" dependencies = [ "proc-macro2", "quote", @@ -399,15 +360,15 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.50" +version = "0.3.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" +checksum = "707b586e0e2f247cbde68cdd2c3ce69ea7b7be43e1c5b426e37c9319c4b9838e" dependencies = [ "addr2line", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.20.0", + "object 0.21.1", "rustc-demangle", ] @@ -447,7 +408,7 @@ checksum = "66c0bb6167449588ff70803f4127f0684f9063097eca5016f37eb52b92c2cf36" dependencies = [ "bitflags", "cexpr", - "cfg-if", + "cfg-if 0.1.10", "clang-sys", "clap", "env_logger", @@ -569,22 +530,13 @@ dependencies = [ [[package]] name = "block-cipher" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa136449e765dc7faa244561ccae839c394048667929af599b5d931ebe7b7f10" +checksum = "f337a3e6da609650eb74e02bc9fac7b735049f7623ab12f2e4c719316fcc7e80" dependencies = [ "generic-array 0.14.4", ] -[[package]] -name = "block-cipher-trait" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" -dependencies = [ - "generic-array 0.12.3", -] - [[package]] name = "block-padding" version = "0.1.5" @@ -602,16 +554,16 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blocking" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2640778f8053e72c11f621b0a5175a0560a269282aa98ed85107773ab8e2a556" +checksum = "c5e170dbede1f740736619b776d7251cb1b9095c435c34d8ca9f57fcd2f335e9" dependencies = [ "async-channel", + "async-task", "atomic-waker", "fastrand", "futures-lite", "once_cell 1.4.1", - "waker-fn", ] [[package]] @@ -702,9 +654,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c" +checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d" dependencies = [ "jobserver", ] @@ -724,38 +676,46 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "chacha20" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "086c0f07ac275808b7bf9a39f2fd013aae1498be83632814c8c4e0bd53f2dc58" +checksum = "244fbce0d47e97e8ef2f63b81d5e05882cb518c68531eb33194990d7b7e85845" dependencies = [ - "stream-cipher 0.4.1", + "stream-cipher 0.7.1", "zeroize", ] [[package]] name = "chacha20poly1305" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b0c90556d8e3fec7cf18d84a2f53d27b21288f2fe481b830fadcf809e48205" +checksum = "9bf18d374d66df0c05cdddd528a7db98f78c28e2519b120855c4f84c5027b1f5" dependencies = [ "aead", "chacha20", "poly1305", - "stream-cipher 0.4.1", + "stream-cipher 0.7.1", "zeroize", ] [[package]] name = "chrono" -version = "0.4.15" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942f72db697d8767c22d46a598e01f2d3b475501ea43d0db4f16d90259182d0b" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ + "libc", "num-integer", "num-traits", "time", + "winapi 0.3.9", ] [[package]] @@ -763,7 +723,7 @@ name = "ckb-merkle-mountain-range" version = "0.3.0" source = "git+https://github.com/darwinia-network/merkle-mountain-range.git#6ab7d95f407aa345e8f7fd6681a127609ad50e5a" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -821,9 +781,9 @@ dependencies = [ [[package]] name = "const-random" -version = "0.1.8" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f1af9ac737b2dd2d577701e59fd09ba34822f6f2ebdb30a7647405d9e55e16a" +checksum = "02dc82c12dc2ee6e1ded861cf7d582b46f66f796d1b6c93fa28b911ead95da02" dependencies = [ "const-random-macro", "proc-macro-hack", @@ -831,11 +791,11 @@ dependencies = [ [[package]] name = "const-random-macro" -version = "0.1.8" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25e4c606eb459dd29f7c57b2e0879f2b6f14ee130918c2b78ccb58a9624e6c7a" +checksum = "fc757bbb9544aa296c2ae00c679e81f886b37e28e59097defe0cf524306f6685" dependencies = [ - "getrandom", + "getrandom 0.2.0", "proc-macro-hack", ] @@ -965,7 +925,7 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -1032,7 +992,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ "autocfg 1.0.1", - "cfg-if", + "cfg-if 0.1.10", "crossbeam-utils", "lazy_static", "maybe-uninit", @@ -1046,7 +1006,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "crossbeam-utils", "maybe-uninit", ] @@ -1058,7 +1018,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ "autocfg 1.0.1", - "cfg-if", + "cfg-if 0.1.10", "lazy_static", ] @@ -1119,16 +1079,6 @@ dependencies = [ "sct", ] -[[package]] -name = "ctr" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022cd691704491df67d25d006fe8eca083098253c4d43516c2206479c58c6736" -dependencies = [ - "block-cipher-trait", - "stream-cipher 0.3.2", -] - [[package]] name = "cuckoofilter" version = "0.3.2" @@ -1179,7 +1129,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] @@ -1223,7 +1173,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] @@ -1279,7 +1229,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-storage", "substrate-test-utils", ] @@ -1299,7 +1249,7 @@ dependencies = [ "sp-io", "sp-npos-elections", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "substrate-test-utils", ] @@ -1329,7 +1279,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] @@ -1350,7 +1300,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] @@ -1375,7 +1325,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] @@ -1394,7 +1344,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] @@ -1420,7 +1370,7 @@ dependencies = [ "serde", "sp-api", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] @@ -1430,7 +1380,7 @@ dependencies = [ "frame-support", "parity-scale-codec", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] @@ -1448,7 +1398,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] @@ -1458,7 +1408,6 @@ dependencies = [ "darwinia-balances", "darwinia-staking-rpc-runtime-api", "darwinia-support", - "env_logger", "frame-support", "frame-system", "pallet-authorship", @@ -1473,8 +1422,9 @@ dependencies = [ "sp-npos-elections", "sp-runtime", "sp-staking", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-storage", + "sp-tracing", "static_assertions 1.1.0", "substrate-fixed", "substrate-test-utils", @@ -1515,7 +1465,7 @@ dependencies = [ "num-traits", "parity-scale-codec", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] @@ -1531,7 +1481,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-storage", ] @@ -1561,7 +1511,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-storage", ] @@ -1573,9 +1523,9 @@ checksum = "d4d0e2d24e5ee3b23a01de38eefdcd978907890701f08ffffd4cb457ca4ee8d6" [[package]] name = "derive_more" -version = "0.99.10" +version = "0.99.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dcfabdab475c16a93d669dddfc393027803e347d09663f524447f642fbb84ba" +checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c" dependencies = [ "proc-macro2", "quote", @@ -1606,7 +1556,7 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "dirs-sys", ] @@ -1722,9 +1672,9 @@ dependencies = [ [[package]] name = "environmental" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516aa8d7a71cb00a1c4146f0798549b93d083d4f189b3ced8f3de6b8f11ee6c4" +checksum = "6576a1755ddffd988788025e75bce9e74b018f7cc226198fe931d077911c6d7e" [[package]] name = "erased-serde" @@ -1778,7 +1728,7 @@ dependencies = [ "byteorder 1.3.4", "ethereum-types 0.8.0", "primitive-types 0.6.2", - "rlp 0.4.5", + "rlp 0.4.6", "sha3 0.8.2", ] @@ -1831,7 +1781,7 @@ dependencies = [ "serde_json", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "triehash", ] @@ -1884,7 +1834,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", ] [[package]] @@ -1923,15 +1873,18 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.3.5" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c85295147490b8fcf2ea3d104080a105a8b2c63f9c319e82c02d8e952388919" +checksum = "ca5faf057445ce5c9d4329e382b2ce7ca38550ef3b73a5348362d5f24e0c7fe3" +dependencies = [ + "instant", +] [[package]] name = "fdlimit" -version = "0.1.4" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da54a593b34c71b889ee45f5b5bb900c74148c5f7f8c6a9479ee7899f69603c" +checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b" dependencies = [ "libc", ] @@ -1953,7 +1906,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8feb87a63249689640ac9c011742c33139204e3c134293d3054022276869133b" dependencies = [ "either", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 2.0.2", "log", "num-traits", @@ -2005,11 +1958,11 @@ checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" [[package]] name = "flate2" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "766d0e77a2c1502169d4a93ff3b8c15a71fd946cd0126309752104e5f3c46d94" +checksum = "da80be589a72651dcda34d8b35bcdc9b7254ad06325611074d9cc0fbb19f60ee" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "crc32fast", "libc", "libz-sys", @@ -2024,16 +1977,16 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", ] [[package]] name = "frame-benchmarking" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", @@ -2044,40 +1997,41 @@ dependencies = [ "sp-io", "sp-runtime", "sp-runtime-interface", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-storage", ] [[package]] name = "frame-executive" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "serde", + "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-tracing", ] [[package]] name = "frame-metadata" -version = "11.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "12.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "serde", "sp-core", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "frame-support" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "bitmask", "frame-metadata", @@ -2095,14 +2049,14 @@ dependencies = [ "sp-io", "sp-runtime", "sp-state-machine", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-tracing", ] [[package]] name = "frame-support-procedural" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support-procedural-tools", "proc-macro2", @@ -2112,8 +2066,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2124,8 +2078,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "proc-macro2", "quote", @@ -2134,8 +2088,8 @@ dependencies = [ [[package]] name = "frame-system" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -2144,14 +2098,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-version", ] [[package]] name = "frame-system-rpc-runtime-api" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "sp-api", @@ -2193,15 +2147,15 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" +checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" [[package]] name = "futures" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" +checksum = "5d8e3078b7b2a8a671cb7a3d17b4760e4181ea243227776ba83fd043b4ca034e" dependencies = [ "futures-channel", "futures-core", @@ -2214,9 +2168,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" +checksum = "a7a4d35f7401e948629c9c3d6638fb9bf94e0b2121e96c3b428cc4e631f3eb74" dependencies = [ "futures-core", "futures-sink", @@ -2233,9 +2187,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" +checksum = "d674eaa0056896d5ada519900dbf97ead2e46a7b6621e8160d79e2f2e1e2784b" [[package]] name = "futures-core-preview" @@ -2249,7 +2203,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "num_cpus", ] @@ -2259,8 +2213,8 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9" dependencies = [ - "futures 0.1.29", - "futures 0.3.5", + "futures 0.1.30", + "futures 0.3.6", "lazy_static", "log", "parking_lot 0.9.0", @@ -2271,9 +2225,9 @@ dependencies = [ [[package]] name = "futures-executor" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" +checksum = "cc709ca1da6f66143b8c9bec8e6260181869893714e9b5a490b169b0414144ab" dependencies = [ "futures-core", "futures-task", @@ -2283,15 +2237,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" +checksum = "5fc94b64bb39543b4e432f1790b6bf18e3ee3b74653c5449f63310e9a74b123c" [[package]] name = "futures-lite" -version = "1.8.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0db18c5f58083b54b0c416638ea73066722c2815c1e54dd8ba85ee3def593c3a" +checksum = "381a7ad57b1bad34693f63f6f377e1abded7a9c85c9d3eb6771e11c60aaadab9" dependencies = [ "fastrand", "futures-core", @@ -2304,9 +2258,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" +checksum = "f57ed14da4603b2554682e9f2ff3c65d7567b53188db96cb71538217fc64581b" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -2316,15 +2270,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" +checksum = "0d8764258ed64ebc5d9ed185cf86a95db5cac810269c5d20ececb32e0088abbd" [[package]] name = "futures-task" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" +checksum = "4dd26820a9f3637f1302da8bceba3ff33adbe53464b54ca24d4e2d4f1db30f94" dependencies = [ "once_cell 1.4.1", ] @@ -2343,11 +2297,11 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" +checksum = "8a894a0acddba51a2d49a6f4263b1e64b8c579ece8af50fa86503d52cd1eea34" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "futures-channel", "futures-core", "futures-io", @@ -2381,7 +2335,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce54d63f8b0c75023ed920d46fd71d0cbbb830b0ee012726b5b4f506fb6dea5b" dependencies = [ "bytes 0.5.6", - "futures 0.3.5", + "futures 0.3.6", "memchr", "pin-project", ] @@ -2439,7 +2393,18 @@ version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee8025cf36f917e6a52cce185b7c7177689b838b7ec138364e50cc2277a56cf4" +dependencies = [ + "cfg-if 0.1.10", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -2511,7 +2476,7 @@ dependencies = [ "byteorder 1.3.4", "bytes 0.4.12", "fnv", - "futures 0.1.29", + "futures 0.1.30", "http 0.1.21", "indexmap", "log", @@ -2576,7 +2541,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" dependencies = [ - "ahash 0.2.18", + "ahash 0.2.19", "autocfg 0.1.7", ] @@ -2592,9 +2557,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00d63df3d41950fb462ed38308eea019113ad1508da725bbedcd0fa5a85ef5f7" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" [[package]] name = "heapsize" @@ -2616,9 +2581,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151" +checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" dependencies = [ "libc", ] @@ -2691,7 +2656,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "http 0.1.21", "tokio-buf", ] @@ -2734,7 +2699,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "futures-cpupool", "h2 0.1.26", "http 0.1.21", @@ -2844,7 +2809,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5" dependencies = [ - "rlp 0.4.5", + "rlp 0.4.6", ] [[package]] @@ -2899,7 +2864,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" dependencies = [ "autocfg 1.0.1", - "hashbrown 0.9.0", + "hashbrown 0.9.1", "serde", ] @@ -2909,7 +2874,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -2927,7 +2892,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-timer 2.0.2", ] @@ -2996,12 +2961,12 @@ dependencies = [ [[package]] name = "jsonrpc-client-transports" -version = "14.2.1" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2773fa94a2a1fd51efb89a8f45b8861023dbb415d18d3c9235ae9388d780f9ec" +checksum = "489b9c612e60c766f751ab40fcb43cbb55a1e10bb44a9b4307ed510ca598cbd7" dependencies = [ "failure", - "futures 0.1.29", + "futures 0.1.30", "jsonrpc-core", "jsonrpc-pubsub", "log", @@ -3012,11 +2977,11 @@ dependencies = [ [[package]] name = "jsonrpc-core" -version = "14.2.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0747307121ffb9703afd93afbd0fb4f854c38fb873f2c8b90e0e902f27c7b62" +checksum = "0745a6379e3edc893c84ec203589790774e4247420033e71a76d3ab4687991fa" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "log", "serde", "serde_derive", @@ -3025,18 +2990,18 @@ dependencies = [ [[package]] name = "jsonrpc-core-client" -version = "14.2.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34221123bc79b66279a3fde2d3363553835b43092d629b34f2e760c44dc94713" +checksum = "6f764902d7b891344a0acb65625f32f6f7c6db006952143bd650209fbe7d94db" dependencies = [ "jsonrpc-client-transports", ] [[package]] name = "jsonrpc-derive" -version = "14.2.2" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e77e8812f02155b85a677a96e1d16b60181950c0636199bc4528524fba98dc" +checksum = "99a847f9ec7bb52149b2786a17c9cb260d6effc6b8eeb8c16b343a487a7563a3" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3046,9 +3011,9 @@ dependencies = [ [[package]] name = "jsonrpc-http-server" -version = "14.2.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da906d682799df05754480dac1b9e70ec92e12c19ebafd2662a5ea1c9fd6522" +checksum = "4fb5c4513b7b542f42da107942b7b759f27120b5cc894729f88254b28dff44b7" dependencies = [ "hyper 0.12.35", "jsonrpc-core", @@ -3061,9 +3026,9 @@ dependencies = [ [[package]] name = "jsonrpc-ipc-server" -version = "14.2.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dedccd693325d833963b549e959137f30a7a0ea650cde92feda81dc0c1393cb5" +checksum = "cf50e53e4eea8f421a7316c5f63e395f7bc7c4e786a6dc54d76fab6ff7aa7ce7" dependencies = [ "jsonrpc-core", "jsonrpc-server-utils", @@ -3075,9 +3040,9 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" -version = "14.2.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d44f5602a11d657946aac09357956d2841299ed422035edf140c552cb057986" +checksum = "639558e0604013be9787ae52f798506ae42bf4220fe587bdc5625871cc8b9c77" dependencies = [ "jsonrpc-core", "log", @@ -3088,9 +3053,9 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" -version = "14.2.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56cbfb462e7f902e21121d9f0d1c2b77b2c5b642e1a4e8f4ebfa2e15b94402bb" +checksum = "72f1f3990650c033bd8f6bd46deac76d990f9bbfb5f8dc8c4767bf0a00392176" dependencies = [ "bytes 0.4.12", "globset", @@ -3104,16 +3069,16 @@ dependencies = [ [[package]] name = "jsonrpc-ws-server" -version = "14.2.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "903d3109fe7c4acb932b567e1e607e0f524ed04741b09fb0e61841bc40a022fc" +checksum = "6596fe75209b73a2a75ebe1dce4e60e03b88a2b25e8807b667597f6315150d22" dependencies = [ "jsonrpc-core", "jsonrpc-server-utils", "log", + "parity-ws", "parking_lot 0.10.2", "slab", - "ws", ] [[package]] @@ -3220,9 +3185,9 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" [[package]] name = "libc" -version = "0.2.77" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235" +checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743" [[package]] name = "libloading" @@ -3242,13 +3207,13 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libp2p" -version = "0.24.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c101edbb9c06955fd4085b77d2abc31cf3650134d77068b35c44967756ada8" +checksum = "571f5a4604c1a40d75651da141dfde29ad15329f537a779528803297d2220274" dependencies = [ "atomic", "bytes 0.5.6", - "futures 0.3.5", + "futures 0.3.6", "lazy_static", "libp2p-core", "libp2p-core-derive", @@ -3265,7 +3230,6 @@ dependencies = [ "libp2p-plaintext", "libp2p-pnet", "libp2p-request-response", - "libp2p-secio", "libp2p-swarm", "libp2p-tcp", "libp2p-uds", @@ -3282,16 +3246,16 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.21.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cea54ea4a846a7c47e4347db0fc7a4129dcb0fb57f07f57e473820edbfcbde" +checksum = "52f13ba8c7df0768af2eb391696d562c7de88cc3a35122531aaa6a7d77754d25" dependencies = [ "asn1_der", "bs58", "ed25519-dalek", "either", "fnv", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "lazy_static", "libsecp256k1", @@ -3326,35 +3290,35 @@ dependencies = [ [[package]] name = "libp2p-deflate" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6174d6addc9cc5fd84af7099480774035dd1a7cdf48dd31b23dea45cf57638" +checksum = "74029ae187f35f4b8ddf26b9779a68b340045d708528a103917cdca49a296db5" dependencies = [ "flate2", - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", ] [[package]] name = "libp2p-dns" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce8769cfe677a567d2677dc02a9e5be27a24acf1ff78a59cef425caae009a6a" +checksum = "7cf319822e08dd65c8e060d2354e9f952895bbc433f5706c75ed010c152aee5e" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "log", ] [[package]] name = "libp2p-floodsub" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f2342965ac7ea4b85f4df5288089796421f9297ba4020dc9692f4ef728590dc" +checksum = "d8a9acb43a3e4a4e413e0c4abe0fa49308df7c6335c88534757b647199cb8a51" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "libp2p-swarm", "prost", @@ -3365,15 +3329,15 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0828b4f0c76c2edc68da574e391ce981bac5316d65785cddfe8c273d4c9bd4bb" +checksum = "ab20fcb60edebe3173bbb708c6ac3444afdf1e3152dc2866b10c4f5497f17467" dependencies = [ "base64 0.11.0", "byteorder 1.3.4", "bytes 0.5.6", "fnv", - "futures 0.3.5", + "futures 0.3.6", "futures_codec", "hex_fmt", "libp2p-core", @@ -3391,11 +3355,11 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41efcb5b521b65d2c45432a244ce6427cdd3649228cd192f397d1fa67682aef2" +checksum = "56396ee63aa9164eacf40c2c5d2bda8c4133c2f57e1b0425d51d3a4e362583b1" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "libp2p-swarm", "log", @@ -3407,15 +3371,15 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.22.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca9b4ccc868863317af3f65eb241811ceadd971d133183040140f5496037e0ae" +checksum = "cc7fa9047f8b8f544278a35c2d9d45d3b2c1785f2d86d4e1629d6edf97be3955" dependencies = [ "arrayvec 0.5.1", "bytes 0.5.6", "either", "fnv", - "futures 0.3.5", + "futures 0.3.6", "futures_codec", "libp2p-core", "libp2p-swarm", @@ -3434,15 +3398,15 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fe5614c2c5af74ef5870aad0fce73c9e4707716c4ee7cdf06cf9a0376d3815" +checksum = "3173b5a6b2f690c29ae07798d85b9441a131ac76ddae9015ef22905b623d0c69" dependencies = [ "async-std", "data-encoding", "dns-parser", "either", - "futures 0.3.5", + "futures 0.3.6", "lazy_static", "libp2p-core", "libp2p-swarm", @@ -3456,13 +3420,13 @@ dependencies = [ [[package]] name = "libp2p-mplex" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9e79541e71590846f773efce1b6d0538804992ee54ff2f407e05d63a9ddc23" +checksum = "8a73a799cc8410b36e40b8f4c4b6babbcb9efd3727111bf517876e4acfa612d3" dependencies = [ "bytes 0.5.6", "fnv", - "futures 0.3.5", + "futures 0.3.6", "futures_codec", "libp2p-core", "log", @@ -3472,13 +3436,13 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0beba6459d06153f5f8e23da3df1d2183798b1f457c7c9468ff99760bcbcc60b" +checksum = "6ef6c490042f549fb1025f2892dfe6083d97a77558f450c1feebe748ca9eb15a" dependencies = [ "bytes 0.5.6", "curve25519-dalek 2.1.0", - "futures 0.3.5", + "futures 0.3.6", "lazy_static", "libp2p-core", "log", @@ -3488,17 +3452,17 @@ dependencies = [ "sha2 0.8.2", "snow", "static_assertions 1.1.0", - "x25519-dalek", + "x25519-dalek 0.6.0", "zeroize", ] [[package]] name = "libp2p-ping" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670261ef938567b614746b078e049b03b55617538a8d415071c518f97532d043" +checksum = "ad063c21dfcea4518ac9e8bd4119d33a5b26c41e674f602f41f05617a368a5c8" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "libp2p-swarm", "log", @@ -3509,12 +3473,12 @@ dependencies = [ [[package]] name = "libp2p-plaintext" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a61dfd53d1264ddff1206e4827193efaa72bab27782dfcd63c0dec120a1875" +checksum = "903a12e99c72dbebefea258de887982adeacc7025baa1ceb10b7fa9928f54791" dependencies = [ "bytes 0.5.6", - "futures 0.3.5", + "futures 0.3.6", "futures_codec", "libp2p-core", "log", @@ -3531,7 +3495,7 @@ version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37d0db10e139d22d7af0b23ed7949449ec86262798aa0fd01595abdbcb02dc87" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "log", "pin-project", "rand 0.7.3", @@ -3541,58 +3505,32 @@ dependencies = [ [[package]] name = "libp2p-request-response" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4af0de0e56a11d46c5191a61019733b5618dc955c0a36f82866bb6d5d81a7f8f" +checksum = "9c0c9e8a4cd69d97e9646c54313d007512f411aba8c5226cfcda16df6a6e84a3" dependencies = [ "async-trait", - "futures 0.3.5", + "bytes 0.5.6", + "futures 0.3.6", "libp2p-core", "libp2p-swarm", "log", "lru 0.6.0", + "minicbor", "rand 0.7.3", "smallvec 1.4.2", + "unsigned-varint 0.5.1", "wasm-timer", ] -[[package]] -name = "libp2p-secio" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a04b320cc0394554e8d0adca21f4efd9f8c2da4930211d92e411a19a4dfd769e" -dependencies = [ - "aes-ctr", - "ctr", - "futures 0.3.5", - "hmac", - "js-sys", - "lazy_static", - "libp2p-core", - "log", - "parity-send-wrapper", - "pin-project", - "prost", - "prost-build", - "quicksink", - "rand 0.7.3", - "ring", - "rw-stream-sink", - "sha2 0.8.2", - "static_assertions 1.1.0", - "twofish", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "libp2p-swarm" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e4a7e64156e9d1a2daae36b5d791f057b9c53c9364a8e75f7f9848b54f9d68" +checksum = "7193e444210132237b81b755ec7fe53f1c4bd2f53cf719729b94c0c72eb6eaa1" dependencies = [ - "futures 0.3.5", + "either", + "futures 0.3.6", "libp2p-core", "log", "rand 0.7.3", @@ -3603,12 +3541,12 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f65400ccfbbf9a356733bceca6c519c9db0deb5fbcc0b81f89837c4cd53997" +checksum = "44f42ec130d7a37a7e47bf4398026b7ad9185c08ed26972e2720f8b94112796f" dependencies = [ "async-std", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "get_if_addrs", "ipnet", @@ -3619,23 +3557,23 @@ dependencies = [ [[package]] name = "libp2p-uds" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95bc8b0ca1dda4cccb1bb156d47a32e45cfa447ef18f737209f014a63f94a4a2" +checksum = "dea7acb0a034f70d7db94c300eba3f65c0f6298820105624088a9609c9974d77" dependencies = [ "async-std", - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "log", ] [[package]] name = "libp2p-wasm-ext" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2f7b06d80d036ac5763a811185b7fe6951ad71c00544b17cc378a9069bb7c2" +checksum = "34c1faac6f92c21fbe155417957863ea822fba9e9fd5eb24c0912336a100e63f" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -3645,13 +3583,13 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b350db65cf0a7c83a539a596ea261caae1552c0df2245df0f916ed2fd04572" +checksum = "d650534ebd99f48f6fa292ed5db10d30df2444943afde4407ceeddab8e513fca" dependencies = [ "async-tls", "either", - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "log", "quicksink", @@ -3665,13 +3603,13 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.21.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3969ead4ce530efb6f304623924245caf410f3b0b0139bd7007f205933788aa" +checksum = "781d9b9f043dcdabc40640807125368596b849fd4d96cdca2dcf052fdf6f33fd" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", - "parking_lot 0.10.2", + "parking_lot 0.11.0", "thiserror", "yamux", ] @@ -3774,7 +3712,7 @@ version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -3893,7 +3831,7 @@ dependencies = [ "keccak-hash", "rand 0.7.3", "rlp 0.4.4", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "uuid", ] @@ -3909,11 +3847,31 @@ dependencies = [ "zeroize", ] +[[package]] +name = "minicbor" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc03ad6f8f548db7194a5ff5a6f96342ecae4e3ef67d2bf18bacc0e245cd041" +dependencies = [ + "minicbor-derive", +] + +[[package]] +name = "minicbor-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c214bf3d90099b52f3e4b328ae0fe34837fd0fab683ad1e10fceb4629106df48" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "miniz_oxide" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9" +checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" dependencies = [ "adler", "autocfg 1.0.1", @@ -3925,7 +3883,7 @@ version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "fuchsia-zircon", "fuchsia-zircon-sys", "iovec", @@ -4029,7 +3987,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9157e87afbc2ef0d84cc0345423d715f445edde00141c93721c162de35a05e5" dependencies = [ "bytes 0.5.6", - "futures 0.3.5", + "futures 0.3.6", "log", "pin-project", "smallvec 1.4.2", @@ -4064,9 +4022,9 @@ dependencies = [ [[package]] name = "nb-connect" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e847c76b390f44529c2071ef06d0b52fbb4bdb04cc8987a5cfa63954c000abca" +checksum = "8123a81538e457d44b933a02faf885d3fe8408806b23fa700e8f01c6c3a98998" dependencies = [ "libc", "winapi 0.3.9", @@ -4078,7 +4036,7 @@ version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "winapi 0.3.9", ] @@ -4091,7 +4049,7 @@ checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" dependencies = [ "bitflags", "cc", - "cfg-if", + "cfg-if 0.1.10", "libc", "void", ] @@ -4112,7 +4070,7 @@ dependencies = [ "darwinia-staking-rpc", "darwinia-staking-rpc-runtime-api", "frame-system-rpc-runtime-api", - "futures 0.3.5", + "futures 0.3.6", "jsonrpc-core", "jsonrpc-pubsub", "log", @@ -4217,7 +4175,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-transaction-pool", "sp-version", "static_assertions 1.1.0", @@ -4326,6 +4284,12 @@ dependencies = [ "wasmparser 0.57.0", ] +[[package]] +name = "object" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37fd5004feb2ce328a52b0b3d01dbf4ffff72583493900ed15f22d4111c51693" + [[package]] name = "once_cell" version = "0.1.8" @@ -4379,8 +4343,8 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", @@ -4390,13 +4354,13 @@ dependencies = [ "sp-application-crypto", "sp-authority-discovery", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-authorship" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", @@ -4405,13 +4369,13 @@ dependencies = [ "sp-authorship", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-babe" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-benchmarking", "frame-support", @@ -4429,14 +4393,14 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-timestamp", ] [[package]] name = "pallet-balances" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-benchmarking", "frame-support", @@ -4444,13 +4408,13 @@ dependencies = [ "parity-scale-codec", "serde", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-collective" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", @@ -4459,13 +4423,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-finality-tracker" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", @@ -4475,13 +4439,13 @@ dependencies = [ "sp-finality-tracker", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-grandpa" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-benchmarking", "frame-support", @@ -4497,13 +4461,13 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-im-online" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", @@ -4516,13 +4480,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-membership" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", @@ -4530,13 +4494,13 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-offences" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", @@ -4545,26 +4509,26 @@ dependencies = [ "serde", "sp-runtime", "sp-staking", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-randomness-collective-flip" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "safe-mix", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-scheduler" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-benchmarking", "frame-support", @@ -4573,13 +4537,13 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-session" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", @@ -4592,14 +4556,14 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-trie", ] [[package]] name = "pallet-sudo" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", @@ -4607,13 +4571,13 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-timestamp" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-benchmarking", "frame-support", @@ -4623,14 +4587,14 @@ dependencies = [ "serde", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-timestamp", ] [[package]] name = "pallet-transaction-payment" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "frame-system", @@ -4641,13 +4605,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "pallet-transaction-payment-rpc" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4664,15 +4628,15 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-support", "parity-scale-codec", "serde", "sp-api", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] @@ -4745,7 +4709,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e57fea504fea33f9fbb5f49f378359030e7e026a6ab849bb9e8f0787376f1bf" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "libc", "log", "mio-named-pipes", @@ -4763,7 +4727,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "297ff91fa36aec49ce183484b102f6b75b46776822bd81525bfc4cc9b0dd0f5c" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "hashbrown 0.8.2", "impl-trait-for-tuples", "parity-util-mem-derive", @@ -4790,6 +4754,24 @@ version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" +[[package]] +name = "parity-ws" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e02a625dd75084c2a7024f07c575b61b782f729d18702dabb3cdbf31911dc61" +dependencies = [ + "byteorder 1.3.4", + "bytes 0.4.12", + "httparse", + "log", + "mio", + "mio-extras", + "rand 0.7.3", + "sha-1 0.8.2", + "slab", + "url 2.1.1", +] + [[package]] name = "parking" version = "2.0.0" @@ -4857,7 +4839,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi 0.0.3", "libc", "redox_syscall", @@ -4872,7 +4854,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi 0.0.3", "libc", "redox_syscall", @@ -4886,7 +4868,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi 0.1.0", "instant", "libc", @@ -4961,18 +4943,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.23" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" +checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "0.4.23" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" +checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" dependencies = [ "proc-macro2", "quote", @@ -4981,9 +4963,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.1.7" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" +checksum = "e555d9e657502182ac97b539fb3dae8b79cda19e3e4f8ffb5e8de4f18df93c95" [[package]] name = "pin-utils" @@ -5017,33 +4999,33 @@ dependencies = [ [[package]] name = "polling" -version = "1.1.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0720e0b9ea9d52451cf29d3413ba8a9303f8815d9d9653ef70e03ff73e65566" +checksum = "ab773feb154f12c49ffcfd66ab8bdcf9a1843f950db48b0d8be9d4393783b058" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "log", - "wepoll-sys-stjepang", + "wepoll-sys", "winapi 0.3.9", ] [[package]] name = "poly1305" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b42192ab143ed7619bf888a7f9c6733a9a2153b218e2cd557cfdb52fbf9bb1" +checksum = "22ce46de8e53ee414ca4d02bfefac75d8c12fba948b76622a40b4be34dfce980" dependencies = [ "universal-hash", ] [[package]] name = "polyval" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9a50142b55ab3ed0e9f68dfb3709f1d90d29da24e91033f28b96330643107dc" +checksum = "a5884790f1ce3553ad55fec37b5aaac5882e0e845a2612df744d6c85c9bf046c" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "universal-hash", ] @@ -5124,23 +5106,24 @@ checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" [[package]] name = "proc-macro2" -version = "1.0.21" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e28516df94f3dd551a587da5357459d9b36d945a7c37c3557928c1c2ff2a2c" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ "unicode-xid", ] [[package]] name = "prometheus" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0ced56dee39a6e960c15c74dc48849d614586db2eaada6497477af7c7811cd" +checksum = "30d70cf4412832bcac9cffe27906f4a66e450d323525e977168c70d1b36120ae" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "fnv", "lazy_static", - "spin", + "parking_lot 0.11.0", + "regex", "thiserror", ] @@ -5299,7 +5282,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.15", "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", @@ -5348,7 +5331,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.15", ] [[package]] @@ -5450,9 +5433,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd016f0c045ad38b5251be2c9c0ab806917f82da4d36b2a327e5166adad9270" +checksum = "dcf6960dc9a5b4ee8d3e4c5787b4a112a8818e0290a42ff664ad60692fdf2032" dependencies = [ "autocfg 1.0.1", "crossbeam-deque", @@ -5494,7 +5477,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" dependencies = [ - "getrandom", + "getrandom 0.1.15", "redox_syscall", "rust-argon2", ] @@ -5532,9 +5515,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.3.9" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +checksum = "36f45b719a674bf4b828ff318906d6c133264c793eff7a41e30074a45b5099e2" dependencies = [ "aho-corasick", "memchr", @@ -5554,9 +5537,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.18" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" +checksum = "c17be88d9eaa858870aa5e48cc406c206e4600e983fc4f06bbe5750d93d09761" [[package]] name = "region" @@ -5579,27 +5562,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rental" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f" -dependencies = [ - "rental-impl", - "stable_deref_trait", -] - -[[package]] -name = "rental-impl" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475e68978dc5b743f2f40d8e0a8fdc83f1c5e78cbf4b8fa5e74e73beebc340de" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "retain_mut" version = "0.1.1" @@ -5631,9 +5593,9 @@ dependencies = [ [[package]] name = "rlp" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a7d3f9bed94764eac15b8f14af59fac420c236adaff743b7bcc88e265cb4345" +checksum = "1190dcc8c3a512f1eef5d09bb8c84c7f39e1054e174d1795482e18f5272f2e73" dependencies = [ "rustc-hex", ] @@ -5682,9 +5644,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +checksum = "b2610b7f643d18c87dff3b489950269617e6601a51f1f05aa5daefee36f64f0b" [[package]] name = "rustc-hash" @@ -5738,7 +5700,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "pin-project", "static_assertions 1.1.0", ] @@ -5789,10 +5751,10 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log", "parity-scale-codec", @@ -5813,8 +5775,8 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -5830,8 +5792,8 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -5847,8 +5809,8 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5858,17 +5820,16 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "ansi_term 0.12.1", "atty", "bip39", "chrono", "derive_more", - "env_logger", "fdlimit", - "futures 0.3.5", + "futures 0.3.6", "hex", "lazy_static", "libp2p", @@ -5901,16 +5862,19 @@ dependencies = [ "substrate-prometheus-endpoint", "time", "tokio 0.2.22", + "tracing", + "tracing-log", + "tracing-subscriber", ] [[package]] name = "sc-client-api" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", "fnv", - "futures 0.3.5", + "futures 0.3.6", "hash-db", "hex-literal", "kvdb", @@ -5930,7 +5894,7 @@ dependencies = [ "sp-keyring", "sp-runtime", "sp-state-machine", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-storage", "sp-transaction-pool", "sp-trie", @@ -5941,8 +5905,8 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "blake2-rfc", "hash-db", @@ -5971,8 +5935,8 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "sc-client-api", "sp-blockchain", @@ -5982,12 +5946,12 @@ dependencies = [ [[package]] name = "sc-consensus-babe" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", "fork-tree", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log", "merlin", @@ -6026,11 +5990,11 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", - "futures 0.3.5", + "futures 0.3.6", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -6050,8 +6014,8 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "fork-tree", "parity-scale-codec", @@ -6063,10 +6027,10 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log", "parity-scale-codec", @@ -6086,8 +6050,8 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "log", "sc-client-api", @@ -6100,8 +6064,8 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", "lazy_static", @@ -6128,8 +6092,8 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", "log", @@ -6145,8 +6109,8 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "log", "parity-scale-codec", @@ -6160,8 +6124,8 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "log", "parity-scale-codec", @@ -6178,13 +6142,13 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", "finality-grandpa", "fork-tree", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log", "parity-scale-codec", @@ -6215,33 +6179,35 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", "finality-grandpa", - "futures 0.3.5", + "futures 0.3.6", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "jsonrpc-pubsub", "log", "parity-scale-codec", + "sc-client-api", "sc-finality-grandpa", "sc-rpc", "serde", "serde_json", + "sp-blockchain", "sp-core", "sp-runtime", ] [[package]] name = "sc-informant" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "ansi_term 0.12.1", - "futures 0.3.5", + "futures 0.3.6", "log", "parity-util-mem", "sc-client-api", @@ -6255,8 +6221,8 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", "hex", @@ -6271,8 +6237,8 @@ dependencies = [ [[package]] name = "sc-light" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "hash-db", "lazy_static", @@ -6290,10 +6256,11 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "async-std", + "async-trait", "bitflags", "bs58", "bytes 0.5.6", @@ -6302,7 +6269,7 @@ dependencies = [ "erased-serde", "fnv", "fork-tree", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "futures_codec", "hex", @@ -6343,10 +6310,10 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "libp2p", "log", @@ -6358,12 +6325,12 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "bytes 0.5.6", "fnv", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "hyper 0.13.8", "hyper-rustls", @@ -6385,10 +6352,10 @@ dependencies = [ [[package]] name = "sc-peerset" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "libp2p", "log", "serde_json", @@ -6398,8 +6365,8 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -6407,10 +6374,10 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", @@ -6439,11 +6406,11 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", - "futures 0.3.5", + "futures 0.3.6", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -6463,9 +6430,10 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ + "futures 0.1.30", "jsonrpc-core", "jsonrpc-http-server", "jsonrpc-ipc-server", @@ -6475,18 +6443,19 @@ dependencies = [ "serde", "serde_json", "sp-runtime", + "substrate-prometheus-endpoint", ] [[package]] name = "sc-service" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", "directories", "exit-future", - "futures 0.1.29", - "futures 0.3.5", + "futures 0.1.30", + "futures 0.3.6", "futures-timer 3.0.2", "hash-db", "jsonrpc-core", @@ -6528,6 +6497,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-state-machine", + "sp-tracing", "sp-transaction-pool", "sp-trie", "sp-utils", @@ -6540,8 +6510,8 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "log", "parity-scale-codec", @@ -6554,10 +6524,10 @@ dependencies = [ [[package]] name = "sc-telemetry" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "libp2p", "log", @@ -6575,8 +6545,8 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "erased-serde", "log", @@ -6588,16 +6558,17 @@ dependencies = [ "slog", "sp-tracing", "tracing", + "tracing-core", "tracing-subscriber", ] [[package]] name = "sc-transaction-graph" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", - "futures 0.3.5", + "futures 0.3.6", "linked-hash-map", "log", "parity-util-mem", @@ -6614,11 +6585,11 @@ dependencies = [ [[package]] name = "sc-transaction-pool" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", - "futures 0.3.5", + "futures 0.3.6", "futures-diagnose", "intervalier", "log", @@ -6657,7 +6628,7 @@ dependencies = [ "arrayref", "arrayvec 0.5.1", "curve25519-dalek 2.1.0", - "getrandom", + "getrandom 0.1.15", "merlin", "rand 0.7.3", "rand_core 0.5.1", @@ -6686,18 +6657,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scroll" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb2332cb595d33f7edd5700f4cbf94892e680c7f0ae56adab58a35190b66cb1" +checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" dependencies = [ "scroll_derive", ] [[package]] name = "scroll_derive" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e367622f934864ffa1c704ba2b82280aab856e3d8213c84c5720257eb34b15b9" +checksum = "6dfde5d1531034db129e95c76ac857e2baecea3443579d493d02224950b0fb6d" dependencies = [ "proc-macro2", "quote", @@ -6793,9 +6764,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" +checksum = "a230ea9107ca2220eea9d46de97eddcb04cd00e92d13dda78e478dd33fa82bd4" dependencies = [ "itoa", "ryu", @@ -6821,7 +6792,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a36ea86c864a3f16dd2687712dd6646f7019f301e57537c7f4dc9f5916770" dependencies = [ "block-buffer 0.9.0", - "cfg-if", + "cfg-if 0.1.10", "cpuid-bool", "digest 0.9.0", "opaque-debug 0.3.0", @@ -6846,7 +6817,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2933378ddfeda7ea26f48c555bdad8bb446bf8a3d17832dc83e380d444cfb8c1" dependencies = [ "block-buffer 0.9.0", - "cfg-if", + "cfg-if 0.1.10", "cpuid-bool", "digest 0.9.0", "opaque-debug 0.3.0", @@ -6975,9 +6946,9 @@ checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" [[package]] name = "snow" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32bf8474159a95551661246cda4976e89356999e3cbfef36f493dacc3fae1e8e" +checksum = "795dd7aeeee24468e5a32661f6d27f7b5cbed802031b2d7640c7b10f8fb2dd50" dependencies = [ "aes-gcm", "blake2", @@ -6988,7 +6959,7 @@ dependencies = [ "rustc_version", "sha2 0.9.1", "subtle 2.3.0", - "x25519-dalek", + "x25519-dalek 1.1.0", ] [[package]] @@ -6997,7 +6968,7 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "redox_syscall", "winapi 0.3.9", @@ -7012,7 +6983,7 @@ dependencies = [ "base64 0.12.3", "bytes 0.5.6", "flate2", - "futures 0.3.5", + "futures 0.3.6", "httparse", "log", "rand 0.7.3", @@ -7021,20 +6992,20 @@ dependencies = [ [[package]] name = "sp-allocator" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", "log", "sp-core", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-wasm-interface", ] [[package]] name = "sp-api" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "hash-db", "parity-scale-codec", @@ -7042,14 +7013,14 @@ dependencies = [ "sp-core", "sp-runtime", "sp-state-machine", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-version", ] [[package]] name = "sp-api-proc-macro" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "blake2-rfc", "proc-macro-crate", @@ -7060,68 +7031,68 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "serde", "sp-core", "sp-io", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-arithmetic" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "integer-sqrt", "num-traits", "parity-scale-codec", "serde", "sp-debug-derive", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-authority-discovery" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "sp-api", "sp-application-crypto", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-authorship" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-block-builder" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "sp-api", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-blockchain" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", "log", @@ -7137,8 +7108,8 @@ dependencies = [ [[package]] name = "sp-chain-spec" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "serde", "serde_json", @@ -7146,11 +7117,11 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "libp2p", "log", @@ -7162,7 +7133,7 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-trie", "sp-utils", "sp-version", @@ -7172,8 +7143,8 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "merlin", "parity-scale-codec", @@ -7185,14 +7156,14 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-timestamp", ] [[package]] name = "sp-consensus-slots" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -7200,20 +7171,20 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "schnorrkel", "sp-core", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-core" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "base58", "blake2-rfc", @@ -7221,7 +7192,7 @@ dependencies = [ "derive_more", "dyn-clonable", "ed25519-dalek", - "futures 0.3.5", + "futures 0.3.6", "hash-db", "hash256-std-hasher", "hex", @@ -7244,7 +7215,7 @@ dependencies = [ "sp-debug-derive", "sp-externalities", "sp-runtime-interface", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-storage", "substrate-bip39", "tiny-bip39", @@ -7256,8 +7227,8 @@ dependencies = [ [[package]] name = "sp-database" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "kvdb", "parking_lot 0.10.2", @@ -7265,8 +7236,8 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "proc-macro2", "quote", @@ -7275,19 +7246,19 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "environmental", "parity-scale-codec", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-storage", ] [[package]] name = "sp-finality-grandpa" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "finality-grandpa", "log", @@ -7297,37 +7268,37 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-finality-tracker" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "sp-inherents", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-inherents" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", "parity-scale-codec", "parking_lot 0.10.2", "sp-core", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-io" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "hash-db", "libsecp256k1", "log", @@ -7337,16 +7308,18 @@ dependencies = [ "sp-externalities", "sp-runtime-interface", "sp-state-machine", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-tracing", "sp-trie", "sp-wasm-interface", + "tracing", + "tracing-core", ] [[package]] name = "sp-keyring" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "lazy_static", "sp-core", @@ -7356,20 +7329,20 @@ dependencies = [ [[package]] name = "sp-npos-elections" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "serde", "sp-arithmetic", "sp-npos-elections-compact", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-npos-elections-compact" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7379,8 +7352,8 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "sp-api", "sp-core", @@ -7389,8 +7362,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "backtrace", "log", @@ -7398,8 +7371,8 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "serde", "sp-core", @@ -7407,8 +7380,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "either", "hash256-std-hasher", @@ -7424,19 +7397,19 @@ dependencies = [ "sp-core", "sp-inherents", "sp-io", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-runtime-interface" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "primitive-types 0.7.2", "sp-externalities", "sp-runtime-interface-proc-macro", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "sp-storage", "sp-tracing", "sp-wasm-interface", @@ -7445,8 +7418,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "Inflector", "proc-macro-crate", @@ -7457,8 +7430,8 @@ dependencies = [ [[package]] name = "sp-serializer" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "serde", "serde_json", @@ -7466,34 +7439,33 @@ dependencies = [ [[package]] name = "sp-session" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "sp-api", "sp-core", "sp-runtime", "sp-staking", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-staking" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "parity-scale-codec", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-state-machine" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "hash-db", - "itertools 0.9.0", "log", "num-traits", "parity-scale-codec", @@ -7503,6 +7475,7 @@ dependencies = [ "sp-core", "sp-externalities", "sp-panic-handler", + "sp-std 2.0.0", "sp-trie", "trie-db", "trie-root", @@ -7515,53 +7488,56 @@ source = "git+https://github.com/darwinia-network/substrate.git?branch=darwinia- [[package]] name = "sp-std" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" [[package]] name = "sp-storage" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "impl-serde 0.3.1", "parity-scale-codec", "ref-cast", "serde", "sp-debug-derive", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-timestamp" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "sp-api", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "wasm-timer", ] [[package]] name = "sp-tracing" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "log", - "rental", + "parity-scale-codec", + "sp-std 2.0.0", "tracing", + "tracing-core", + "tracing-subscriber", ] [[package]] name = "sp-transaction-pool" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "derive_more", - "futures 0.3.5", + "futures 0.3.6", "log", "parity-scale-codec", "serde", @@ -7572,24 +7548,24 @@ dependencies = [ [[package]] name = "sp-trie" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "hash-db", "memory-db", "parity-scale-codec", "sp-core", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "trie-db", "trie-root", ] [[package]] name = "sp-utils" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-core", "futures-timer 3.0.2", "lazy_static", @@ -7598,24 +7574,24 @@ dependencies = [ [[package]] name = "sp-version" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "impl-serde 0.3.1", "parity-scale-codec", "serde", "sp-runtime", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", ] [[package]] name = "sp-wasm-interface" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", - "sp-std 2.0.0-rc6", + "sp-std 2.0.0", "wasmi", ] @@ -7663,10 +7639,11 @@ dependencies = [ [[package]] name = "stream-cipher" -version = "0.4.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f8ed9974042b8c3672ff3030a69fcc03b74c47c3d1ecb7755e8a3626011e88" +checksum = "c80e15f898d8d8f25db24c253ea615cc14acf418ff307822995814e7d42cfa89" dependencies = [ + "block-cipher", "generic-array 0.14.4", ] @@ -7687,9 +7664,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "structopt" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33f6461027d7f08a13715659b2948e1602c31a3756aeae9378bfe7518c72e82" +checksum = "a7a7159e7d0dbcab6f9c980d7971ef50f3ff5753081461eeda120d5974a4ee95" dependencies = [ "clap", "lazy_static", @@ -7698,9 +7675,9 @@ dependencies = [ [[package]] name = "structopt-derive" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92e775028122a4b3dd55d58f14fc5120289c69bee99df1d117ae30f84b225c9" +checksum = "8fc47de4dfba76248d1e9169ccff240eea2a4dc1e34e309b95b2393109b4b383" dependencies = [ "heck", "proc-macro-error", @@ -7745,8 +7722,8 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "platforms", ] @@ -7762,11 +7739,11 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.5", + "futures 0.3.6", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -7785,8 +7762,8 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "async-std", "derive_more", @@ -7799,18 +7776,18 @@ dependencies = [ [[package]] name = "substrate-test-utils" -version = "2.0.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "2.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "substrate-test-utils-derive", "tokio 0.2.22", ] [[package]] name = "substrate-test-utils-derive" -version = "0.8.0-rc6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +version = "0.8.0" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" dependencies = [ "proc-macro-crate", "quote", @@ -7820,7 +7797,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder-runner" version = "1.0.6" -source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" +source = "git+https://github.com/darwinia-network/substrate.git?branch=common-library#a200cdb93c6af5763b9c7bf313fa708764ac88ca" [[package]] name = "subtle" @@ -7836,9 +7813,9 @@ checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd" [[package]] name = "syn" -version = "1.0.41" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6690e3e9f692504b941dc6c3b188fd28df054f7fb8469ab40680df52fdcc842b" +checksum = "e03e57e4fcbfe7749842d53e24ccb9aa12b7252dbe5e91d2acad31834c8b8fdd" dependencies = [ "proc-macro2", "quote", @@ -7875,7 +7852,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "rand 0.7.3", "redox_syscall", @@ -7903,18 +7880,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" +checksum = "318234ffa22e0920fe9a40d7b8369b5f649d490980cf7aadcf1eb91594869b42" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" +checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab" dependencies = [ "proc-macro2", "quote", @@ -8007,7 +7984,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "mio", "num_cpus", "tokio-codec", @@ -8055,7 +8032,7 @@ checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" dependencies = [ "bytes 0.4.12", "either", - "futures 0.1.29", + "futures 0.1.30", ] [[package]] @@ -8065,7 +8042,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "tokio-io", ] @@ -8075,7 +8052,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "tokio-executor 0.1.10", ] @@ -8086,7 +8063,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" dependencies = [ "crossbeam-utils", - "futures 0.1.29", + "futures 0.1.30", ] [[package]] @@ -8106,7 +8083,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "tokio-io", "tokio-threadpool", ] @@ -8118,7 +8095,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "log", ] @@ -8140,7 +8117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d282d483052288b2308ba5ee795f5673b159c9bdf63c385a05609da782a5eae" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "mio", "mio-named-pipes", "tokio 0.1.22", @@ -8153,7 +8130,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" dependencies = [ "crossbeam-utils", - "futures 0.1.29", + "futures 0.1.30", "lazy_static", "log", "mio", @@ -8183,7 +8160,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", ] [[package]] @@ -8193,7 +8170,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" dependencies = [ "fnv", - "futures 0.1.29", + "futures 0.1.30", ] [[package]] @@ -8214,7 +8191,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "iovec", "mio", "tokio-io", @@ -8230,7 +8207,7 @@ dependencies = [ "crossbeam-deque", "crossbeam-queue", "crossbeam-utils", - "futures 0.1.29", + "futures 0.1.30", "lazy_static", "log", "num_cpus", @@ -8245,7 +8222,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" dependencies = [ "crossbeam-utils", - "futures 0.1.29", + "futures 0.1.30", "slab", "tokio-executor 0.1.10", ] @@ -8257,7 +8234,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "log", "mio", "tokio-codec", @@ -8272,7 +8249,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "iovec", "libc", "log", @@ -8299,9 +8276,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" +checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" dependencies = [ "serde", ] @@ -8314,12 +8291,13 @@ checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" [[package]] name = "tracing" -version = "0.1.19" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d79ca061b032d6ce30c660fded31189ca0b9922bf483cd70759f13a2d86786c" +checksum = "b0987850db3733619253fe60e17cb59b82d37c7e6c0236bb81e4d6b87c879f27" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "log", + "pin-project-lite", "tracing-attributes", "tracing-core", ] @@ -8337,9 +8315,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bcf46c1f1f06aeea2d6b81f3c863d0930a596c86ad1920d4e5bad6dd1d7119a" +checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" dependencies = [ "lazy_static", ] @@ -8367,9 +8345,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82bb5079aa76438620837198db8a5c529fb9878c730bc2b28179b0241cf04c10" +checksum = "4ef0a5e15477aa303afbfac3a44cba9b6430fdaad52423b1e6c0dbbe28c3eedd" dependencies = [ "ansi_term 0.12.1", "chrono", @@ -8381,6 +8359,7 @@ dependencies = [ "sharded-slab", "smallvec 1.4.2", "thread_local", + "tracing", "tracing-core", "tracing-log", "tracing-serde", @@ -8423,17 +8402,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" -[[package]] -name = "twofish" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712d261e83e727c8e2dbb75dacac67c36e35db36a958ee504f2164fc052434e1" -dependencies = [ - "block-cipher-trait", - "byteorder 1.3.4", - "opaque-debug 0.2.3", -] - [[package]] name = "twox-hash" version = "1.5.0" @@ -8556,6 +8524,10 @@ name = "unsigned-varint" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35" +dependencies = [ + "futures-io", + "futures-util", +] [[package]] name = "untrusted" @@ -8648,7 +8620,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "log", "try-lock", ] @@ -8681,7 +8653,7 @@ version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "wasm-bindgen-macro", ] @@ -8706,7 +8678,7 @@ version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7866cab0aa01de1edf8b5d7936938a7e397ee50ce24119aef3e1eaa3b6171da" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "js-sys", "wasm-bindgen", "web-sys", @@ -8747,7 +8719,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "js-sys", "parking_lot 0.11.0", "pin-utils", @@ -8799,7 +8771,7 @@ checksum = "1cd3c4f449382779ef6e0a7c3ec6752ae614e20a42e4100000c3efdc973100e2" dependencies = [ "anyhow", "backtrace", - "cfg-if", + "cfg-if 0.1.10", "lazy_static", "libc", "log", @@ -8841,7 +8813,7 @@ dependencies = [ "anyhow", "base64 0.12.3", "bincode", - "cfg-if", + "cfg-if 0.1.10", "cranelift-codegen", "cranelift-entity", "cranelift-frontend", @@ -8870,7 +8842,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e914c013c7a9f15f4e429d5431f2830fb8adb56e40567661b69c5ec1d645be23" dependencies = [ "anyhow", - "cfg-if", + "cfg-if 0.1.10", "cranelift-codegen", "cranelift-entity", "cranelift-frontend", @@ -8913,7 +8885,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e8d4d1af8dd5f7096cfcc89dd668d358e52980c38cce199643372ffd6590e27" dependencies = [ "anyhow", - "cfg-if", + "cfg-if 0.1.10", "gimli 0.21.0", "lazy_static", "libc", @@ -8933,7 +8905,7 @@ checksum = "3a25f140bbbaadb07c531cba99ce1a966dba216138dc1b2a0ddecec851a01a93" dependencies = [ "backtrace", "cc", - "cfg-if", + "cfg-if 0.1.10", "indexmap", "lazy_static", "libc", @@ -8948,18 +8920,18 @@ dependencies = [ [[package]] name = "wast" -version = "24.0.0" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff1e3bd3ad0b2ee7784add89c30dc96b89a54b43e5d6d95d774eda1863b3500" +checksum = "000df4e05cdb4cbc1d0bb1e7e5ea86adb3f1295850c9effb9a47b1086a346895" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c0bb2872ae453f98cec6ff1bf1a71cde1da6041fce8b0ac39d51eb033e9ec0" +checksum = "4766d466249e23279e92c52033429eb91141c5efea1c4478138fa6f6ef4efe3e" dependencies = [ "wast", ] @@ -9003,10 +8975,10 @@ dependencies = [ ] [[package]] -name = "wepoll-sys-stjepang" -version = "1.0.8" +name = "wepoll-sys" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fdfbb03f290ca0b27922e8d48a0997b4ceea12df33269b9f75e713311eb178d" +checksum = "142bc2cba3fe88be1a8fcb55c727fa4cd5b0cf2d7438722792e22f26f04bc1e0" dependencies = [ "cc", ] @@ -9063,24 +9035,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "ws" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a2c47b5798ccc774ffb93ff536aec7c4275d722fd9c740c83cdd1af1f2d94" -dependencies = [ - "byteorder 1.3.4", - "bytes 0.4.12", - "httparse", - "log", - "mio", - "mio-extras", - "rand 0.7.3", - "sha-1 0.8.2", - "slab", - "url 2.1.1", -] - [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -9102,16 +9056,27 @@ dependencies = [ "zeroize", ] +[[package]] +name = "x25519-dalek" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc614d95359fd7afc321b66d2107ede58b246b844cf5d8a0adcca413e439f088" +dependencies = [ + "curve25519-dalek 3.0.0", + "rand_core 0.5.1", + "zeroize", +] + [[package]] name = "yamux" -version = "0.4.9" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053585b18bca1a3d00e4b5ef93e72d4f49a10005374c455db7177e27149c899d" +checksum = "9aeb8c4043cac71c3c299dff107171c220d179492350ea198e109a414981b83c" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "log", "nohash-hasher", - "parking_lot 0.10.2", + "parking_lot 0.11.0", "rand 0.7.3", "static_assertions 1.1.0", ]