Skip to content

Commit de3f65e

Browse files
committed
feat: update to polkadot-v0.9.40
1 parent 57a5b0a commit de3f65e

16 files changed

Lines changed: 2587 additions & 1663 deletions

File tree

Cargo.lock

Lines changed: 2399 additions & 1350 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodes/template/Cargo.toml

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,71 @@
11
[package]
2-
name = "template-node"
2+
name = "node-template"
33
version = "4.0.0-dev"
44
description = "A fresh FRAME-based Substrate node, ready for hacking."
55
authors = ["Substrate DevHub <https://github.com/substrate-developer-hub>"]
66
homepage = "https://substrate.io/"
77
edition = "2021"
88
license = "Unlicense"
99
publish = false
10-
repository = "https://github.com/substrate-developer-hub/substrate-template-node/"
10+
repository = "https://github.com/substrate-developer-hub/substrate-node-template/"
1111
build = "build.rs"
1212

1313
[package.metadata.docs.rs]
1414
targets = ["x86_64-unknown-linux-gnu"]
1515

1616
[[bin]]
17-
name = "template-node"
17+
name = "node-template"
1818

1919
[dependencies]
20-
clap = { version = "4.0.23", features = ["derive"] }
20+
clap = { version = "4.2.1", features = ["derive"] }
21+
futures = { version = "0.3.28", features = ["thread-pool"]}
2122

22-
sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", features = ["wasmtime"] , branch = "polkadot-v0.9.31" }
23-
sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
24-
sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", features = ["wasmtime"] , branch = "polkadot-v0.9.31" }
25-
sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", features = ["wasmtime"] , branch = "polkadot-v0.9.31" }
26-
sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
27-
sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
28-
sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
29-
sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
30-
sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
31-
sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
32-
sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
33-
sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
34-
sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
35-
sp-finality-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
36-
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
37-
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
38-
sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
39-
sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
40-
sp-keyring = { version = "6.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
41-
frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
42-
pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
23+
sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
24+
sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
25+
sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
26+
sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
27+
sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
28+
sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
29+
sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
30+
sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
31+
sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
32+
sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
33+
sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
34+
sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
35+
sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
36+
sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
37+
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
38+
sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
39+
sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
40+
sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
41+
sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
42+
sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
43+
frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
44+
pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
4345

4446
# These dependencies are used for the node template's RPCs
45-
jsonrpsee = { version = "0.15.1", features = ["server"] }
46-
sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
47-
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
48-
sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
49-
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
50-
sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
51-
sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
52-
substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
53-
pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
47+
jsonrpsee = { version = "0.16.2", features = ["server"] }
48+
sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
49+
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
50+
sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
51+
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
52+
sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
53+
sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
54+
substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
55+
pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
5456

5557
# These dependencies are used for runtime benchmarking
56-
frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
57-
frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
58+
frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
59+
frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
5860

5961
# Local Dependencies
6062
template-runtime = { version = "4.0.0-dev", path = "../../runtimes/template" }
6163

6264
# CLI-specific dependencies
63-
try-runtime-cli = { version = "0.10.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
65+
try-runtime-cli = { version = "0.10.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
6466

6567
[build-dependencies]
66-
substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
68+
substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
6769

6870
[features]
6971
default = []
@@ -75,4 +77,4 @@ runtime-benchmarks = [
7577
]
7678
# Enable features that allow the runtime to be tried and debugged. Name might be subject to change
7779
# in the near future.
78-
try-runtime = ["template-runtime/try-runtime", "try-runtime-cli"]
80+
try-runtime = ["template-runtime/try-runtime", "try-runtime-cli/try-runtime"]

nodes/template/src/benchmarking.rs

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,19 @@
1-
// This file is part of Substrate.
2-
3-
// Copyright (C) 2022 Parity Technologies (UK) Ltd.
4-
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
5-
6-
// This program is free software: you can redistribute it and/or modify
7-
// it under the terms of the GNU General Public License as published by
8-
// the Free Software Foundation, either version 3 of the License, or
9-
// (at your option) any later version.
10-
11-
// This program is distributed in the hope that it will be useful,
12-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
// GNU General Public License for more details.
15-
16-
// You should have received a copy of the GNU General Public License
17-
// along with this program. If not, see <https://www.gnu.org/licenses/>.
18-
191
//! Setup code for [`super::command`] which would otherwise bloat that module.
202
//!
213
//! Should only be used for benchmarking as it may break in other contexts.
224
23-
use std::{sync::Arc, time::Duration};
5+
use crate::service::FullClient;
246

7+
use template_runtime as runtime;
258
use runtime::{AccountId, Balance, BalancesCall, SystemCall};
269
use sc_cli::Result;
2710
use sc_client_api::BlockBackend;
2811
use sp_core::{Encode, Pair};
2912
use sp_inherents::{InherentData, InherentDataProvider};
3013
use sp_keyring::Sr25519Keyring;
3114
use sp_runtime::{OpaqueExtrinsic, SaturatedConversion};
32-
use template_runtime as runtime;
3315

34-
use crate::service::FullClient;
16+
use std::{sync::Arc, time::Duration};
3517

3618
/// Generates extrinsics for the `benchmark overhead` command.
3719
///
@@ -176,8 +158,7 @@ pub fn inherent_benchmark_data() -> Result<InherentData> {
176158
let d = Duration::from_millis(0);
177159
let timestamp = sp_timestamp::InherentDataProvider::new(d.into());
178160

179-
timestamp
180-
.provide_inherent_data(&mut inherent_data)
161+
futures::executor::block_on(timestamp.provide_inherent_data(&mut inherent_data))
181162
.map_err(|e| format!("creating inherent data: {:?}", e))?;
182163
Ok(inherent_data)
183164
}

nodes/template/src/chain_spec.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
use sc_service::ChainType;
2-
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
3-
use sp_core::{sr25519, Pair, Public};
4-
use sp_finality_grandpa::AuthorityId as GrandpaId;
5-
use sp_runtime::traits::{IdentifyAccount, Verify};
61
use template_runtime::{
72
AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig, Signature, SudoConfig,
83
SystemConfig, WASM_BINARY,
94
};
5+
use sc_service::ChainType;
6+
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
7+
use sp_consensus_grandpa::AuthorityId as GrandpaId;
8+
use sp_core::{sr25519, Pair, Public};
9+
use sp_runtime::traits::{IdentifyAccount, Verify};
1010

1111
// The URL for the telemetry server.
1212
// const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";

nodes/template/src/command.rs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE};
2-
use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli};
3-
use sc_service::PartialComponents;
4-
use sp_keyring::Sr25519Keyring;
5-
use template_runtime::{Block, EXISTENTIAL_DEPOSIT};
6-
71
use crate::{
82
benchmarking::{inherent_benchmark_data, RemarkBuilder, TransferKeepAliveBuilder},
93
chain_spec,
104
cli::{Cli, Subcommand},
115
service,
126
};
7+
use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE};
8+
use template_runtime::{Block, EXISTENTIAL_DEPOSIT};
9+
use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli};
10+
use sc_service::PartialComponents;
11+
use sp_keyring::Sr25519Keyring;
12+
13+
#[cfg(feature = "try-runtime")]
14+
use try_runtime_cli::block_building_info::timestamp_with_aura_info;
1315

1416
impl SubstrateCli for Cli {
1517
fn impl_name() -> String {
@@ -100,7 +102,7 @@ pub fn run() -> sc_cli::Result<()> {
100102
let PartialComponents { client, task_manager, backend, .. } =
101103
service::new_partial(&config)?;
102104
let aux_revert = Box::new(|client, _, blocks| {
103-
sc_finality_grandpa::revert(client, blocks)?;
105+
sc_consensus_grandpa::revert(client, blocks)?;
104106
Ok(())
105107
});
106108
Ok((cmd.run(client, backend, Some(aux_revert)), task_manager))
@@ -175,6 +177,8 @@ pub fn run() -> sc_cli::Result<()> {
175177
},
176178
#[cfg(feature = "try-runtime")]
177179
Some(Subcommand::TryRuntime(cmd)) => {
180+
use crate::service::ExecutorDispatch;
181+
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
178182
let runner = cli.create_runner(cmd)?;
179183
runner.async_run(|config| {
180184
// we don't need any of the components of new_partial, just a runtime, or a task
@@ -183,7 +187,15 @@ pub fn run() -> sc_cli::Result<()> {
183187
let task_manager =
184188
sc_service::TaskManager::new(config.tokio_handle.clone(), registry)
185189
.map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?;
186-
Ok((cmd.run::<Block, service::ExecutorDispatch>(config), task_manager))
190+
let info_provider = timestamp_with_aura_info(6000);
191+
192+
Ok((
193+
cmd.run::<Block, ExtendedHostFunctions<
194+
sp_io::SubstrateHostFunctions,
195+
<ExecutorDispatch as NativeExecutionDispatch>::ExtendHostFunctions,
196+
>, _>(Some(info_provider)),
197+
task_manager,
198+
))
187199
})
188200
},
189201
#[cfg(not(feature = "try-runtime"))]

nodes/template/src/command_helper.rs

Lines changed: 0 additions & 131 deletions
This file was deleted.

nodes/template/src/rpc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
use std::sync::Arc;
99

1010
use jsonrpsee::RpcModule;
11-
pub use sc_rpc_api::DenyUnsafe;
11+
use template_runtime::{opaque::Block, AccountId, Balance, Index};
1212
use sc_transaction_pool_api::TransactionPool;
1313
use sp_api::ProvideRuntimeApi;
1414
use sp_block_builder::BlockBuilder;
1515
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
16-
use template_runtime::{opaque::Block, AccountId, Balance, Index};
16+
17+
pub use sc_rpc_api::DenyUnsafe;
1718

1819
/// Full client dependencies.
1920
pub struct FullDeps<C, P> {

0 commit comments

Comments
 (0)