Update to `monthly-2021-11` (#259)

* file changes from upstream

* fix cargo for monthly-2021-11
main
Dan Shields 2021-11-07 21:41:04 +01:00 committed by GitHub
parent 1ea08839ae
commit d8063c4171
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 452 additions and 690 deletions

814
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,8 @@
[profile.release]
panic = 'unwind'
[workspace] [workspace]
members = [ members = [
'node', 'node',
'pallets/template', 'pallets/template',
'runtime', 'runtime',
] ]
[profile.release]
panic = 'unwind'

View File

@ -1,6 +1,6 @@
[package] [package]
name = 'node-template' name = 'node-template'
version = '3.0.0-monthly-2021-10' version = '4.0.0-dev'
description = 'A fresh FRAME-based Substrate node, ready for hacking.' description = 'A fresh FRAME-based Substrate node, ready for hacking.'
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>'] authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
homepage = 'https://substrate.io/' homepage = 'https://substrate.io/'
@ -18,12 +18,12 @@ targets = ['x86_64-unknown-linux-gnu']
[build-dependencies.substrate-build-script-utils] [build-dependencies.substrate-build-script-utils]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '3.0.0' version = '3.0.0'
[dependencies.node-template-runtime] [dependencies.node-template-runtime]
path = '../runtime' path = '../runtime'
version = '3.0.0-monthly-2021-10' version = '4.0.0-dev'
[dependencies] [dependencies]
jsonrpc-core = '18.0.0' jsonrpc-core = '18.0.0'
@ -31,140 +31,140 @@ structopt = '0.3.8'
[dependencies.frame-benchmarking] [dependencies.frame-benchmarking]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.frame-benchmarking-cli] [dependencies.frame-benchmarking-cli]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.pallet-transaction-payment-rpc] [dependencies.pallet-transaction-payment-rpc]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sc-basic-authorship] [dependencies.sc-basic-authorship]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '0.10.0-dev' version = '0.10.0-dev'
[dependencies.sc-cli] [dependencies.sc-cli]
features = ['wasmtime'] features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '0.10.0-dev' version = '0.10.0-dev'
[dependencies.sc-client-api] [dependencies.sc-client-api]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sc-consensus] [dependencies.sc-consensus]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '0.10.0-dev' version = '0.10.0-dev'
[dependencies.sc-consensus-aura] [dependencies.sc-consensus-aura]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '0.10.0-dev' version = '0.10.0-dev'
[dependencies.sc-executor] [dependencies.sc-executor]
features = ['wasmtime'] features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '0.10.0-dev' version = '0.10.0-dev'
[dependencies.sc-finality-grandpa] [dependencies.sc-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '0.10.0-dev' version = '0.10.0-dev'
[dependencies.sc-keystore] [dependencies.sc-keystore]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sc-rpc] [dependencies.sc-rpc]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sc-rpc-api] [dependencies.sc-rpc-api]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '0.10.0-dev' version = '0.10.0-dev'
[dependencies.sc-service] [dependencies.sc-service]
features = ['wasmtime'] features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '0.10.0-dev' version = '0.10.0-dev'
[dependencies.sc-telemetry] [dependencies.sc-telemetry]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sc-transaction-pool] [dependencies.sc-transaction-pool]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sc-transaction-pool-api] [dependencies.sc-transaction-pool-api]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-api] [dependencies.sp-api]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-block-builder] [dependencies.sp-block-builder]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-blockchain] [dependencies.sp-blockchain]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-consensus] [dependencies.sp-consensus]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '0.10.0-dev' version = '0.10.0-dev'
[dependencies.sp-consensus-aura] [dependencies.sp-consensus-aura]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '0.10.0-dev' version = '0.10.0-dev'
[dependencies.sp-core] [dependencies.sp-core]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-finality-grandpa] [dependencies.sp-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-runtime] [dependencies.sp-runtime]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-timestamp] [dependencies.sp-timestamp]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.substrate-frame-rpc-system] [dependencies.substrate-frame-rpc-system]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[features] [features]

View File

@ -150,5 +150,6 @@ fn testnet_genesis(
// Assign network admin rights. // Assign network admin rights.
key: root_key, key: root_key,
}, },
transaction_payment: Default::default(),
} }
} }

View File

@ -4,7 +4,7 @@ use crate::{
service, service,
}; };
use node_template_runtime::Block; use node_template_runtime::Block;
use sc_cli::{ChainSpec, Role, RuntimeVersion, SubstrateCli}; use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli};
use sc_service::PartialComponents; use sc_service::PartialComponents;
impl SubstrateCli for Cli { impl SubstrateCli for Cli {
@ -111,11 +111,7 @@ pub fn run() -> sc_cli::Result<()> {
None => { None => {
let runner = cli.create_runner(&cli.run)?; let runner = cli.create_runner(&cli.run)?;
runner.run_node_until_exit(|config| async move { runner.run_node_until_exit(|config| async move {
match config.role { service::new_full(config).map_err(sc_cli::Error::Service)
Role::Light => service::new_light(config),
_ => service::new_full(config),
}
.map_err(sc_cli::Error::Service)
}) })
}, },
} }

View File

@ -1,7 +1,7 @@
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service. //! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
use node_template_runtime::{self, opaque::Block, RuntimeApi}; use node_template_runtime::{self, opaque::Block, RuntimeApi};
use sc_client_api::{ExecutorProvider, RemoteBackend}; use sc_client_api::ExecutorProvider;
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
pub use sc_executor::NativeElseWasmExecutor; pub use sc_executor::NativeElseWasmExecutor;
use sc_finality_grandpa::SharedVoterState; use sc_finality_grandpa::SharedVoterState;
@ -184,6 +184,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new( let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
backend.clone(), backend.clone(),
grandpa_link.shared_authority_set().clone(), grandpa_link.shared_authority_set().clone(),
Vec::default(),
)); ));
let (network, system_rpc_tx, network_starter) = let (network, system_rpc_tx, network_starter) =
@ -335,143 +336,3 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
network_starter.start_network(); network_starter.start_network();
Ok(task_manager) Ok(task_manager)
} }
/// Builds a new service for a light client.
pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError> {
let telemetry = config
.telemetry_endpoints
.clone()
.filter(|x| !x.is_empty())
.map(|endpoints| -> Result<_, sc_telemetry::Error> {
let worker = TelemetryWorker::new(16)?;
let telemetry = worker.handle().new_telemetry(endpoints);
Ok((worker, telemetry))
})
.transpose()?;
let executor = NativeElseWasmExecutor::<ExecutorDispatch>::new(
config.wasm_method,
config.default_heap_pages,
config.max_runtime_instances,
);
let (client, backend, keystore_container, mut task_manager, on_demand) =
sc_service::new_light_parts::<Block, RuntimeApi, _>(
&config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor,
)?;
let mut telemetry = telemetry.map(|(worker, telemetry)| {
task_manager.spawn_handle().spawn("telemetry", worker.run());
telemetry
});
config.network.extra_sets.push(sc_finality_grandpa::grandpa_peers_set_config());
let select_chain = sc_consensus::LongestChain::new(backend.clone());
let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light(
config.transaction_pool.clone(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
on_demand.clone(),
));
let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
client.clone(),
&(client.clone() as Arc<_>),
select_chain.clone(),
telemetry.as_ref().map(|x| x.handle()),
)?;
let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration();
let import_queue =
sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _, _>(ImportQueueParams {
block_import: grandpa_block_import.clone(),
justification_import: Some(Box::new(grandpa_block_import.clone())),
client: client.clone(),
create_inherent_data_providers: move |_, ()| async move {
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let slot =
sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_duration(
*timestamp,
slot_duration,
);
Ok((timestamp, slot))
},
spawner: &task_manager.spawn_essential_handle(),
can_author_with: sp_consensus::NeverCanAuthor,
registry: config.prometheus_registry(),
check_for_equivocation: Default::default(),
telemetry: telemetry.as_ref().map(|x| x.handle()),
})?;
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
));
let (network, system_rpc_tx, network_starter) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
client: client.clone(),
transaction_pool: transaction_pool.clone(),
spawn_handle: task_manager.spawn_handle(),
import_queue,
on_demand: Some(on_demand.clone()),
block_announce_validator_builder: None,
warp_sync: Some(warp_sync),
})?;
if config.offchain_worker.enabled {
sc_service::build_offchain_workers(
&config,
task_manager.spawn_handle(),
client.clone(),
network.clone(),
);
}
let enable_grandpa = !config.disable_grandpa;
if enable_grandpa {
let name = config.network.node_name.clone();
let config = sc_finality_grandpa::Config {
gossip_duration: std::time::Duration::from_millis(333),
justification_period: 512,
name: Some(name),
observer_enabled: false,
keystore: None,
local_role: config.role.clone(),
telemetry: telemetry.as_ref().map(|x| x.handle()),
};
task_manager.spawn_handle().spawn_blocking(
"grandpa-observer",
sc_finality_grandpa::run_grandpa_observer(config, grandpa_link, network.clone())?,
);
}
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
remote_blockchain: Some(backend.remote_blockchain()),
transaction_pool,
task_manager: &mut task_manager,
on_demand: Some(on_demand),
rpc_extensions_builder: Box::new(|_, _| Ok(())),
config,
client,
keystore: keystore_container.sync_keystore(),
backend,
network,
system_rpc_tx,
telemetry: telemetry.as_mut(),
})?;
network_starter.start_network();
Ok(task_manager)
}

View File

@ -1,6 +1,6 @@
[package] [package]
name = 'pallet-template' name = 'pallet-template'
version = '3.0.0-monthly-2021-10' version = '4.0.0-dev'
description = 'FRAME pallet template for defining custom runtime logic.' description = 'FRAME pallet template for defining custom runtime logic.'
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>'] authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
homepage = 'https://substrate.io/' homepage = 'https://substrate.io/'
@ -22,19 +22,19 @@ version = '2.0.0'
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
optional = true optional = true
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.frame-support] [dependencies.frame-support]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.frame-system] [dependencies.frame-system]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.scale-info] [dependencies.scale-info]
@ -45,19 +45,19 @@ version = '1.0'
[dev-dependencies.sp-core] [dev-dependencies.sp-core]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dev-dependencies.sp-io] [dev-dependencies.sp-io]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dev-dependencies.sp-runtime] [dev-dependencies.sp-runtime]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[features] [features]

View File

@ -4,7 +4,7 @@ use super::*;
#[allow(unused)] #[allow(unused)]
use crate::Pallet as Template; use crate::Pallet as Template;
use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller}; use frame_benchmarking::{benchmarks, whitelisted_caller};
use frame_system::RawOrigin; use frame_system::RawOrigin;
benchmarks! { benchmarks! {
@ -15,6 +15,6 @@ benchmarks! {
verify { verify {
assert_eq!(Something::<T>::get(), Some(s)); assert_eq!(Something::<T>::get(), Some(s));
} }
}
impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test); impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test);
}

View File

@ -39,7 +39,7 @@ pub mod pallet {
pub type Something<T> = StorageValue<_, u32>; pub type Something<T> = StorageValue<_, u32>;
// Pallets use events to inform users when important changes are made. // Pallets use events to inform users when important changes are made.
// https://docs.substrate.io/v3/runtime/events // https://docs.substrate.io/v3/runtime/events-and-errors
#[pallet::event] #[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)] #[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> { pub enum Event<T: Config> {

View File

@ -1,6 +1,6 @@
[package] [package]
name = 'node-template-runtime' name = 'node-template-runtime'
version = '3.0.0-monthly-2021-10' version = '4.0.0-dev'
description = 'A fresh FRAME-based Substrate runtime, ready for hacking.' description = 'A fresh FRAME-based Substrate runtime, ready for hacking.'
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>'] authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
homepage = 'https://substrate.io/' homepage = 'https://substrate.io/'
@ -15,11 +15,11 @@ targets = ['x86_64-unknown-linux-gnu']
[dependencies.pallet-template] [dependencies.pallet-template]
default-features = false default-features = false
path = '../pallets/template' path = '../pallets/template'
version = '3.0.0-monthly-2021-10' version = '4.0.0-dev'
[build-dependencies.substrate-wasm-builder] [build-dependencies.substrate-wasm-builder]
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '5.0.0-dev' version = '5.0.0-dev'
[dependencies.codec] [dependencies.codec]
@ -32,38 +32,38 @@ version = '2.0.0'
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
optional = true optional = true
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.frame-executive] [dependencies.frame-executive]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.frame-support] [dependencies.frame-support]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.frame-system] [dependencies.frame-system]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.frame-system-benchmarking] [dependencies.frame-system-benchmarking]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
optional = true optional = true
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.frame-system-rpc-runtime-api] [dependencies.frame-system-rpc-runtime-api]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.hex-literal] [dependencies.hex-literal]
@ -73,49 +73,49 @@ version = '0.3.1'
[dependencies.pallet-aura] [dependencies.pallet-aura]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.pallet-balances] [dependencies.pallet-balances]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.pallet-grandpa] [dependencies.pallet-grandpa]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.pallet-randomness-collective-flip] [dependencies.pallet-randomness-collective-flip]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.pallet-sudo] [dependencies.pallet-sudo]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.pallet-timestamp] [dependencies.pallet-timestamp]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.pallet-transaction-payment] [dependencies.pallet-transaction-payment]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.pallet-transaction-payment-rpc-runtime-api] [dependencies.pallet-transaction-payment-rpc-runtime-api]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.scale-info] [dependencies.scale-info]
@ -126,67 +126,67 @@ version = '1.0'
[dependencies.sp-api] [dependencies.sp-api]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-block-builder] [dependencies.sp-block-builder]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-consensus-aura] [dependencies.sp-consensus-aura]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '0.10.0-dev' version = '0.10.0-dev'
[dependencies.sp-core] [dependencies.sp-core]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-inherents] [dependencies.sp-inherents]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-offchain] [dependencies.sp-offchain]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-runtime] [dependencies.sp-runtime]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-session] [dependencies.sp-session]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-std] [dependencies.sp-std]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-transaction-pool] [dependencies.sp-transaction-pool]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[dependencies.sp-version] [dependencies.sp-version]
default-features = false default-features = false
git = 'https://github.com/paritytech/substrate.git' git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-10' tag = 'monthly-2021-11'
version = '4.0.0-dev' version = '4.0.0-dev'
[features] [features]

View File

@ -87,7 +87,7 @@ pub mod opaque {
} }
// To learn more about runtime versioning and what each of the following value means: // To learn more about runtime versioning and what each of the following value means:
// https://docs.substrate.io/v3/runtime/origins#runtime-versioning // https://docs.substrate.io/v3/runtime/upgrades#runtime-versioning
#[sp_version::runtime_version] #[sp_version::runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion { pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("node-template"), spec_name: create_runtime_str!("node-template"),
@ -258,11 +258,13 @@ impl pallet_balances::Config for Runtime {
parameter_types! { parameter_types! {
pub const TransactionByteFee: Balance = 1; pub const TransactionByteFee: Balance = 1;
pub OperationalFeeMultiplier: u8 = 5;
} }
impl pallet_transaction_payment::Config for Runtime { impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = CurrencyAdapter<Balances, ()>; type OnChargeTransaction = CurrencyAdapter<Balances, ()>;
type TransactionByteFee = TransactionByteFee; type TransactionByteFee = TransactionByteFee;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type WeightToFee = IdentityFee<Balance>; type WeightToFee = IdentityFee<Balance>;
type FeeMultiplierUpdate = (); type FeeMultiplierUpdate = ();
} }
@ -284,16 +286,16 @@ construct_runtime!(
NodeBlock = opaque::Block, NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic UncheckedExtrinsic = UncheckedExtrinsic
{ {
System: frame_system::{Pallet, Call, Config, Storage, Event<T>}, System: frame_system,
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage}, RandomnessCollectiveFlip: pallet_randomness_collective_flip,
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, Timestamp: pallet_timestamp,
Aura: pallet_aura::{Pallet, Config<T>}, Aura: pallet_aura,
Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event}, Grandpa: pallet_grandpa,
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>}, Balances: pallet_balances,
TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, TransactionPayment: pallet_transaction_payment,
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>}, Sudo: pallet_sudo,
// Include the custom logic from the pallet-template in the runtime. // Include the custom logic from the pallet-template in the runtime.
TemplateModule: pallet_template::{Pallet, Call, Storage, Event<T>}, TemplateModule: pallet_template,
} }
); );
@ -461,12 +463,14 @@ impl_runtime_apis! {
Vec<frame_benchmarking::BenchmarkList>, Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>, Vec<frame_support::traits::StorageInfo>,
) { ) {
use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList}; use frame_benchmarking::{list_benchmark, baseline, Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait; use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench; use frame_system_benchmarking::Pallet as SystemBench;
use baseline::Pallet as BaselineBench;
let mut list = Vec::<BenchmarkList>::new(); let mut list = Vec::<BenchmarkList>::new();
list_benchmark!(list, extra, frame_benchmarking, BaselineBench::<Runtime>);
list_benchmark!(list, extra, frame_system, SystemBench::<Runtime>); list_benchmark!(list, extra, frame_system, SystemBench::<Runtime>);
list_benchmark!(list, extra, pallet_balances, Balances); list_benchmark!(list, extra, pallet_balances, Balances);
list_benchmark!(list, extra, pallet_timestamp, Timestamp); list_benchmark!(list, extra, pallet_timestamp, Timestamp);
@ -480,10 +484,13 @@ impl_runtime_apis! {
fn dispatch_benchmark( fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> { ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
use frame_system_benchmarking::Pallet as SystemBench; use frame_system_benchmarking::Pallet as SystemBench;
use baseline::Pallet as BaselineBench;
impl frame_system_benchmarking::Config for Runtime {} impl frame_system_benchmarking::Config for Runtime {}
impl baseline::Config for Runtime {}
let whitelist: Vec<TrackedStorageKey> = vec![ let whitelist: Vec<TrackedStorageKey> = vec![
// Block Number // Block Number
@ -501,12 +508,12 @@ impl_runtime_apis! {
let mut batches = Vec::<BenchmarkBatch>::new(); let mut batches = Vec::<BenchmarkBatch>::new();
let params = (&config, &whitelist); let params = (&config, &whitelist);
add_benchmark!(params, batches, frame_benchmarking, BaselineBench::<Runtime>);
add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>); add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
add_benchmark!(params, batches, pallet_balances, Balances); add_benchmark!(params, batches, pallet_balances, Balances);
add_benchmark!(params, batches, pallet_timestamp, Timestamp); add_benchmark!(params, batches, pallet_timestamp, Timestamp);
add_benchmark!(params, batches, pallet_template, TemplateModule); add_benchmark!(params, batches, pallet_template, TemplateModule);
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
Ok(batches) Ok(batches)
} }
} }