,
/// Transaction pool instance.
pub pool: Arc,
/// The SelectChain Strategy
pub select_chain: SC,
+ /// A copy of the chain spec.
+ pub chain_spec: Box,
/// Whether to deny unsafe calls
pub deny_unsafe: DenyUnsafe,
/// BABE specific dependencies.
pub babe: BabeDeps,
/// GRANDPA specific dependencies.
- pub grandpa: GrandpaDeps,
+ pub grandpa: GrandpaDeps,
}
/// A IO handler that uses all Full RPC extensions.
pub type IoHandler = jsonrpc_core::IoHandler;
/// Instantiate all Full RPC extensions.
-pub fn create_full(
- deps: FullDeps,
+pub fn create_full(
+ deps: FullDeps,
) -> jsonrpc_core::IoHandler where
- C: ProvideRuntimeApi,
- C: HeaderBackend + HeaderMetadata + 'static,
- C: Send + Sync + 'static,
+ C: ProvideRuntimeApi + HeaderBackend + AuxStore +
+ HeaderMetadata + Sync + Send + 'static,
C::Api: substrate_frame_rpc_system::AccountNonceApi,
C::Api: pallet_contracts_rpc::ContractsRuntimeApi,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi,
@@ -115,6 +121,8 @@ pub fn create_full(
C::Api: BlockBuilder,
P: TransactionPool + 'static,
SC: SelectChain +'static,
+ B: sc_client_api::Backend + Send + Sync + 'static,
+ B::State: sc_client_api::backend::StateBackend>,
{
use substrate_frame_rpc_system::{FullSystem, SystemApi};
use pallet_contracts_rpc::{Contracts, ContractsApi};
@@ -125,6 +133,7 @@ pub fn create_full(
client,
pool,
select_chain,
+ chain_spec,
deny_unsafe,
babe,
grandpa,
@@ -140,6 +149,7 @@ pub fn create_full(
shared_authority_set,
justification_stream,
subscription_executor,
+ finality_provider,
} = grandpa;
io.extend_with(
@@ -157,8 +167,8 @@ pub fn create_full(
io.extend_with(
sc_consensus_babe_rpc::BabeApi::to_delegate(
BabeRpcHandler::new(
- client,
- shared_epoch_changes,
+ client.clone(),
+ shared_epoch_changes.clone(),
keystore,
babe_config,
select_chain,
@@ -169,10 +179,23 @@ pub fn create_full(
io.extend_with(
sc_finality_grandpa_rpc::GrandpaApi::to_delegate(
GrandpaRpcHandler::new(
- shared_authority_set,
+ shared_authority_set.clone(),
shared_voter_state,
justification_stream,
subscription_executor,
+ finality_provider,
+ )
+ )
+ );
+
+ io.extend_with(
+ sc_sync_state_rpc::SyncStateRpcApi::to_delegate(
+ sc_sync_state_rpc::SyncStateRpcHandler::new(
+ chain_spec,
+ client,
+ shared_authority_set,
+ shared_epoch_changes,
+ deny_unsafe,
)
)
);
diff --git a/bin/node/runtime/Cargo.toml b/bin/node/runtime/Cargo.toml
index 1195456b0fadadcec4ea4b9debb1f19529ce856e..6142998ac063c53e39d3c4a1fa2c32eb8a4f17dc 100644
--- a/bin/node/runtime/Cargo.toml
+++ b/bin/node/runtime/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-runtime"
-version = "2.0.0-rc6"
+version = "2.0.0"
authors = ["Parity Technologies "]
edition = "2018"
build = "build.rs"
@@ -21,73 +21,74 @@ static_assertions = "1.1.0"
hex-literal = { version = "0.3.1", optional = true }
# primitives
-sp-authority-discovery = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/authority-discovery" }
-sp-consensus-babe = { version = "0.8.0-rc6", default-features = false, path = "../../../primitives/consensus/babe" }
-sp-block-builder = { path = "../../../primitives/block-builder", default-features = false, version = "2.0.0-rc6"}
-sp-inherents = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/inherents" }
-node-primitives = { version = "2.0.0-rc6", default-features = false, path = "../primitives" }
-sp-offchain = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/offchain" }
-sp-core = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/core" }
-sp-std = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/std" }
-sp-api = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/api" }
-sp-runtime = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/runtime" }
-sp-staking = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/staking" }
-sp-keyring = { version = "2.0.0-rc6", optional = true, path = "../../../primitives/keyring" }
-sp-session = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/session" }
-sp-transaction-pool = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/transaction-pool" }
-sp-version = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/version" }
+sp-authority-discovery = { version = "2.0.0", default-features = false, path = "../../../primitives/authority-discovery" }
+sp-consensus-babe = { version = "0.8.0", default-features = false, path = "../../../primitives/consensus/babe" }
+sp-block-builder = { path = "../../../primitives/block-builder", default-features = false, version = "2.0.0"}
+sp-inherents = { version = "2.0.0", default-features = false, path = "../../../primitives/inherents" }
+node-primitives = { version = "2.0.0", default-features = false, path = "../primitives" }
+sp-offchain = { version = "2.0.0", default-features = false, path = "../../../primitives/offchain" }
+sp-core = { version = "2.0.0", default-features = false, path = "../../../primitives/core" }
+sp-std = { version = "2.0.0", default-features = false, path = "../../../primitives/std" }
+sp-api = { version = "2.0.0", default-features = false, path = "../../../primitives/api" }
+sp-runtime = { version = "2.0.0", default-features = false, path = "../../../primitives/runtime" }
+sp-staking = { version = "2.0.0", default-features = false, path = "../../../primitives/staking" }
+sp-keyring = { version = "2.0.0", optional = true, path = "../../../primitives/keyring" }
+sp-session = { version = "2.0.0", default-features = false, path = "../../../primitives/session" }
+sp-transaction-pool = { version = "2.0.0", default-features = false, path = "../../../primitives/transaction-pool" }
+sp-version = { version = "2.0.0", default-features = false, path = "../../../primitives/version" }
# frame dependencies
-frame-executive = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/executive" }
-frame-benchmarking = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/benchmarking", optional = true }
-frame-support = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/support" }
-frame-system = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/system" }
-frame-system-benchmarking = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/system/benchmarking", optional = true }
-frame-system-rpc-runtime-api = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/system/rpc/runtime-api/" }
-pallet-authority-discovery = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/authority-discovery" }
-pallet-authorship = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/authorship" }
-pallet-babe = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/babe" }
-pallet-balances = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/balances" }
-pallet-collective = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/collective" }
-pallet-contracts = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/contracts" }
-pallet-contracts-primitives = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/contracts/common/" }
-pallet-contracts-rpc-runtime-api = { version = "0.8.0-rc6", default-features = false, path = "../../../frame/contracts/rpc/runtime-api/" }
-pallet-democracy = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/democracy" }
-pallet-elections-phragmen = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/elections-phragmen" }
-pallet-finality-tracker = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/finality-tracker" }
-pallet-grandpa = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/grandpa" }
-pallet-im-online = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/im-online" }
-pallet-indices = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/indices" }
-pallet-identity = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/identity" }
-pallet-membership = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/membership" }
-pallet-multisig = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/multisig" }
-pallet-offences = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/offences" }
-pallet-offences-benchmarking = { version = "2.0.0-rc6", path = "../../../frame/offences/benchmarking", default-features = false, optional = true }
-pallet-proxy = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/proxy" }
-pallet-randomness-collective-flip = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/randomness-collective-flip" }
-pallet-recovery = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/recovery" }
-pallet-session = { version = "2.0.0-rc6", features = ["historical"], path = "../../../frame/session", default-features = false }
-pallet-session-benchmarking = { version = "2.0.0-rc6", path = "../../../frame/session/benchmarking", default-features = false, optional = true }
-pallet-staking = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/staking" }
-pallet-staking-reward-curve = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/staking/reward-curve" }
-pallet-scheduler = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/scheduler" }
-pallet-society = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/society" }
-pallet-sudo = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/sudo" }
-pallet-timestamp = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/timestamp" }
-pallet-treasury = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/treasury" }
-pallet-utility = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/utility" }
-pallet-transaction-payment = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/transaction-payment" }
-pallet-transaction-payment-rpc-runtime-api = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/transaction-payment/rpc/runtime-api/" }
-pallet-vesting = { version = "2.0.0-rc6", default-features = false, path = "../../../frame/vesting" }
+frame-executive = { version = "2.0.0", default-features = false, path = "../../../frame/executive" }
+frame-benchmarking = { version = "2.0.0", default-features = false, path = "../../../frame/benchmarking", optional = true }
+frame-support = { version = "2.0.0", default-features = false, path = "../../../frame/support" }
+frame-system = { version = "2.0.0", default-features = false, path = "../../../frame/system" }
+frame-system-benchmarking = { version = "2.0.0", default-features = false, path = "../../../frame/system/benchmarking", optional = true }
+frame-system-rpc-runtime-api = { version = "2.0.0", default-features = false, path = "../../../frame/system/rpc/runtime-api/" }
+pallet-authority-discovery = { version = "2.0.0", default-features = false, path = "../../../frame/authority-discovery" }
+pallet-authorship = { version = "2.0.0", default-features = false, path = "../../../frame/authorship" }
+pallet-babe = { version = "2.0.0", default-features = false, path = "../../../frame/babe" }
+pallet-balances = { version = "2.0.0", default-features = false, path = "../../../frame/balances" }
+pallet-collective = { version = "2.0.0", default-features = false, path = "../../../frame/collective" }
+pallet-contracts = { version = "2.0.0", default-features = false, path = "../../../frame/contracts" }
+pallet-contracts-primitives = { version = "2.0.0", default-features = false, path = "../../../frame/contracts/common/" }
+pallet-contracts-rpc-runtime-api = { version = "0.8.0", default-features = false, path = "../../../frame/contracts/rpc/runtime-api/" }
+pallet-democracy = { version = "2.0.0", default-features = false, path = "../../../frame/democracy" }
+pallet-elections-phragmen = { version = "2.0.0", default-features = false, path = "../../../frame/elections-phragmen" }
+pallet-finality-tracker = { version = "2.0.0", default-features = false, path = "../../../frame/finality-tracker" }
+pallet-grandpa = { version = "2.0.0", default-features = false, path = "../../../frame/grandpa" }
+pallet-im-online = { version = "2.0.0", default-features = false, path = "../../../frame/im-online" }
+pallet-indices = { version = "2.0.0", default-features = false, path = "../../../frame/indices" }
+pallet-identity = { version = "2.0.0", default-features = false, path = "../../../frame/identity" }
+pallet-membership = { version = "2.0.0", default-features = false, path = "../../../frame/membership" }
+pallet-multisig = { version = "2.0.0", default-features = false, path = "../../../frame/multisig" }
+pallet-offences = { version = "2.0.0", default-features = false, path = "../../../frame/offences" }
+pallet-offences-benchmarking = { version = "2.0.0", path = "../../../frame/offences/benchmarking", default-features = false, optional = true }
+pallet-proxy = { version = "2.0.0", default-features = false, path = "../../../frame/proxy" }
+pallet-randomness-collective-flip = { version = "2.0.0", default-features = false, path = "../../../frame/randomness-collective-flip" }
+pallet-recovery = { version = "2.0.0", default-features = false, path = "../../../frame/recovery" }
+pallet-session = { version = "2.0.0", features = ["historical"], path = "../../../frame/session", default-features = false }
+pallet-session-benchmarking = { version = "2.0.0", path = "../../../frame/session/benchmarking", default-features = false, optional = true }
+pallet-staking = { version = "2.0.0", default-features = false, path = "../../../frame/staking" }
+pallet-staking-reward-curve = { version = "2.0.0", default-features = false, path = "../../../frame/staking/reward-curve" }
+pallet-scheduler = { version = "2.0.0", default-features = false, path = "../../../frame/scheduler" }
+pallet-society = { version = "2.0.0", default-features = false, path = "../../../frame/society" }
+pallet-sudo = { version = "2.0.0", default-features = false, path = "../../../frame/sudo" }
+pallet-timestamp = { version = "2.0.0", default-features = false, path = "../../../frame/timestamp" }
+pallet-treasury = { version = "2.0.0", default-features = false, path = "../../../frame/treasury" }
+pallet-utility = { version = "2.0.0", default-features = false, path = "../../../frame/utility" }
+pallet-transaction-payment = { version = "2.0.0", default-features = false, path = "../../../frame/transaction-payment" }
+pallet-transaction-payment-rpc-runtime-api = { version = "2.0.0", default-features = false, path = "../../../frame/transaction-payment/rpc/runtime-api/" }
+pallet-vesting = { version = "2.0.0", default-features = false, path = "../../../frame/vesting" }
[build-dependencies]
-wasm-builder-runner = { version = "1.0.5", package = "substrate-wasm-builder-runner", path = "../../../utils/wasm-builder-runner" }
+wasm-builder-runner = { version = "2.0.0", package = "substrate-wasm-builder-runner", path = "../../../utils/wasm-builder-runner" }
[dev-dependencies]
-sp-io = { version = "2.0.0-rc6", path = "../../../primitives/io" }
+sp-io = { version = "2.0.0", path = "../../../primitives/io" }
[features]
default = ["std"]
+with-tracing = [ "frame-executive/with-tracing" ]
std = [
"sp-authority-discovery/std",
"pallet-authority-discovery/std",
diff --git a/bin/node/runtime/build.rs b/bin/node/runtime/build.rs
index a2f09a460e69da62a7ebf410cef5c6420cb09e3d..4f111bc9930078d09f02a1e189e2edcd26c993e4 100644
--- a/bin/node/runtime/build.rs
+++ b/bin/node/runtime/build.rs
@@ -20,7 +20,7 @@ use wasm_builder_runner::WasmBuilder;
fn main() {
WasmBuilder::new()
.with_current_project()
- .with_wasm_builder_from_crates_or_path("2.0.0", "../../../utils/wasm-builder")
+ .with_wasm_builder_from_crates_or_path("2.0.1", "../../../utils/wasm-builder")
.export_heap_base()
.import_memory()
.build()
diff --git a/bin/node/runtime/src/impls.rs b/bin/node/runtime/src/impls.rs
index 039093ddee69700594b70200595a39b07f7e7fa4..16666997b3a5597b807296f1b285177216342577 100644
--- a/bin/node/runtime/src/impls.rs
+++ b/bin/node/runtime/src/impls.rs
@@ -17,8 +17,6 @@
//! Some configurable implementations as associated type for the substrate runtime.
-use node_primitives::Balance;
-use sp_runtime::traits::Convert;
use frame_support::traits::{OnUnbalanced, Currency};
use crate::{Balances, Authorship, NegativeImbalance};
@@ -29,26 +27,9 @@ impl OnUnbalanced for Author {
}
}
-/// Struct that handles the conversion of Balance -> `u64`. This is used for staking's election
-/// calculation.
-pub struct CurrencyToVoteHandler;
-
-impl CurrencyToVoteHandler {
- fn factor() -> Balance { (Balances::total_issuance() / u64::max_value() as Balance).max(1) }
-}
-
-impl Convert for CurrencyToVoteHandler {
- fn convert(x: Balance) -> u64 { (x / Self::factor()) as u64 }
-}
-
-impl Convert for CurrencyToVoteHandler {
- fn convert(x: u128) -> Balance { x * Self::factor() }
-}
-
#[cfg(test)]
mod multiplier_tests {
- use super::*;
- use sp_runtime::{assert_eq_error_rate, FixedPointNumber};
+ use sp_runtime::{assert_eq_error_rate, FixedPointNumber, traits::Convert};
use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment};
use crate::{
diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs
index eeac6d83b87776efcba3b4b0fa0e8689db0017a7..04381d50a2afaaaa49161c99d4dc5cfc51a68a2a 100644
--- a/bin/node/runtime/src/lib.rs
+++ b/bin/node/runtime/src/lib.rs
@@ -20,24 +20,27 @@
#![cfg_attr(not(feature = "std"), no_std)]
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
-#![recursion_limit="256"]
+#![recursion_limit = "256"]
-use sp_std::prelude::*;
+use sp_std::prelude::*;
use frame_support::{
construct_runtime, parameter_types, debug, RuntimeDebug,
weights::{
Weight, IdentityFee,
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
},
- traits::{Currency, Imbalance, KeyOwnerProofSystem, OnUnbalanced, Randomness, LockIdentifier},
+ traits::{
+ Currency, Imbalance, KeyOwnerProofSystem, OnUnbalanced, Randomness, LockIdentifier,
+ U128CurrencyToVote,
+ },
};
use frame_system::{EnsureRoot, EnsureOneOf};
use frame_support::traits::InstanceFilter;
use codec::{Encode, Decode};
use sp_core::{
crypto::KeyTypeId,
- u32_trait::{_1, _2, _3, _4},
+ u32_trait::{_1, _2, _3, _4, _5},
OpaqueMetadata,
};
pub use node_primitives::{AccountId, Signature};
@@ -78,7 +81,7 @@ pub use pallet_staking::StakerStatus;
/// Implementations of some helper traits passed into runtime modules as associated types.
pub mod impls;
-use impls::{CurrencyToVoteHandler, Author};
+use impls::Author;
/// Constant values used within the runtime.
pub mod constants;
@@ -109,7 +112,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
- spec_version: 259,
+ spec_version: 260,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
@@ -149,9 +152,8 @@ parameter_types! {
pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
/// Assume 10% of weight for average on_initialize calls.
- pub MaximumExtrinsicWeight: Weight =
- AvailableBlockRatio::get().saturating_sub(AVERAGE_ON_INITIALIZE_WEIGHT)
- * MaximumBlockWeight::get();
+ pub MaximumExtrinsicWeight: Weight = AvailableBlockRatio::get().saturating_sub(AVERAGE_ON_INITIALIZE_WEIGHT)
+ * MaximumBlockWeight::get();
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
pub const Version: RuntimeVersion = VERSION;
}
@@ -179,17 +181,17 @@ impl frame_system::Trait for Runtime {
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = Version;
- type ModuleToIndex = ModuleToIndex;
+ type PalletInfo = PalletInfo;
type AccountData = pallet_balances::AccountData;
type OnNewAccount = ();
type OnKilledAccount = ();
- type SystemWeightInfo = weights::frame_system::WeightInfo;
+ type SystemWeightInfo = weights::frame_system::WeightInfo;
}
impl pallet_utility::Trait for Runtime {
type Event = Event;
type Call = Call;
- type WeightInfo = weights::pallet_utility::WeightInfo;
+ type WeightInfo = weights::pallet_utility::WeightInfo;
}
parameter_types! {
@@ -207,7 +209,7 @@ impl pallet_multisig::Trait for Runtime {
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
- type WeightInfo = ();
+ type WeightInfo = weights::pallet_multisig::WeightInfo;
}
parameter_types! {
@@ -234,13 +236,20 @@ impl InstanceFilter for ProxyType {
fn filter(&self, c: &Call) -> bool {
match self {
ProxyType::Any => true,
- ProxyType::NonTransfer => !matches!(c,
- Call::Balances(..) | Call::Vesting(pallet_vesting::Call::vested_transfer(..))
- | Call::Indices(pallet_indices::Call::transfer(..))
+ ProxyType::NonTransfer => !matches!(
+ c,
+ Call::Balances(..) |
+ Call::Vesting(pallet_vesting::Call::vested_transfer(..)) |
+ Call::Indices(pallet_indices::Call::transfer(..))
),
- ProxyType::Governance => matches!(c,
- Call::Democracy(..) | Call::Council(..) | Call::Society(..)
- | Call::TechnicalCommittee(..) | Call::Elections(..) | Call::Treasury(..)
+ ProxyType::Governance => matches!(
+ c,
+ Call::Democracy(..) |
+ Call::Council(..) |
+ Call::Society(..) |
+ Call::TechnicalCommittee(..) |
+ Call::Elections(..) |
+ Call::Treasury(..)
),
ProxyType::Staking => matches!(c, Call::Staking(..)),
}
@@ -264,7 +273,7 @@ impl pallet_proxy::Trait for Runtime {
type ProxyDepositBase = ProxyDepositBase;
type ProxyDepositFactor = ProxyDepositFactor;
type MaxProxies = MaxProxies;
- type WeightInfo = weights::pallet_proxy::WeightInfo;
+ type WeightInfo = weights::pallet_proxy::WeightInfo;
type MaxPending = MaxPending;
type CallHasher = BlakeTwo256;
type AnnouncementDepositBase = AnnouncementDepositBase;
@@ -273,6 +282,7 @@ impl pallet_proxy::Trait for Runtime {
parameter_types! {
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * MaximumBlockWeight::get();
+ pub const MaxScheduledPerBlock: u32 = 50;
}
impl pallet_scheduler::Trait for Runtime {
@@ -282,7 +292,8 @@ impl pallet_scheduler::Trait for Runtime {
type Call = Call;
type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = EnsureRoot;
- type WeightInfo = ();
+ type MaxScheduledPerBlock = MaxScheduledPerBlock;
+ type WeightInfo = weights::pallet_scheduler::WeightInfo;
}
parameter_types! {
@@ -309,6 +320,8 @@ impl pallet_babe::Trait for Runtime {
type HandleEquivocation =
pallet_babe::EquivocationHandler;
+
+ type WeightInfo = ();
}
parameter_types! {
@@ -320,20 +333,24 @@ impl pallet_indices::Trait for Runtime {
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
- type WeightInfo = ();
+ type WeightInfo = weights::pallet_indices::WeightInfo;
}
parameter_types! {
pub const ExistentialDeposit: Balance = 1 * DOLLARS;
+ // For weight estimation, we assume that the most locks on an individual account will be 50.
+ // This number may need to be adjusted in the future if this assumption no longer holds true.
+ pub const MaxLocks: u32 = 50;
}
impl pallet_balances::Trait for Runtime {
+ type MaxLocks = MaxLocks;
type Balance = Balance;
type DustRemoval = ();
type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = frame_system::Module;
- type WeightInfo = weights::pallet_balances::WeightInfo;
+ type WeightInfo = weights::pallet_balances::WeightInfo;
}
parameter_types! {
@@ -360,7 +377,7 @@ impl pallet_timestamp::Trait for Runtime {
type Moment = Moment;
type OnTimestampSet = Babe;
type MinimumPeriod = MinimumPeriod;
- type WeightInfo = weights::pallet_timestamp::WeightInfo;
+ type WeightInfo = weights::pallet_timestamp::WeightInfo;
}
parameter_types! {
@@ -397,7 +414,7 @@ impl pallet_session::Trait for Runtime {
type SessionHandler = ::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
- type WeightInfo = ();
+ type WeightInfo = weights::pallet_session::WeightInfo;
}
impl pallet_session::historical::Trait for Runtime {
@@ -421,17 +438,20 @@ parameter_types! {
pub const BondingDuration: pallet_staking::EraIndex = 24 * 28;
pub const SlashDeferDuration: pallet_staking::EraIndex = 24 * 7; // 1/4 the bonding duration.
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
- pub const MaxNominatorRewardedPerValidator: u32 = 64;
+ pub const MaxNominatorRewardedPerValidator: u32 = 256;
pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 4;
pub const MaxIterations: u32 = 10;
// 0.05%. The higher the value, the more strict solution acceptance becomes.
pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000);
+ pub OffchainSolutionWeightLimit: Weight = MaximumExtrinsicWeight::get()
+ .saturating_sub(BlockExecutionWeight::get())
+ .saturating_sub(ExtrinsicBaseWeight::get());
}
impl pallet_staking::Trait for Runtime {
type Currency = Balances;
type UnixTime = Timestamp;
- type CurrencyToVote = CurrencyToVoteHandler;
+ type CurrencyToVote = U128CurrencyToVote;
type RewardRemainder = Treasury;
type Event = Event;
type Slash = Treasury; // send the slashed funds to the treasury.
@@ -454,7 +474,10 @@ impl pallet_staking::Trait for Runtime {
type MinSolutionScoreBump = MinSolutionScoreBump;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type UnsignedPriority = StakingUnsignedPriority;
- type WeightInfo = ();
+ // The unsigned solution weight targeted by the OCW. We set it to the maximum possible value of
+ // a single extrinsic.
+ type OffchainSolutionWeightLimit = OffchainSolutionWeightLimit;
+ type WeightInfo = weights::pallet_staking::WeightInfo;
}
parameter_types! {
@@ -468,6 +491,7 @@ parameter_types! {
// One cent: $10,000 / MB
pub const PreimageByteDeposit: Balance = 1 * CENTS;
pub const MaxVotes: u32 = 100;
+ pub const MaxProposals: u32 = 100;
}
impl pallet_democracy::Trait for Runtime {
@@ -493,6 +517,14 @@ impl pallet_democracy::Trait for Runtime {
type FastTrackVotingPeriod = FastTrackVotingPeriod;
// To cancel a proposal which has been passed, 2/3 of the council must agree to it.
type CancellationOrigin = pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>;
+ // To cancel a proposal before it has been passed, the technical committee must be unanimous or
+ // Root must agree.
+ type CancelProposalOrigin = EnsureOneOf<
+ AccountId,
+ EnsureRoot,
+ pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>,
+ >;
+ type BlacklistOrigin = EnsureRoot;
// Any single technical committee member may veto a coming council proposal, however they can
// only do it once and it lasts only for the cooloff period.
type VetoOrigin = pallet_collective::EnsureMember;
@@ -503,7 +535,8 @@ impl pallet_democracy::Trait for Runtime {
type Scheduler = Scheduler;
type PalletsOrigin = OriginCaller;
type MaxVotes = MaxVotes;
- type WeightInfo = weights::pallet_democracy::WeightInfo;
+ type WeightInfo = weights::pallet_democracy::WeightInfo;
+ type MaxProposals = MaxProposals;
}
parameter_types! {
@@ -521,7 +554,7 @@ impl pallet_collective::Trait for Runtime {
type MaxProposals = CouncilMaxProposals;
type MaxMembers = CouncilMaxMembers;
type DefaultVote = pallet_collective::PrimeDefaultVote;
- type WeightInfo = weights::pallet_collective::WeightInfo;
+ type WeightInfo = weights::pallet_collective::WeightInfo;
}
parameter_types! {
@@ -544,7 +577,7 @@ impl pallet_elections_phragmen::Trait for Runtime {
// NOTE: this implies that council's genesis members cannot be set directly and must come from
// this module.
type InitializeMembers = Council;
- type CurrencyToVote = CurrencyToVoteHandler;
+ type CurrencyToVote = U128CurrencyToVote;
type CandidacyBond = CandidacyBond;
type VotingBond = VotingBond;
type LoserCandidate = ();
@@ -553,7 +586,7 @@ impl pallet_elections_phragmen::Trait for Runtime {
type DesiredMembers = DesiredMembers;
type DesiredRunnersUp = DesiredRunnersUp;
type TermDuration = TermDuration;
- type WeightInfo = ();
+ type WeightInfo = weights::pallet_elections_phragmen::WeightInfo;
}
parameter_types! {
@@ -571,7 +604,7 @@ impl pallet_collective::Trait for Runtime {
type MaxProposals = TechnicalMaxProposals;
type MaxMembers = TechnicalMaxMembers;
type DefaultVote = pallet_collective::PrimeDefaultVote;
- type WeightInfo = weights::pallet_collective::WeightInfo;
+ type WeightInfo = weights::pallet_collective::WeightInfo;
}
type EnsureRootOrHalfCouncil = EnsureOneOf<
@@ -598,8 +631,14 @@ parameter_types! {
pub const TipCountdown: BlockNumber = 1 * DAYS;
pub const TipFindersFee: Percent = Percent::from_percent(20);
pub const TipReportDepositBase: Balance = 1 * DOLLARS;
- pub const TipReportDepositPerByte: Balance = 1 * CENTS;
+ pub const DataDepositPerByte: Balance = 1 * CENTS;
+ pub const BountyDepositBase: Balance = 1 * DOLLARS;
+ pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS;
pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry");
+ pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS;
+ pub const MaximumReasonLength: u32 = 16384;
+ pub const BountyCuratorDeposit: Permill = Permill::from_percent(50);
+ pub const BountyValueMinimum: Balance = 5 * DOLLARS;
}
impl pallet_treasury::Trait for Runtime {
@@ -608,26 +647,32 @@ impl pallet_treasury::Trait for Runtime {
type ApproveOrigin = EnsureOneOf<
AccountId,
EnsureRoot,
- pallet_collective::EnsureMembers<_4, AccountId, CouncilCollective>
+ pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>
>;
type RejectOrigin = EnsureOneOf<
AccountId,
EnsureRoot,
- pallet_collective::EnsureMembers<_2, AccountId, CouncilCollective>
+ pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>
>;
type Tippers = Elections;
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
- type TipReportDepositPerByte = TipReportDepositPerByte;
+ type DataDepositPerByte = DataDepositPerByte;
type Event = Event;
- type ProposalRejection = ();
+ type OnSlash = ();
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ProposalBondMinimum;
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 BurnDestination = ();
- type WeightInfo = ();
+ type WeightInfo = weights::pallet_treasury::WeightInfo;
}
parameter_types! {
@@ -654,6 +699,7 @@ impl pallet_contracts::Trait for Runtime {
type MaxDepth = pallet_contracts::DefaultMaxDepth;
type MaxValueSize = pallet_contracts::DefaultMaxValueSize;
type WeightPrice = pallet_transaction_payment::Module;
+ type WeightInfo = weights::pallet_contracts::WeightInfo;
}
impl pallet_sudo::Trait for Runtime {
@@ -732,7 +778,7 @@ impl pallet_im_online::Trait for Runtime {
type SessionDuration = SessionDuration;
type ReportUnresponsiveness = Offences;
type UnsignedPriority = ImOnlineUnsignedPriority;
- type WeightInfo = ();
+ type WeightInfo = weights::pallet_im_online::WeightInfo;
}
parameter_types! {
@@ -744,7 +790,6 @@ impl pallet_offences::Trait for Runtime {
type IdentificationTuple = pallet_session::historical::IdentificationTuple;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
- type WeightInfo = ();
}
impl pallet_authority_discovery::Trait for Runtime {}
@@ -765,6 +810,8 @@ impl pallet_grandpa::Trait for Runtime {
type HandleEquivocation =
pallet_grandpa::EquivocationHandler;
+
+ type WeightInfo = ();
}
parameter_types! {
@@ -799,7 +846,7 @@ impl pallet_identity::Trait for Runtime {
type Slashed = Treasury;
type ForceOrigin = EnsureRootOrHalfCouncil;
type RegistrarOrigin = EnsureRootOrHalfCouncil;
- type WeightInfo = ();
+ type WeightInfo = weights::pallet_identity::WeightInfo;
}
parameter_types! {
@@ -856,7 +903,7 @@ impl pallet_vesting::Trait for Runtime {
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
- type WeightInfo = ();
+ type WeightInfo = weights::pallet_vesting::WeightInfo;
}
construct_runtime!(
@@ -883,7 +930,7 @@ construct_runtime!(
FinalityTracker: pallet_finality_tracker::{Module, Call, Inherent},
Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned},
Treasury: pallet_treasury::{Module, Call, Storage, Config, Event},
- Contracts: pallet_contracts::{Module, Call, Config, Storage, Event},
+ Contracts: pallet_contracts::{Module, Call, Config, Storage, Event},
Sudo: pallet_sudo::{Module, Call, Config, Storage, Event},
ImOnline: pallet_im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config},
AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config},
diff --git a/bin/node/runtime/src/weights/frame_system.rs b/bin/node/runtime/src/weights/frame_system.rs
index 9522fa75203906ab3c7264154a4b33835375843c..b1fdf69640602d7a042579332ce36b56ba240ec2 100644
--- a/bin/node/runtime/src/weights/frame_system.rs
+++ b/bin/node/runtime/src/weights/frame_system.rs
@@ -19,38 +19,39 @@
#![allow(unused_parens)]
-use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
+use frame_support::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
-pub struct WeightInfo;
-impl frame_system::WeightInfo for WeightInfo {
+pub struct WeightInfo(PhantomData);
+impl frame_system::WeightInfo for WeightInfo {
// WARNING! Some components were not used: ["b"]
fn remark() -> Weight {
(1305000 as Weight)
}
fn set_heap_pages() -> Weight {
(2023000 as Weight)
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// WARNING! Some components were not used: ["d"]
fn set_changes_trie_config() -> Weight {
(10026000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn set_storage(i: u32, ) -> Weight {
(0 as Weight)
.saturating_add((656000 as Weight).saturating_mul(i as Weight))
- .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
}
fn kill_storage(i: u32, ) -> Weight {
(4327000 as Weight)
.saturating_add((478000 as Weight).saturating_mul(i as Weight))
- .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
}
fn kill_prefix(p: u32, ) -> Weight {
(8349000 as Weight)
.saturating_add((838000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
}
fn suicide() -> Weight {
(29247000 as Weight)
diff --git a/bin/node/runtime/src/weights/mod.rs b/bin/node/runtime/src/weights/mod.rs
index 372b13a093e27183f6cdd60bdb76c94379bc3f60..c75ff83085b6e6ad4cec96d11841c7f6b2700a34 100644
--- a/bin/node/runtime/src/weights/mod.rs
+++ b/bin/node/runtime/src/weights/mod.rs
@@ -18,7 +18,18 @@
pub mod frame_system;
pub mod pallet_balances;
pub mod pallet_collective;
+pub mod pallet_contracts;
pub mod pallet_democracy;
+pub mod pallet_elections_phragmen;
+pub mod pallet_identity;
+pub mod pallet_im_online;
+pub mod pallet_indices;
+pub mod pallet_multisig;
pub mod pallet_proxy;
+pub mod pallet_scheduler;
+pub mod pallet_session;
+pub mod pallet_staking;
pub mod pallet_timestamp;
+pub mod pallet_treasury;
pub mod pallet_utility;
+pub mod pallet_vesting;
diff --git a/bin/node/runtime/src/weights/pallet_balances.rs b/bin/node/runtime/src/weights/pallet_balances.rs
index bcbc4ced6ef56895d4c62a31a7b0580ad71b9ecf..18a971b20c0ec47e3025b1ba4f9b41778ba31c8e 100644
--- a/bin/node/runtime/src/weights/pallet_balances.rs
+++ b/bin/node/runtime/src/weights/pallet_balances.rs
@@ -15,33 +15,34 @@
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc5
-use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
+use frame_support::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
-pub struct WeightInfo;
-impl pallet_balances::WeightInfo for WeightInfo {
+pub struct WeightInfo(PhantomData);
+impl pallet_balances::WeightInfo for WeightInfo {
fn transfer() -> Weight {
(65949000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn transfer_keep_alive() -> Weight {
(46665000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_balance_creating() -> Weight {
(27086000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_balance_killing() -> Weight {
(33424000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_transfer() -> Weight {
(65343000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
}
}
diff --git a/bin/node/runtime/src/weights/pallet_collective.rs b/bin/node/runtime/src/weights/pallet_collective.rs
index 32b4ad02d7aa94c8007429b24bef2f062b310036..5e91dc19abcb9f5aaf5c62e54bdbb03f7e9d37ce 100644
--- a/bin/node/runtime/src/weights/pallet_collective.rs
+++ b/bin/node/runtime/src/weights/pallet_collective.rs
@@ -18,80 +18,81 @@
#![allow(unused_parens)]
#![allow(unused_imports)]
-use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
+use frame_support::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
-pub struct WeightInfo;
-impl pallet_collective::WeightInfo for WeightInfo {
+pub struct WeightInfo(PhantomData);
+impl pallet_collective::WeightInfo for WeightInfo {
fn set_members(m: u32, n: u32, p: u32, ) -> Weight {
(0 as Weight)
.saturating_add((21040000 as Weight).saturating_mul(m as Weight))
.saturating_add((173000 as Weight).saturating_mul(n as Weight))
.saturating_add((31595000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().reads((1 as Weight).saturating_mul(p as Weight)))
- .saturating_add(DbWeight::get().writes(2 as Weight))
- .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(p as Weight)))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
}
fn execute(b: u32, m: u32, ) -> Weight {
(43359000 as Weight)
.saturating_add((4000 as Weight).saturating_mul(b as Weight))
.saturating_add((123000 as Weight).saturating_mul(m as Weight))
- .saturating_add(DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
}
fn propose_execute(b: u32, m: u32, ) -> Weight {
(54134000 as Weight)
.saturating_add((4000 as Weight).saturating_mul(b as Weight))
.saturating_add((239000 as Weight).saturating_mul(m as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
}
fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight {
(90650000 as Weight)
.saturating_add((5000 as Weight).saturating_mul(b as Weight))
.saturating_add((152000 as Weight).saturating_mul(m as Weight))
.saturating_add((970000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(4 as Weight))
- .saturating_add(DbWeight::get().writes(4 as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn vote(m: u32, ) -> Weight {
(74460000 as Weight)
.saturating_add((290000 as Weight).saturating_mul(m as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn close_early_disapproved(m: u32, p: u32, ) -> Weight {
(86360000 as Weight)
.saturating_add((232000 as Weight).saturating_mul(m as Weight))
.saturating_add((954000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(3 as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight {
(123653000 as Weight)
.saturating_add((1000 as Weight).saturating_mul(b as Weight))
.saturating_add((287000 as Weight).saturating_mul(m as Weight))
.saturating_add((920000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(4 as Weight))
- .saturating_add(DbWeight::get().writes(3 as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn close_disapproved(m: u32, p: u32, ) -> Weight {
(95395000 as Weight)
.saturating_add((236000 as Weight).saturating_mul(m as Weight))
.saturating_add((965000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(4 as Weight))
- .saturating_add(DbWeight::get().writes(3 as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn close_approved(b: u32, m: u32, p: u32, ) -> Weight {
(135284000 as Weight)
.saturating_add((4000 as Weight).saturating_mul(b as Weight))
.saturating_add((218000 as Weight).saturating_mul(m as Weight))
.saturating_add((951000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(5 as Weight))
- .saturating_add(DbWeight::get().writes(3 as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn disapprove_proposal(p: u32, ) -> Weight {
(50500000 as Weight)
.saturating_add((966000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(3 as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
}
}
diff --git a/bin/node/runtime/src/weights/pallet_contracts.rs b/bin/node/runtime/src/weights/pallet_contracts.rs
new file mode 100644
index 0000000000000000000000000000000000000000..8cd97b4a72191c7ca450676b298729a49dcd0689
--- /dev/null
+++ b/bin/node/runtime/src/weights/pallet_contracts.rs
@@ -0,0 +1,294 @@
+// 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.
+
+//! Weights for pallet_contracts
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0
+//! DATE: 2020-10-06, STEPS: [50], REPEAT: 20, LOW RANGE: [], HIGH RANGE: []
+
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+
+use frame_support::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
+
+pub struct WeightInfo(PhantomData);
+impl pallet_contracts::WeightInfo for WeightInfo {
+ fn update_schedule() -> Weight {
+ (33_207_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn put_code(n: u32, ) -> Weight {
+ (0 as Weight)
+ .saturating_add((144_833_000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn instantiate(n: u32, ) -> Weight {
+ (223_974_000 as Weight)
+ .saturating_add((1_007_000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(6 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
+ }
+ fn call() -> Weight {
+ (210_638_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn claim_surcharge() -> Weight {
+ (508_079_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn seal_caller(r: u32, ) -> Weight {
+ (143_336_000 as Weight)
+ .saturating_add((397_788_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_address(r: u32, ) -> Weight {
+ (147_296_000 as Weight)
+ .saturating_add((396_962_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_gas_left(r: u32, ) -> Weight {
+ (141_677_000 as Weight)
+ .saturating_add((393_308_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_balance(r: u32, ) -> Weight {
+ (157_556_000 as Weight)
+ .saturating_add((879_861_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ }
+ fn seal_value_transferred(r: u32, ) -> Weight {
+ (148_867_000 as Weight)
+ .saturating_add((391_678_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_minimum_balance(r: u32, ) -> Weight {
+ (147_252_000 as Weight)
+ .saturating_add((393_977_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_tombstone_deposit(r: u32, ) -> Weight {
+ (144_208_000 as Weight)
+ .saturating_add((394_625_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_rent_allowance(r: u32, ) -> Weight {
+ (135_320_000 as Weight)
+ .saturating_add((925_541_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_block_number(r: u32, ) -> Weight {
+ (145_849_000 as Weight)
+ .saturating_add((390_065_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_now(r: u32, ) -> Weight {
+ (146_363_000 as Weight)
+ .saturating_add((391_772_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_weight_to_fee(r: u32, ) -> Weight {
+ (129_872_000 as Weight)
+ .saturating_add((670_744_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ }
+ fn seal_gas(r: u32, ) -> Weight {
+ (130_985_000 as Weight)
+ .saturating_add((198_427_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_input(r: u32, ) -> Weight {
+ (138_647_000 as Weight)
+ .saturating_add((8_363_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_input_per_kb(n: u32, ) -> Weight {
+ (149_418_000 as Weight)
+ .saturating_add((272_000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_return(r: u32, ) -> Weight {
+ (129_116_000 as Weight)
+ .saturating_add((5_745_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_return_per_kb(n: u32, ) -> Weight {
+ (139_601_000 as Weight)
+ .saturating_add((680_000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_terminate(r: u32, ) -> Weight {
+ (138_548_000 as Weight)
+ .saturating_add((355_473_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(r as Weight)))
+ .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(r as Weight)))
+ }
+ fn seal_restore_to(r: u32, ) -> Weight {
+ (239_880_000 as Weight)
+ .saturating_add((138_305_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(r as Weight)))
+ .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(r as Weight)))
+ }
+ fn seal_restore_to_per_delta(d: u32, ) -> Weight {
+ (40_572_000 as Weight)
+ .saturating_add((3_748_632_000 as Weight).saturating_mul(d as Weight))
+ .saturating_add(T::DbWeight::get().reads(7 as Weight))
+ .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(d as Weight)))
+ .saturating_add(T::DbWeight::get().writes(5 as Weight))
+ .saturating_add(T::DbWeight::get().writes((100 as Weight).saturating_mul(d as Weight)))
+ }
+ fn seal_random(r: u32, ) -> Weight {
+ (148_156_000 as Weight)
+ .saturating_add((1_036_452_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ }
+ fn seal_deposit_event(r: u32, ) -> Weight {
+ (176_039_000 as Weight)
+ .saturating_add((1_497_705_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_deposit_event_per_topic_and_kb(t: u32, n: u32, ) -> Weight {
+ (1_923_547_000 as Weight)
+ .saturating_add((783_354_000 as Weight).saturating_mul(t as Weight))
+ .saturating_add((240_600_000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(t as Weight)))
+ .saturating_add(T::DbWeight::get().writes((100 as Weight).saturating_mul(t as Weight)))
+ }
+ fn seal_set_rent_allowance(r: u32, ) -> Weight {
+ (151_095_000 as Weight)
+ .saturating_add((1_104_696_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn seal_set_storage(r: u32, ) -> Weight {
+ (0 as Weight)
+ .saturating_add((14_975_467_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight)))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes((100 as Weight).saturating_mul(r as Weight)))
+ }
+ fn seal_set_storage_per_kb(n: u32, ) -> Weight {
+ (2_465_724_000 as Weight)
+ .saturating_add((203_125_000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn seal_clear_storage(r: u32, ) -> Weight {
+ (0 as Weight)
+ .saturating_add((5_254_595_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight)))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes((100 as Weight).saturating_mul(r as Weight)))
+ }
+ fn seal_get_storage(r: u32, ) -> Weight {
+ (60_303_000 as Weight)
+ .saturating_add((1_135_486_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight)))
+ }
+ fn seal_get_storage_per_kb(n: u32, ) -> Weight {
+ (931_900_000 as Weight)
+ .saturating_add((144_572_000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ }
+ fn seal_transfer(r: u32, ) -> Weight {
+ (50_722_000 as Weight)
+ .saturating_add((6_701_164_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight)))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes((100 as Weight).saturating_mul(r as Weight)))
+ }
+ fn seal_call(r: u32, ) -> Weight {
+ (0 as Weight)
+ .saturating_add((10_589_747_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight)))
+ }
+ fn seal_call_per_transfer_input_output_kb(t: u32, i: u32, o: u32, ) -> Weight {
+ (11_223_388_000 as Weight)
+ .saturating_add((4_965_182_000 as Weight).saturating_mul(t as Weight))
+ .saturating_add((50_603_000 as Weight).saturating_mul(i as Weight))
+ .saturating_add((72_972_000 as Weight).saturating_mul(o as Weight))
+ .saturating_add(T::DbWeight::get().reads(105 as Weight))
+ .saturating_add(T::DbWeight::get().reads((101 as Weight).saturating_mul(t as Weight)))
+ .saturating_add(T::DbWeight::get().writes((101 as Weight).saturating_mul(t as Weight)))
+ }
+ fn seal_instantiate(r: u32, ) -> Weight {
+ (0 as Weight)
+ .saturating_add((22_933_938_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(6 as Weight))
+ .saturating_add(T::DbWeight::get().reads((300 as Weight).saturating_mul(r as Weight)))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes((200 as Weight).saturating_mul(r as Weight)))
+ }
+ fn seal_instantiate_per_input_output_kb(i: u32, o: u32, ) -> Weight {
+ (20_986_307_000 as Weight)
+ .saturating_add((152_611_000 as Weight).saturating_mul(i as Weight))
+ .saturating_add((73_457_000 as Weight).saturating_mul(o as Weight))
+ .saturating_add(T::DbWeight::get().reads(207 as Weight))
+ .saturating_add(T::DbWeight::get().writes(202 as Weight))
+ }
+ fn seal_hash_sha2_256(r: u32, ) -> Weight {
+ (145_988_000 as Weight)
+ .saturating_add((343_540_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_hash_sha2_256_per_kb(n: u32, ) -> Weight {
+ (719_758_000 as Weight)
+ .saturating_add((420_306_000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_hash_keccak_256(r: u32, ) -> Weight {
+ (116_261_000 as Weight)
+ .saturating_add((360_601_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_hash_keccak_256_per_kb(n: u32, ) -> Weight {
+ (583_726_000 as Weight)
+ .saturating_add((333_091_000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_hash_blake2_256(r: u32, ) -> Weight {
+ (144_609_000 as Weight)
+ .saturating_add((332_388_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_hash_blake2_256_per_kb(n: u32, ) -> Weight {
+ (612_987_000 as Weight)
+ .saturating_add((150_030_000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_hash_blake2_128(r: u32, ) -> Weight {
+ (142_085_000 as Weight)
+ .saturating_add((329_426_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+ fn seal_hash_blake2_128_per_kb(n: u32, ) -> Weight {
+ (632_517_000 as Weight)
+ .saturating_add((149_974_000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ }
+}
diff --git a/bin/node/runtime/src/weights/pallet_democracy.rs b/bin/node/runtime/src/weights/pallet_democracy.rs
index 2c55a848061a393c179614688f18885fd63c2c97..51eca2855a384b54e4ec171f352be77abb37f7cf 100644
--- a/bin/node/runtime/src/weights/pallet_democracy.rs
+++ b/bin/node/runtime/src/weights/pallet_democracy.rs
@@ -1,3 +1,5 @@
+// This file is part of Substrate.
+
// Copyright (C) 2020 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
@@ -13,143 +15,159 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-//! Weights for the Democracy Pallet
-//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc5
+//! Weights for pallet_democracy
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0
+//! DATE: 2020-09-24, STEPS: [50], REPEAT: 20, LOW RANGE: [], HIGH RANGE: []
+
+#![allow(unused_parens)]
+#![allow(unused_imports)]
-use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
+use frame_support::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
-pub struct WeightInfo;
-impl pallet_democracy::WeightInfo for WeightInfo {
+pub struct WeightInfo(PhantomData);
+impl pallet_democracy::WeightInfo for WeightInfo {
fn propose() -> Weight {
- (49113000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(3 as Weight))
+ (96_316_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn second(s: u32, ) -> Weight {
- (42067000 as Weight)
- .saturating_add((220000 as Weight).saturating_mul(s as Weight))
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ (58_386_000 as Weight)
+ .saturating_add((259_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn vote_new(r: u32, ) -> Weight {
- (54159000 as Weight)
- .saturating_add((252000 as Weight).saturating_mul(r as Weight))
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(3 as Weight))
+ (70_374_000 as Weight)
+ .saturating_add((291_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn vote_existing(r: u32, ) -> Weight {
- (54145000 as Weight)
- .saturating_add((262000 as Weight).saturating_mul(r as Weight))
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(3 as Weight))
+ (70_097_000 as Weight)
+ .saturating_add((296_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn emergency_cancel() -> Weight {
- (31071000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
+ (41_731_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn blacklist(p: u32, ) -> Weight {
+ (117_847_000 as Weight)
+ .saturating_add((871_000 as Weight).saturating_mul(p as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().writes(6 as Weight))
}
fn external_propose(v: u32, ) -> Weight {
- (14282000 as Weight)
- .saturating_add((109000 as Weight).saturating_mul(v as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ (20_972_000 as Weight)
+ .saturating_add((114_000 as Weight).saturating_mul(v as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn external_propose_majority() -> Weight {
- (3478000 as Weight)
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ (5_030_000 as Weight)
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn external_propose_default() -> Weight {
- (3442000 as Weight)
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ (4_981_000 as Weight)
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn fast_track() -> Weight {
- (30820000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(3 as Weight))
+ (42_801_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn veto_external(v: u32, ) -> Weight {
- (30971000 as Weight)
- .saturating_add((184000 as Weight).saturating_mul(v as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
+ (44_115_000 as Weight)
+ .saturating_add((194_000 as Weight).saturating_mul(v as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn cancel_proposal(p: u32, ) -> Weight {
+ (73_937_000 as Weight)
+ .saturating_add((962_000 as Weight).saturating_mul(p as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn cancel_referendum() -> Weight {
- (20431000 as Weight)
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ (25_233_000 as Weight)
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn cancel_queued(r: u32, ) -> Weight {
- (42438000 as Weight)
- .saturating_add((3284000 as Weight).saturating_mul(r as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
+ (48_251_000 as Weight)
+ .saturating_add((3_590_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn on_initialize_base(r: u32, ) -> Weight {
- (70826000 as Weight)
- .saturating_add((10716000 as Weight).saturating_mul(r as Weight))
- .saturating_add(DbWeight::get().reads(6 as Weight))
- .saturating_add(DbWeight::get().reads((2 as Weight).saturating_mul(r as Weight)))
- .saturating_add(DbWeight::get().writes(5 as Weight))
+ (17_597_000 as Weight)
+ .saturating_add((7_248_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight)))
}
fn delegate(r: u32, ) -> Weight {
- (72046000 as Weight)
- .saturating_add((7837000 as Weight).saturating_mul(r as Weight))
- .saturating_add(DbWeight::get().reads(4 as Weight))
- .saturating_add(DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight)))
- .saturating_add(DbWeight::get().writes(4 as Weight))
- .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight)))
+ (93_916_000 as Weight)
+ .saturating_add((10_794_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight)))
+ .saturating_add(T::DbWeight::get().writes(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight)))
}
fn undelegate(r: u32, ) -> Weight {
- (41028000 as Weight)
- .saturating_add((7810000 as Weight).saturating_mul(r as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight)))
- .saturating_add(DbWeight::get().writes(2 as Weight))
- .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight)))
+ (47_855_000 as Weight)
+ .saturating_add((10_805_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight)))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight)))
}
fn clear_public_proposals() -> Weight {
- (3643000 as Weight)
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ (4_864_000 as Weight)
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn note_preimage(b: u32, ) -> Weight {
- (46629000 as Weight)
- .saturating_add((4000 as Weight).saturating_mul(b as Weight))
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ (66_754_000 as Weight)
+ .saturating_add((4_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn note_imminent_preimage(b: u32, ) -> Weight {
- (31147000 as Weight)
- .saturating_add((3000 as Weight).saturating_mul(b as Weight))
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ (44_664_000 as Weight)
+ .saturating_add((3_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn reap_preimage(b: u32, ) -> Weight {
- (42848000 as Weight)
- .saturating_add((3000 as Weight).saturating_mul(b as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ (59_968_000 as Weight)
+ .saturating_add((3_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn unlock_remove(r: u32, ) -> Weight {
- (45333000 as Weight)
- .saturating_add((171000 as Weight).saturating_mul(r as Weight))
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(3 as Weight))
+ (58_573_000 as Weight)
+ .saturating_add((131_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn unlock_set(r: u32, ) -> Weight {
- (44424000 as Weight)
- .saturating_add((291000 as Weight).saturating_mul(r as Weight))
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(3 as Weight))
+ (53_831_000 as Weight)
+ .saturating_add((324_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn remove_vote(r: u32, ) -> Weight {
- (28250000 as Weight)
- .saturating_add((283000 as Weight).saturating_mul(r as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
+ (31_846_000 as Weight)
+ .saturating_add((327_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn remove_other_vote(r: u32, ) -> Weight {
- (28250000 as Weight)
- .saturating_add((283000 as Weight).saturating_mul(r as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
+ (31_880_000 as Weight)
+ .saturating_add((222_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
}
}
diff --git a/bin/node/runtime/src/weights/pallet_elections_phragmen.rs b/bin/node/runtime/src/weights/pallet_elections_phragmen.rs
new file mode 100644
index 0000000000000000000000000000000000000000..8da9838d5d7a104ae461c5dc03e9ca04907d9c73
--- /dev/null
+++ b/bin/node/runtime/src/weights/pallet_elections_phragmen.rs
@@ -0,0 +1,90 @@
+// This file is part of Substrate.
+
+// Copyright (C) 2019-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::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
+
+pub struct WeightInfo(PhantomData);
+impl pallet_elections_phragmen::WeightInfo for WeightInfo {
+ fn vote(v: u32, ) -> Weight {
+ (91_489_000 as Weight)
+ .saturating_add((199_000 as Weight).saturating_mul(v as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn vote_update(v: u32, ) -> Weight {
+ (56_511_000 as Weight)
+ .saturating_add((245_000 as Weight).saturating_mul(v as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn remove_voter() -> Weight {
+ (76_714_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn report_defunct_voter_correct(c: u32, v: u32, ) -> Weight {
+ (0 as Weight)
+ .saturating_add((1_743_000 as Weight).saturating_mul(c as Weight))
+ .saturating_add((31_750_000 as Weight).saturating_mul(v as Weight))
+ .saturating_add(T::DbWeight::get().reads(7 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
+ }
+ fn report_defunct_voter_incorrect(c: u32, v: u32, ) -> Weight {
+ (0 as Weight)
+ .saturating_add((1_733_000 as Weight).saturating_mul(c as Weight))
+ .saturating_add((31_861_000 as Weight).saturating_mul(v as Weight))
+ .saturating_add(T::DbWeight::get().reads(6 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn submit_candidacy(c: u32, ) -> Weight {
+ (74_714_000 as Weight)
+ .saturating_add((315_000 as Weight).saturating_mul(c as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn renounce_candidacy_candidate(c: u32, ) -> Weight {
+ (50_408_000 as Weight)
+ .saturating_add((159_000 as Weight).saturating_mul(c as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn renounce_candidacy_members() -> Weight {
+ (79_626_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(4 as Weight))
+ }
+ fn renounce_candidacy_runners_up() -> Weight {
+ (49_715_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn remove_member_with_replacement() -> Weight {
+ (76_572_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes(5 as Weight))
+ }
+ fn remove_member_wrong_refund() -> Weight {
+ (8_777_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ }
+}
diff --git a/bin/node/runtime/src/weights/pallet_identity.rs b/bin/node/runtime/src/weights/pallet_identity.rs
new file mode 100644
index 0000000000000000000000000000000000000000..a43b63c0fb04120c97fdba490e66e1ccf80eee0b
--- /dev/null
+++ b/bin/node/runtime/src/weights/pallet_identity.rs
@@ -0,0 +1,137 @@
+// This file is part of Substrate.
+
+// Copyright (C) 2019-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::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
+
+pub struct WeightInfo(PhantomData);
+impl pallet_identity::WeightInfo for WeightInfo {
+ fn add_registrar(r: u32, ) -> Weight {
+ (39_603_000 as Weight)
+ .saturating_add((418_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn set_identity(r: u32, x: u32, ) -> Weight {
+ (110_679_000 as Weight)
+ .saturating_add((389_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add((2_985_000 as Weight).saturating_mul(x as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn set_subs_new(s: u32, ) -> Weight {
+ (78_697_000 as Weight)
+ .saturating_add((15_225_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
+ }
+ fn set_subs_old(p: u32, ) -> Weight {
+ (71_308_000 as Weight)
+ .saturating_add((5_772_000 as Weight).saturating_mul(p as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
+ }
+ fn clear_identity(r: u32, s: u32, x: u32, ) -> Weight {
+ (91_553_000 as Weight)
+ .saturating_add((284_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add((5_749_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add((1_621_000 as Weight).saturating_mul(x as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
+ }
+ fn request_judgement(r: u32, x: u32, ) -> Weight {
+ (110_856_000 as Weight)
+ .saturating_add((496_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add((3_221_000 as Weight).saturating_mul(x as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn cancel_request(r: u32, x: u32, ) -> Weight {
+ (96_857_000 as Weight)
+ .saturating_add((311_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add((3_204_000 as Weight).saturating_mul(x as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn set_fee(r: u32, ) -> Weight {
+ (16_276_000 as Weight)
+ .saturating_add((381_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn set_account_id(r: u32, ) -> Weight {
+ (18_530_000 as Weight)
+ .saturating_add((391_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn set_fields(r: u32, ) -> Weight {
+ (16_359_000 as Weight)
+ .saturating_add((379_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn provide_judgement(r: u32, x: u32, ) -> Weight {
+ (72_869_000 as Weight)
+ .saturating_add((423_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add((3_187_000 as Weight).saturating_mul(x as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn kill_identity(r: u32, s: u32, x: u32, ) -> Weight {
+ (123_199_000 as Weight)
+ .saturating_add((71_000 as Weight).saturating_mul(r as Weight))
+ .saturating_add((5_730_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add((2_000 as Weight).saturating_mul(x as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
+ }
+ fn add_sub(s: u32, ) -> Weight {
+ (110_070_000 as Weight)
+ .saturating_add((262_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn rename_sub(s: u32, ) -> Weight {
+ (37_130_000 as Weight)
+ .saturating_add((79_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn remove_sub(s: u32, ) -> Weight {
+ (103_295_000 as Weight)
+ .saturating_add((235_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn quit_sub(s: u32, ) -> Weight {
+ (65_716_000 as Weight)
+ .saturating_add((227_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+}
diff --git a/bin/node/runtime/src/weights/pallet_im_online.rs b/bin/node/runtime/src/weights/pallet_im_online.rs
new file mode 100644
index 0000000000000000000000000000000000000000..a85672da51c5a4a54dea8c8f47ae1eef29f494c2
--- /dev/null
+++ b/bin/node/runtime/src/weights/pallet_im_online.rs
@@ -0,0 +1,35 @@
+// 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::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
+
+pub struct WeightInfo(PhantomData);
+impl pallet_im_online::WeightInfo for WeightInfo {
+ fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight {
+ (139830000 as Weight)
+ .saturating_add((211000 as Weight).saturating_mul(k as Weight))
+ .saturating_add((654000 as Weight).saturating_mul(e as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+}
diff --git a/bin/node/runtime/src/weights/pallet_indices.rs b/bin/node/runtime/src/weights/pallet_indices.rs
new file mode 100644
index 0000000000000000000000000000000000000000..e8845f335289666832c707e7e3885aec3a7c91ed
--- /dev/null
+++ b/bin/node/runtime/src/weights/pallet_indices.rs
@@ -0,0 +1,53 @@
+// This file is part of Substrate.
+
+// Copyright (C) 2017-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::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
+
+pub struct WeightInfo(PhantomData);
+impl pallet_indices::WeightInfo for WeightInfo {
+ fn claim() -> Weight {
+ (56_237_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn transfer() -> Weight {
+ (63_665_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn free() -> Weight {
+ (50_736_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn force_transfer() -> Weight {
+ (52_361_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn freeze() -> Weight {
+ (46_483_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+}
diff --git a/bin/node/runtime/src/weights/pallet_multisig.rs b/bin/node/runtime/src/weights/pallet_multisig.rs
new file mode 100644
index 0000000000000000000000000000000000000000..0af7c7c75e1ea45824212ed45c1178a815a53a82
--- /dev/null
+++ b/bin/node/runtime/src/weights/pallet_multisig.rs
@@ -0,0 +1,91 @@
+// This file is part of Substrate.
+
+// Copyright (C) 2019-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::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
+
+pub struct WeightInfo(PhantomData);
+impl pallet_multisig::WeightInfo for WeightInfo {
+ fn as_multi_threshold_1(z: u32, ) -> Weight {
+ (17_161_000 as Weight)
+ .saturating_add((1_000 as Weight).saturating_mul(z as Weight))
+ }
+ fn as_multi_create(s: u32, z: u32, ) -> Weight {
+ (79_857_000 as Weight)
+ .saturating_add((131_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add((1_000 as Weight).saturating_mul(z as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn as_multi_create_store(s: u32, z: u32, ) -> Weight {
+ (90_218_000 as Weight)
+ .saturating_add((129_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add((3_000 as Weight).saturating_mul(z as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn as_multi_approve(s: u32, z: u32, ) -> Weight {
+ (48_402_000 as Weight)
+ .saturating_add((132_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add((1_000 as Weight).saturating_mul(z as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn as_multi_approve_store(s: u32, z: u32, ) -> Weight {
+ (88_390_000 as Weight)
+ .saturating_add((120_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add((3_000 as Weight).saturating_mul(z as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn as_multi_complete(s: u32, z: u32, ) -> Weight {
+ (98_960_000 as Weight)
+ .saturating_add((276_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add((6_000 as Weight).saturating_mul(z as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
+ }
+ fn approve_as_multi_create(s: u32, ) -> Weight {
+ (80_185_000 as Weight)
+ .saturating_add((121_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn approve_as_multi_approve(s: u32, ) -> Weight {
+ (48_386_000 as Weight)
+ .saturating_add((143_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn approve_as_multi_complete(s: u32, ) -> Weight {
+ (177_181_000 as Weight)
+ .saturating_add((273_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
+ }
+ fn cancel_as_multi(s: u32, ) -> Weight {
+ (126_334_000 as Weight)
+ .saturating_add((124_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+}
diff --git a/bin/node/runtime/src/weights/pallet_proxy.rs b/bin/node/runtime/src/weights/pallet_proxy.rs
index 92c43cd4853a215edade20d9b281e20ee8559663..c43b5db14ed956d8f924d5de6ed46aea8330f381 100644
--- a/bin/node/runtime/src/weights/pallet_proxy.rs
+++ b/bin/node/runtime/src/weights/pallet_proxy.rs
@@ -15,71 +15,72 @@
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc5
-use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
+use frame_support::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
-pub struct WeightInfo;
-impl pallet_proxy::WeightInfo for WeightInfo {
+pub struct WeightInfo(PhantomData);
+impl pallet_proxy::WeightInfo for WeightInfo {
fn proxy(p: u32, ) -> Weight {
(26127000 as Weight)
.saturating_add((214000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
}
fn proxy_announced(a: u32, p: u32, ) -> Weight {
(55405000 as Weight)
.saturating_add((774000 as Weight).saturating_mul(a as Weight))
.saturating_add((209000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn remove_announcement(a: u32, p: u32, ) -> Weight {
(35879000 as Weight)
.saturating_add((783000 as Weight).saturating_mul(a as Weight))
.saturating_add((20000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn reject_announcement(a: u32, p: u32, ) -> Weight {
(36097000 as Weight)
.saturating_add((780000 as Weight).saturating_mul(a as Weight))
.saturating_add((12000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn announce(a: u32, p: u32, ) -> Weight {
(53769000 as Weight)
.saturating_add((675000 as Weight).saturating_mul(a as Weight))
.saturating_add((214000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn add_proxy(p: u32, ) -> Weight {
(36082000 as Weight)
.saturating_add((234000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn remove_proxy(p: u32, ) -> Weight {
(32885000 as Weight)
.saturating_add((267000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn remove_proxies(p: u32, ) -> Weight {
(31735000 as Weight)
.saturating_add((215000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn anonymous(p: u32, ) -> Weight {
(50907000 as Weight)
.saturating_add((61000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn kill_anonymous(p: u32, ) -> Weight {
(33926000 as Weight)
.saturating_add((208000 as Weight).saturating_mul(p as Weight))
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
}
diff --git a/bin/node/runtime/src/weights/pallet_scheduler.rs b/bin/node/runtime/src/weights/pallet_scheduler.rs
new file mode 100644
index 0000000000000000000000000000000000000000..895a282488313adc837384e2ab6c77c22232261f
--- /dev/null
+++ b/bin/node/runtime/src/weights/pallet_scheduler.rs
@@ -0,0 +1,52 @@
+// 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::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
+
+pub struct WeightInfo(PhantomData);
+impl pallet_scheduler::WeightInfo for WeightInfo {
+ fn schedule(s: u32, ) -> Weight {
+ (37_835_000 as Weight)
+ .saturating_add((81_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn cancel(s: u32, ) -> Weight {
+ (34_707_000 as Weight)
+ .saturating_add((3_125_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn schedule_named(s: u32, ) -> Weight {
+ (48_065_000 as Weight)
+ .saturating_add((110_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn cancel_named(s: u32, ) -> Weight {
+ (38_776_000 as Weight)
+ .saturating_add((3_138_000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+}
diff --git a/bin/node/runtime/src/weights/pallet_session.rs b/bin/node/runtime/src/weights/pallet_session.rs
new file mode 100644
index 0000000000000000000000000000000000000000..1ca5c29237b4ef3f325af6f4073f47a431b7fc92
--- /dev/null
+++ b/bin/node/runtime/src/weights/pallet_session.rs
@@ -0,0 +1,38 @@
+// This file is part of Substrate.
+
+// Copyright (C) 2017-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::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
+
+pub struct WeightInfo(PhantomData);
+impl pallet_session::WeightInfo for WeightInfo {
+ fn set_keys() -> Weight {
+ (88_411_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(6 as Weight))
+ .saturating_add(T::DbWeight::get().writes(5 as Weight))
+ }
+ fn purge_keys() -> Weight {
+ (51_843_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(5 as Weight))
+ }
+}
diff --git a/bin/node/runtime/src/weights/pallet_staking.rs b/bin/node/runtime/src/weights/pallet_staking.rs
new file mode 100644
index 0000000000000000000000000000000000000000..a4484a2685949961c848db9f9d59fe8659c7daa1
--- /dev/null
+++ b/bin/node/runtime/src/weights/pallet_staking.rs
@@ -0,0 +1,171 @@
+// This file is part of Substrate.
+
+// Copyright (C) 2017-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.
+
+//! Default weights of pallet-staking.
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc6
+
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+
+use frame_support::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
+
+pub struct WeightInfo(PhantomData);
+impl pallet_staking::WeightInfo for WeightInfo {
+ fn bond() -> Weight {
+ (144278000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().writes(4 as Weight))
+ }
+ fn bond_extra() -> Weight {
+ (110715000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn unbond() -> Weight {
+ (99840000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
+ }
+ fn withdraw_unbonded_update(s: u32, ) -> Weight {
+ (100728000 as Weight)
+ .saturating_add((63000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(5 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
+ }
+ fn withdraw_unbonded_kill(s: u32, ) -> Weight {
+ (168879000 as Weight)
+ .saturating_add((6666000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(7 as Weight))
+ .saturating_add(T::DbWeight::get().writes(8 as Weight))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
+ }
+ fn validate() -> Weight {
+ (35539000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn nominate(n: u32, ) -> Weight {
+ (48596000 as Weight)
+ .saturating_add((308000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn chill() -> Weight {
+ (35144000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn set_payee() -> Weight {
+ (24255000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn set_controller() -> Weight {
+ (52294000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
+ }
+ fn set_validator_count() -> Weight {
+ (5185000 as Weight)
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn force_no_eras() -> Weight {
+ (5907000 as Weight)
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn force_new_era() -> Weight {
+ (5917000 as Weight)
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn force_new_era_always() -> Weight {
+ (5952000 as Weight)
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn set_invulnerables(v: u32, ) -> Weight {
+ (6324000 as Weight)
+ .saturating_add((9000 as Weight).saturating_mul(v as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn force_unstake(s: u32, ) -> Weight {
+ (119691000 as Weight)
+ .saturating_add((6681000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes(8 as Weight))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
+ }
+ fn cancel_deferred_slash(s: u32, ) -> Weight {
+ (5820201000 as Weight)
+ .saturating_add((34672000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn payout_stakers_dead_controller(n: u32, ) -> Weight {
+ (0 as Weight)
+ .saturating_add((92486000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(n as Weight)))
+ }
+ fn payout_stakers_alive_staked(n: u32, ) -> Weight {
+ (0 as Weight)
+ .saturating_add((117324000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight)))
+ .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight)))
+ }
+ fn rebond(l: u32, ) -> Weight {
+ (71316000 as Weight)
+ .saturating_add((142000 as Weight).saturating_mul(l as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
+ }
+ fn set_history_depth(e: u32, ) -> Weight {
+ (0 as Weight)
+ .saturating_add((51901000 as Weight).saturating_mul(e as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight)))
+ }
+ fn reap_stash(s: u32, ) -> Weight {
+ (147166000 as Weight)
+ .saturating_add((6661000 as Weight).saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes(8 as Weight))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
+ }
+ fn new_era(v: u32, n: u32, ) -> Weight {
+ (0 as Weight)
+ .saturating_add((1440459000 as Weight).saturating_mul(v as Weight))
+ .saturating_add((182580000 as Weight).saturating_mul(n as Weight))
+ .saturating_add(T::DbWeight::get().reads(10 as Weight))
+ .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(v as Weight)))
+ .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
+ .saturating_add(T::DbWeight::get().writes(8 as Weight))
+ .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight)))
+ }
+ fn submit_solution_better(v: u32, n: u32, a: u32, w: u32, ) -> Weight {
+ (0 as Weight)
+ .saturating_add((964000 as Weight).saturating_mul(v as Weight))
+ .saturating_add((432000 as Weight).saturating_mul(n as Weight))
+ .saturating_add((204294000 as Weight).saturating_mul(a as Weight))
+ .saturating_add((9546000 as Weight).saturating_mul(w as Weight))
+ .saturating_add(T::DbWeight::get().reads(6 as Weight))
+ .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(a as Weight)))
+ .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(w as Weight)))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+}
diff --git a/bin/node/runtime/src/weights/pallet_timestamp.rs b/bin/node/runtime/src/weights/pallet_timestamp.rs
index cfd5f192d35298b512ee75e4d26acf11355ce3ba..9c363898b7f3b3df2620e5ea763fc8fda2deec2a 100644
--- a/bin/node/runtime/src/weights/pallet_timestamp.rs
+++ b/bin/node/runtime/src/weights/pallet_timestamp.rs
@@ -17,15 +17,16 @@
#![allow(unused_parens)]
-use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
+use frame_support::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
-pub struct WeightInfo;
-impl pallet_timestamp::WeightInfo for WeightInfo {
+pub struct WeightInfo(PhantomData);
+impl pallet_timestamp::WeightInfo for WeightInfo {
// WARNING! Some components were not used: ["t"]
fn set() -> Weight {
(9133000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// WARNING! Some components were not used: ["t"]
fn on_finalize() -> Weight {
diff --git a/bin/node/runtime/src/weights/pallet_treasury.rs b/bin/node/runtime/src/weights/pallet_treasury.rs
new file mode 100644
index 0000000000000000000000000000000000000000..0bf9e6ab784c4ded672cdbd7fd4f3edd9f3b5952
--- /dev/null
+++ b/bin/node/runtime/src/weights/pallet_treasury.rs
@@ -0,0 +1,141 @@
+// 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::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
+
+pub struct WeightInfo(PhantomData);
+impl pallet_treasury::WeightInfo for WeightInfo {
+ fn propose_spend() -> Weight {
+ (79604000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn reject_proposal() -> Weight {
+ (61001000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn approve_proposal() -> Weight {
+ (17835000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::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(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ // WARNING! Some components were not used: ["r"]
+ fn retract_tip() -> Weight {
+ (82970000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::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(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::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(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::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(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::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(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(4 as Weight))
+ }
+ fn approve_bounty() -> Weight {
+ (23063000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn propose_curator() -> Weight {
+ (18890000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn unassign_curator() -> Weight {
+ (66768000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn accept_curator() -> Weight {
+ (69131000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn award_bounty() -> Weight {
+ (48184000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn claim_bounty() -> Weight {
+ (243104000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes(5 as Weight))
+ }
+ fn close_bounty_proposed() -> Weight {
+ (65917000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
+ }
+ fn close_bounty_active() -> Weight {
+ (157232000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(4 as Weight))
+ }
+ fn extend_bounty_expiry() -> Weight {
+ (46216000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::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(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(p as Weight)))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ .saturating_add(T::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(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(b as Weight)))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))
+ }
+}
diff --git a/bin/node/runtime/src/weights/pallet_utility.rs b/bin/node/runtime/src/weights/pallet_utility.rs
index c9ae0d7d2333b19bec65e4f5c1556df65b21e086..2c508ed6cd42d6f0b89c41c811ad88545c4b2f6c 100644
--- a/bin/node/runtime/src/weights/pallet_utility.rs
+++ b/bin/node/runtime/src/weights/pallet_utility.rs
@@ -20,10 +20,11 @@
#![allow(unused_parens)]
#![allow(unused_imports)]
-use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
+use frame_support::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
-pub struct WeightInfo;
-impl pallet_utility::WeightInfo for WeightInfo {
+pub struct WeightInfo(PhantomData);
+impl pallet_utility::WeightInfo for WeightInfo {
fn batch(c: u32, ) -> Weight {
(16461000 as Weight)
.saturating_add((1982000 as Weight).saturating_mul(c as Weight))
diff --git a/bin/node/runtime/src/weights/pallet_vesting.rs b/bin/node/runtime/src/weights/pallet_vesting.rs
new file mode 100644
index 0000000000000000000000000000000000000000..ac63b0177b81cfae6b675adacea0ffb184f2640e
--- /dev/null
+++ b/bin/node/runtime/src/weights/pallet_vesting.rs
@@ -0,0 +1,64 @@
+// 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::{traits::Get, weights::Weight};
+use sp_std::marker::PhantomData;
+
+pub struct WeightInfo(PhantomData);
+impl pallet_vesting::WeightInfo for WeightInfo {
+ fn vest_locked(l: u32, ) -> Weight {
+ (82109000 as Weight)
+ .saturating_add((332000 as Weight).saturating_mul(l as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ fn vest_unlocked(l: u32, ) -> Weight {
+ (88419000 as Weight)
+ .saturating_add((3000 as Weight).saturating_mul(l as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn vest_other_locked(l: u32, ) -> Weight {
+ (81277000 as Weight)
+ .saturating_add((321000 as Weight).saturating_mul(l as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+ fn vest_other_unlocked(l: u32, ) -> Weight {
+ (87584000 as Weight)
+ .saturating_add((19000 as Weight).saturating_mul(l as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
+ }
+ fn vested_transfer(l: u32, ) -> Weight {
+ (185916000 as Weight)
+ .saturating_add((625000 as Weight).saturating_mul(l as Weight))
+ .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ .saturating_add(T::DbWeight::get().writes(3 as Weight))
+ }
+ fn force_vested_transfer(l: u32, ) -> Weight {
+ (185916000 as Weight)
+ .saturating_add((625000 as Weight).saturating_mul(l as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().writes(4 as Weight))
+ }
+}
diff --git a/bin/node/testing/Cargo.toml b/bin/node/testing/Cargo.toml
index 89079d53ece4d8d89322c31ddcd69406bd116ad3..3b541b696815b2837755b8e6533e1f04c730c6ef 100644
--- a/bin/node/testing/Cargo.toml
+++ b/bin/node/testing/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-testing"
-version = "2.0.0-rc6"
+version = "2.0.0"
authors = ["Parity Technologies "]
description = "Test utilities for Substrate node."
edition = "2018"
@@ -13,39 +13,39 @@ publish = true
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-pallet-balances = { version = "2.0.0-rc6", path = "../../../frame/balances" }
-sc-service = { version = "0.8.0-rc6", features = ["test-helpers", "db"], path = "../../../client/service" }
-sc-client-db = { version = "0.8.0-rc6", path = "../../../client/db/", features = ["kvdb-rocksdb", "parity-db"] }
-sc-client-api = { version = "2.0.0-rc6", path = "../../../client/api/" }
+pallet-balances = { version = "2.0.0", path = "../../../frame/balances" }
+sc-service = { version = "0.8.0", features = ["test-helpers", "db"], path = "../../../client/service" }
+sc-client-db = { version = "0.8.0", path = "../../../client/db/", features = ["kvdb-rocksdb", "parity-db"] }
+sc-client-api = { version = "2.0.0", path = "../../../client/api/" }
codec = { package = "parity-scale-codec", version = "1.3.4" }
-pallet-contracts = { version = "2.0.0-rc6", path = "../../../frame/contracts" }
-pallet-grandpa = { version = "2.0.0-rc6", path = "../../../frame/grandpa" }
-pallet-indices = { version = "2.0.0-rc6", path = "../../../frame/indices" }
-sp-keyring = { version = "2.0.0-rc6", path = "../../../primitives/keyring" }
-node-executor = { version = "2.0.0-rc6", path = "../executor" }
-node-primitives = { version = "2.0.0-rc6", path = "../primitives" }
-node-runtime = { version = "2.0.0-rc6", path = "../runtime" }
-sp-core = { version = "2.0.0-rc6", path = "../../../primitives/core" }
-sp-io = { version = "2.0.0-rc6", path = "../../../primitives/io" }
-frame-support = { version = "2.0.0-rc6", path = "../../../frame/support" }
-pallet-session = { version = "2.0.0-rc6", path = "../../../frame/session" }
-pallet-society = { version = "2.0.0-rc6", path = "../../../frame/society" }
-sp-runtime = { version = "2.0.0-rc6", path = "../../../primitives/runtime" }
-pallet-staking = { version = "2.0.0-rc6", path = "../../../frame/staking" }
-sc-executor = { version = "0.8.0-rc6", path = "../../../client/executor", features = ["wasmtime"] }
-sp-consensus = { version = "0.8.0-rc6", path = "../../../primitives/consensus/common" }
-frame-system = { version = "2.0.0-rc6", path = "../../../frame/system" }
-substrate-test-client = { version = "2.0.0-rc6", path = "../../../test-utils/client" }
-pallet-timestamp = { version = "2.0.0-rc6", path = "../../../frame/timestamp" }
-pallet-transaction-payment = { version = "2.0.0-rc6", path = "../../../frame/transaction-payment" }
-pallet-treasury = { version = "2.0.0-rc6", path = "../../../frame/treasury" }
-sp-api = { version = "2.0.0-rc6", path = "../../../primitives/api" }
-sp-finality-tracker = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/finality-tracker" }
-sp-timestamp = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/timestamp" }
-sp-block-builder = { version = "2.0.0-rc6", path = "../../../primitives/block-builder" }
-sc-block-builder = { version = "0.8.0-rc6", path = "../../../client/block-builder" }
-sp-inherents = { version = "2.0.0-rc6", path = "../../../primitives/inherents" }
-sp-blockchain = { version = "2.0.0-rc6", path = "../../../primitives/blockchain" }
+pallet-contracts = { version = "2.0.0", path = "../../../frame/contracts" }
+pallet-grandpa = { version = "2.0.0", path = "../../../frame/grandpa" }
+pallet-indices = { version = "2.0.0", path = "../../../frame/indices" }
+sp-keyring = { version = "2.0.0", path = "../../../primitives/keyring" }
+node-executor = { version = "2.0.0", path = "../executor" }
+node-primitives = { version = "2.0.0", path = "../primitives" }
+node-runtime = { version = "2.0.0", path = "../runtime" }
+sp-core = { version = "2.0.0", path = "../../../primitives/core" }
+sp-io = { version = "2.0.0", path = "../../../primitives/io" }
+frame-support = { version = "2.0.0", path = "../../../frame/support" }
+pallet-session = { version = "2.0.0", path = "../../../frame/session" }
+pallet-society = { version = "2.0.0", path = "../../../frame/society" }
+sp-runtime = { version = "2.0.0", path = "../../../primitives/runtime" }
+pallet-staking = { version = "2.0.0", path = "../../../frame/staking" }
+sc-executor = { version = "0.8.0", path = "../../../client/executor", features = ["wasmtime"] }
+sp-consensus = { version = "0.8.0", path = "../../../primitives/consensus/common" }
+frame-system = { version = "2.0.0", path = "../../../frame/system" }
+substrate-test-client = { version = "2.0.0", path = "../../../test-utils/client" }
+pallet-timestamp = { version = "2.0.0", path = "../../../frame/timestamp" }
+pallet-transaction-payment = { version = "2.0.0", path = "../../../frame/transaction-payment" }
+pallet-treasury = { version = "2.0.0", path = "../../../frame/treasury" }
+sp-api = { version = "2.0.0", path = "../../../primitives/api" }
+sp-finality-tracker = { version = "2.0.0", default-features = false, path = "../../../primitives/finality-tracker" }
+sp-timestamp = { version = "2.0.0", default-features = false, path = "../../../primitives/timestamp" }
+sp-block-builder = { version = "2.0.0", path = "../../../primitives/block-builder" }
+sc-block-builder = { version = "0.8.0", path = "../../../client/block-builder" }
+sp-inherents = { version = "2.0.0", path = "../../../primitives/inherents" }
+sp-blockchain = { version = "2.0.0", path = "../../../primitives/blockchain" }
log = "0.4.8"
tempfile = "3.1.0"
fs_extra = "1"
@@ -53,4 +53,4 @@ futures = "0.3.1"
[dev-dependencies]
criterion = "0.3.0"
-sc-cli = { version = "0.8.0-rc6", path = "../../../client/cli" }
+sc-cli = { version = "0.8.0", path = "../../../client/cli" }
diff --git a/bin/node/testing/src/bench.rs b/bin/node/testing/src/bench.rs
index 8242886fe95ed5662bdd81f37de030cff56d5af2..07bf2bf57abd1219c4de5ea28df634288f1a7f5d 100644
--- a/bin/node/testing/src/bench.rs
+++ b/bin/node/testing/src/bench.rs
@@ -88,6 +88,61 @@ impl BenchPair {
}
}
+/// Drop system cache.
+///
+/// Will panic if cache drop is impossbile.
+pub fn drop_system_cache() {
+ #[cfg(target_os = "windows")] {
+ log::warn!(
+ target: "bench-logistics",
+ "Clearing system cache on windows is not supported. Benchmark might totally be wrong.",
+ );
+ return;
+ }
+
+ std::process::Command::new("sync")
+ .output()
+ .expect("Failed to execute system cache clear");
+
+ #[cfg(target_os = "linux")] {
+ log::trace!(target: "bench-logistics", "Clearing system cache...");
+ std::process::Command::new("echo")
+ .args(&["3", ">", "/proc/sys/vm/drop_caches", "2>", "/dev/null"])
+ .output()
+ .expect("Failed to execute system cache clear");
+
+ let temp = tempfile::tempdir().expect("Failed to spawn tempdir");
+ let temp_file_path = format!("of={}/buf", temp.path().to_string_lossy());
+
+ // this should refill write cache with 2GB of garbage
+ std::process::Command::new("dd")
+ .args(&["if=/dev/urandom", &temp_file_path, "bs=64M", "count=32"])
+ .output()
+ .expect("Failed to execute dd for cache clear");
+
+ // remove tempfile of previous command
+ std::process::Command::new("rm")
+ .arg(&temp_file_path)
+ .output()
+ .expect("Failed to remove temp file");
+
+ std::process::Command::new("sync")
+ .output()
+ .expect("Failed to execute system cache clear");
+
+ log::trace!(target: "bench-logistics", "Clearing system cache done!");
+ }
+
+ #[cfg(target_os = "macos")] {
+ log::trace!(target: "bench-logistics", "Clearing system cache...");
+ if let Err(err) = std::process::Command::new("purge").output() {
+ log::error!("purge error {:?}: ", err);
+ panic!("Could not clear system cache. Run under sudo?");
+ }
+ log::trace!(target: "bench-logistics", "Clearing system cache done!");
+ }
+}
+
/// Pre-initialized benchmarking database.
///
/// This is prepared database with genesis and keyring
@@ -124,6 +179,13 @@ impl Clone for BenchDb {
&fs_extra::dir::CopyOptions::new(),
).expect("Copy of seed database is ok");
+ // We clear system cache after db clone but before any warmups.
+ // This populates system cache with some data unrelated to actual
+ // data we will be quering further under benchmark (like what
+ // would have happened in real system that queries random entries
+ // from database).
+ drop_system_cache();
+
BenchDb { keyring, directory_guard: Guard(dir), database_type }
}
}
diff --git a/bin/utils/chain-spec-builder/Cargo.toml b/bin/utils/chain-spec-builder/Cargo.toml
index f6d03d4f3d107ce268f2d84efce197cdd1688659..a57dadd26bda88df7a0bc495a388c28f17539130 100644
--- a/bin/utils/chain-spec-builder/Cargo.toml
+++ b/bin/utils/chain-spec-builder/Cargo.toml
@@ -1,21 +1,23 @@
[package]
name = "chain-spec-builder"
-version = "2.0.0-rc6"
+version = "2.0.0"
authors = ["Parity Technologies "]
edition = "2018"
build = "build.rs"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"
+readme = "README.md"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
ansi_term = "0.12.1"
-sc-keystore = { version = "2.0.0-rc6", path = "../../../client/keystore" }
-sc-chain-spec = { version = "2.0.0-rc6", path = "../../../client/chain-spec" }
-node-cli = { version = "2.0.0-rc6", path = "../../node/cli" }
-sp-core = { version = "2.0.0-rc6", path = "../../../primitives/core" }
+sc-keystore = { version = "2.0.0", path = "../../../client/keystore" }
+sc-chain-spec = { version = "2.0.0", path = "../../../client/chain-spec" }
+node-cli = { version = "2.0.0", path = "../../node/cli" }
+sp-core = { version = "2.0.0", path = "../../../primitives/core" }
+sp-keystore = { version = "0.8.0", path = "../../../primitives/keystore" }
rand = "0.7.2"
structopt = "0.3.8"
diff --git a/bin/utils/chain-spec-builder/src/main.rs b/bin/utils/chain-spec-builder/src/main.rs
index 2bfbb0952775d9b138d8014b1be342785ed892f6..c2db944050eb452708e50001edaeb609bbc0057c 100644
--- a/bin/utils/chain-spec-builder/src/main.rs
+++ b/bin/utils/chain-spec-builder/src/main.rs
@@ -16,15 +16,19 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-use std::{fs, path::{Path, PathBuf}};
+use std::{fs, path::{Path, PathBuf}, sync::Arc};
use ansi_term::Style;
use rand::{Rng, distributions::Alphanumeric, rngs::OsRng};
use structopt::StructOpt;
-use sc_keystore::{Store as Keystore};
+use sc_keystore::LocalKeystore;
use node_cli::chain_spec::{self, AccountId};
-use sp_core::{sr25519, crypto::{Public, Ss58Codec}, traits::BareCryptoStore};
+use sp_core::{
+ sr25519,
+ crypto::{Public, Ss58Codec},
+};
+use sp_keystore::{SyncCryptoStorePtr, SyncCryptoStore};
/// A utility to easily create a testnet chain spec definition with a given set
/// of authorities and endowed accounts and/or generate random accounts.
@@ -139,16 +143,17 @@ fn generate_authority_keys_and_store(
keystore_path: &Path,
) -> Result<(), String> {
for (n, seed) in seeds.into_iter().enumerate() {
- let keystore = Keystore::open(
+ let keystore: SyncCryptoStorePtr = Arc::new(LocalKeystore::open(
keystore_path.join(format!("auth-{}", n)),
None,
- ).map_err(|err| err.to_string())?;
+ ).map_err(|err| err.to_string())?);
let (_, _, grandpa, babe, im_online, authority_discovery) =
chain_spec::authority_keys_from_seed(seed);
let insert_key = |key_type, public| {
- keystore.write().insert_unknown(
+ SyncCryptoStore::insert_unknown(
+ &*keystore,
key_type,
&format!("//{}", seed),
public,
diff --git a/bin/utils/subkey/Cargo.toml b/bin/utils/subkey/Cargo.toml
index 0dc1a1b5970c90a22a8a569d3a2e4b072d48ae93..fa0b345bc8406f2f4ea33228276fdb712b1b4845 100644
--- a/bin/utils/subkey/Cargo.toml
+++ b/bin/utils/subkey/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "subkey"
-version = "2.0.0-rc6"
+version = "2.0.0"
authors = ["Parity Technologies "]
edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"
+readme = "README.md"
[[bin]]
path = "src/main.rs"
@@ -15,13 +16,13 @@ name = "subkey"
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-node-runtime = { version = "2.0.0-rc6", path = "../../node/runtime" }
-node-primitives = { version = "2.0.0-rc6", path = "../../node/primitives" }
-sc-cli = { version = "0.8.0-rc6", path = "../../../client/cli" }
-substrate-frame-cli = { version = "2.0.0-rc6", path = "../../../utils/frame/frame-utilities-cli" }
+node-runtime = { version = "2.0.0", path = "../../node/runtime" }
+node-primitives = { version = "2.0.0", path = "../../node/primitives" }
+sc-cli = { version = "0.8.0", path = "../../../client/cli" }
+substrate-frame-cli = { version = "2.0.0", path = "../../../utils/frame/frame-utilities-cli" }
structopt = "0.3.14"
-frame-system = { version = "2.0.0-rc6", path = "../../../frame/system" }
-sp-core = { version = "2.0.0-rc6", path = "../../../primitives/core" }
+frame-system = { version = "2.0.0", path = "../../../frame/system" }
+sp-core = { version = "2.0.0", path = "../../../primitives/core" }
[features]
bench = []
diff --git a/bin/utils/subkey/src/lib.rs b/bin/utils/subkey/src/lib.rs
index 15f7bf538c4b40878de124da7027030e313f76b9..051628e84a193419221d0eccd04f797dc2b56a23 100644
--- a/bin/utils/subkey/src/lib.rs
+++ b/bin/utils/subkey/src/lib.rs
@@ -39,7 +39,7 @@ pub enum Subkey {
Generate(GenerateCmd),
/// Gets a public key and a SS58 address from the provided Secret URI
- InspectKey(InspectKeyCmd),
+ Inspect(InspectKeyCmd),
/// Print the peer ID corresponding to the node key in the given file
InspectNodeKey(InspectNodeKeyCmd),
@@ -69,7 +69,7 @@ pub fn run() -> Result<(), Error>
match Subkey::from_args() {
Subkey::GenerateNodeKey(cmd) => cmd.run()?,
Subkey::Generate(cmd) => cmd.run()?,
- Subkey::InspectKey(cmd) => cmd.run()?,
+ Subkey::Inspect(cmd) => cmd.run()?,
Subkey::InspectNodeKey(cmd) => cmd.run()?,
Subkey::Insert(cmd) => cmd.run()?,
Subkey::ModuleId(cmd) => cmd.run::()?,
diff --git a/client/api/Cargo.toml b/client/api/Cargo.toml
index 8f31e831bebac62d72c2964ea882b95e6040a1f5..d0fb5fc3ee0e2e82034f09f227df63fd1a635060 100644
--- a/client/api/Cargo.toml
+++ b/client/api/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sc-client-api"
-version = "2.0.0-rc6"
+version = "2.0.0"
authors = ["Parity Technologies "]
edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -8,42 +8,44 @@ homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"
description = "Substrate client interfaces."
documentation = "https://docs.rs/sc-client-api"
+readme = "README.md"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = ["derive"] }
-sp-consensus = { version = "0.8.0-rc6", path = "../../primitives/consensus/common" }
+sp-consensus = { version = "0.8.0", path = "../../primitives/consensus/common" }
derive_more = "0.99.2"
-sc-executor = { version = "0.8.0-rc6", path = "../executor" }
-sp-externalities = { version = "0.8.0-rc6", path = "../../primitives/externalities" }
+sc-executor = { version = "0.8.0", path = "../executor" }
+sp-externalities = { version = "0.8.0", path = "../../primitives/externalities" }
fnv = "1.0.6"
futures = "0.3.1"
hash-db = { version = "0.15.2", default-features = false }
-sp-blockchain = { version = "2.0.0-rc6", path = "../../primitives/blockchain" }
+sp-blockchain = { version = "2.0.0", path = "../../primitives/blockchain" }
hex-literal = "0.3.1"
-sp-inherents = { version = "2.0.0-rc6", default-features = false, path = "../../primitives/inherents" }
-sp-keyring = { version = "2.0.0-rc6", path = "../../primitives/keyring" }
+sp-inherents = { version = "2.0.0", default-features = false, path = "../../primitives/inherents" }
+sp-keyring = { version = "2.0.0", path = "../../primitives/keyring" }
kvdb = "0.7.0"
log = "0.4.8"
parking_lot = "0.10.0"
lazy_static = "1.4.0"
-sp-database = { version = "2.0.0-rc6", path = "../../primitives/database" }
-sp-core = { version = "2.0.0-rc6", default-features = false, path = "../../primitives/core" }
-sp-std = { version = "2.0.0-rc6", default-features = false, path = "../../primitives/std" }
-sp-version = { version = "2.0.0-rc6", default-features = false, path = "../../primitives/version" }
-sp-api = { version = "2.0.0-rc6", path = "../../primitives/api" }
-sp-utils = { version = "2.0.0-rc6", path = "../../primitives/utils" }
-sp-runtime = { version = "2.0.0-rc6", default-features = false, path = "../../primitives/runtime" }
-sp-state-machine = { version = "0.8.0-rc6", path = "../../primitives/state-machine" }
-sc-telemetry = { version = "2.0.0-rc6", path = "../telemetry" }
-sp-trie = { version = "2.0.0-rc6", path = "../../primitives/trie" }
-sp-storage = { version = "2.0.0-rc6", path = "../../primitives/storage" }
-sp-transaction-pool = { version = "2.0.0-rc6", path = "../../primitives/transaction-pool" }
-prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.8.0-rc6", path = "../../utils/prometheus" }
+sp-database = { version = "2.0.0", path = "../../primitives/database" }
+sp-core = { version = "2.0.0", default-features = false, path = "../../primitives/core" }
+sp-keystore = { version = "0.8.0", default-features = false, path = "../../primitives/keystore" }
+sp-std = { version = "2.0.0", default-features = false, path = "../../primitives/std" }
+sp-version = { version = "2.0.0", default-features = false, path = "../../primitives/version" }
+sp-api = { version = "2.0.0", path = "../../primitives/api" }
+sp-utils = { version = "2.0.0", path = "../../primitives/utils" }
+sp-runtime = { version = "2.0.0", default-features = false, path = "../../primitives/runtime" }
+sp-state-machine = { version = "0.8.0", path = "../../primitives/state-machine" }
+sc-telemetry = { version = "2.0.0", path = "../telemetry" }
+sp-trie = { version = "2.0.0", path = "../../primitives/trie" }
+sp-storage = { version = "2.0.0", path = "../../primitives/storage" }
+sp-transaction-pool = { version = "2.0.0", path = "../../primitives/transaction-pool" }
+prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.8.0", path = "../../utils/prometheus" }
[dev-dependencies]
kvdb-memorydb = "0.7.0"
-sp-test-primitives = { version = "2.0.0-rc6", path = "../../primitives/test-primitives" }
-substrate-test-runtime = { version = "2.0.0-rc6", path = "../../test-utils/runtime" }
+sp-test-primitives = { version = "2.0.0", path = "../../primitives/test-primitives" }
+substrate-test-runtime = { version = "2.0.0", path = "../../test-utils/runtime" }
diff --git a/client/api/src/execution_extensions.rs b/client/api/src/execution_extensions.rs
index 4f2ddb77e6653a056fcfd1647cfacdf6afbbec54..4fdd897b215797c2eae07ca503c0df6e063e7942 100644
--- a/client/api/src/execution_extensions.rs
+++ b/client/api/src/execution_extensions.rs
@@ -25,8 +25,8 @@ use codec::Decode;
use sp_core::{
ExecutionContext,
offchain::{self, OffchainExt, TransactionPoolExt},
- traits::{BareCryptoStorePtr, KeystoreExt},
};
+use sp_keystore::{KeystoreExt, SyncCryptoStorePtr};
use sp_runtime::{
generic::BlockId,
traits,
@@ -81,7 +81,7 @@ impl ExtensionsFactory for () {
/// for each call, based on required `Capabilities`.
pub struct ExecutionExtensions {
strategies: ExecutionStrategies,
- keystore: Option,
+ keystore: Option,
// FIXME: these two are only RwLock because of https://github.com/paritytech/substrate/issues/4587
// remove when fixed.
// To break retain cycle between `Client` and `TransactionPool` we require this
@@ -107,11 +107,16 @@ impl ExecutionExtensions {
/// Create new `ExecutionExtensions` given a `keystore` and `ExecutionStrategies`.
pub fn new(
strategies: ExecutionStrategies,
- keystore: Option,
+ keystore: Option,
) -> Self {
let transaction_pool = RwLock::new(None);
let extensions_factory = Box::new(());
- Self { strategies, keystore, extensions_factory: RwLock::new(extensions_factory), transaction_pool }
+ Self {
+ strategies,
+ keystore,
+ extensions_factory: RwLock::new(extensions_factory),
+ transaction_pool,
+ }
}
/// Get a reference to the execution strategies.
@@ -161,23 +166,27 @@ impl ExecutionExtensions {
let mut extensions = self.extensions_factory.read().extensions_for(capabilities);
if capabilities.has(offchain::Capability::Keystore) {
- if let Some(keystore) = self.keystore.as_ref() {
+ if let Some(ref keystore) = self.keystore {
extensions.register(KeystoreExt(keystore.clone()));
}
}
if capabilities.has(offchain::Capability::TransactionPool) {
if let Some(pool) = self.transaction_pool.read().as_ref().and_then(|x| x.upgrade()) {
- extensions.register(TransactionPoolExt(Box::new(TransactionPoolAdapter {
- at: *at,
- pool,
- }) as _));
+ extensions.register(
+ TransactionPoolExt(
+ Box::new(TransactionPoolAdapter {
+ at: *at,
+ pool,
+ }) as _
+ ),
+ );
}
}
if let ExecutionContext::OffchainCall(Some(ext)) = context {
extensions.register(
- OffchainExt::new(offchain::LimitedExternalities::new(capabilities, ext.0))
+ OffchainExt::new(offchain::LimitedExternalities::new(capabilities, ext.0)),
);
}
diff --git a/client/authority-discovery/Cargo.toml b/client/authority-discovery/Cargo.toml
index e2be0f68e2318fee6a1a33cde09d26e244fbfff0..0e5c22380ded217105db87d53617028fb1f17d47 100644
--- a/client/authority-discovery/Cargo.toml
+++ b/client/authority-discovery/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sc-authority-discovery"
-version = "0.8.0-rc6"
+version = "0.8.0"
authors = ["Parity Technologies "]
edition = "2018"
build = "build.rs"
@@ -8,6 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"
description = "Substrate authority discovery."
+readme = "README.md"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -24,21 +25,22 @@ futures = "0.3.4"
futures-timer = "3.0.1"
libp2p = { version = "0.28.1", default-features = false, features = ["kad"] }
log = "0.4.8"
-prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus", version = "0.8.0-rc6"}
+prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus", version = "0.8.0"}
prost = "0.6.1"
rand = "0.7.2"
-sc-client-api = { version = "2.0.0-rc6", path = "../api" }
-sc-keystore = { version = "2.0.0-rc6", path = "../keystore" }
-sc-network = { version = "0.8.0-rc6", path = "../network" }
+sc-client-api = { version = "2.0.0", path = "../api" }
+sc-keystore = { version = "2.0.0", path = "../keystore" }
+sc-network = { version = "0.8.0", path = "../network" }
serde_json = "1.0.41"
-sp-authority-discovery = { version = "2.0.0-rc6", path = "../../primitives/authority-discovery" }
-sp-blockchain = { version = "2.0.0-rc6", path = "../../primitives/blockchain" }
-sp-core = { version = "2.0.0-rc6", path = "../../primitives/core" }
-sp-runtime = { version = "2.0.0-rc6", path = "../../primitives/runtime" }
-sp-api = { version = "2.0.0-rc6", path = "../../primitives/api" }
+sp-authority-discovery = { version = "2.0.0", path = "../../primitives/authority-discovery" }
+sp-blockchain = { version = "2.0.0", path = "../../primitives/blockchain" }
+sp-core = { version = "2.0.0", path = "../../primitives/core" }
+sp-keystore = { version = "0.8.0", path = "../../primitives/keystore" }
+sp-runtime = { version = "2.0.0", path = "../../primitives/runtime" }
+sp-api = { version = "2.0.0", path = "../../primitives/api" }
[dev-dependencies]
-env_logger = "0.7.0"
quickcheck = "0.9.0"
-sc-peerset = { version = "2.0.0-rc6", path = "../peerset" }
-substrate-test-runtime-client = { version = "2.0.0-rc6", path = "../../test-utils/runtime/client"}
+sp-tracing = { version = "2.0.0", path = "../../primitives/tracing" }
+sc-peerset = { version = "2.0.0", path = "../peerset" }
+substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client"}
diff --git a/client/authority-discovery/src/lib.rs b/client/authority-discovery/src/lib.rs
index 347deb8d9fc5d99f421d70c2d99623652ef7418a..42cf120d70f8abb0d71f75b9a350a3b92856d0d5 100644
--- a/client/authority-discovery/src/lib.rs
+++ b/client/authority-discovery/src/lib.rs
@@ -15,7 +15,7 @@
// along with Substrate. If not, see .
#![warn(missing_docs)]
-
+#![recursion_limit = "1024"]
//! Substrate authority discovery.
//!
//! This crate enables Substrate authorities to discover and directly connect to
@@ -26,7 +26,6 @@
pub use crate::{service::Service, worker::{NetworkProvider, Worker, Role}};
-use std::pin::Pin;
use std::sync::Arc;
use futures::channel::{mpsc, oneshot};
@@ -45,19 +44,20 @@ mod tests;
mod worker;
/// Create a new authority discovery [`Worker`] and [`Service`].
-pub fn new_worker_and_service(
+pub fn new_worker_and_service(
client: Arc,
network: Arc,
sentry_nodes: Vec,
- dht_event_rx: Pin + Send>>,
+ dht_event_rx: DhtEventStream,
role: Role,
prometheus_registry: Option,
-) -> (Worker, Service)
+) -> (Worker