Skip to content

Commit 6a61b39

Browse files
authored
Bump to polkadot-stable2412 (#50)
* bump to polkadot-stable2412 * fix ci
1 parent 690181c commit 6a61b39

File tree

24 files changed

+124
-184
lines changed

24 files changed

+124
-184
lines changed

.github/workflows/ci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454
- name: Build all binaries
5555
run: |
5656
cargo update memchr --precise 2.7.4
57-
cargo update serde_json --precise 1.0.127
5857
cargo build --release --bins
5958
6059
- name: Aura Integration tests

Cargo.toml

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ members = [
2323
codec = { version = "3.1.3", package = "parity-scale-codec", default-features = false }
2424
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
2525
jsonrpsee = "0.24"
26-
try-runtime-cli = "0.41.0"
27-
polkadot-sdk = { version = "0.7.0", default-features = false }
26+
polkadot-sdk = { version = "0.12.2", default-features = false }
2827

2928
# crates which cannot be used from polkadot-sdk
30-
sp-core = { version = "34.0.0", default-features = false }
31-
sp-runtime-interface = { version = "28.0.0", default-features = false }
32-
cumulus-pallet-parachain-system = { version = "0.17.1", default-features = false }
33-
substrate-wasm-builder = "24.0.1"
34-
sc-service = "0.46.0"
35-
sc-tracing = "37.0.1"
29+
sp-core = { version = "35.0.0", default-features = false }
30+
sp-runtime-interface = { version = "29.0.0", default-features = false }
31+
cumulus-pallet-parachain-system = { version = "0.18.1", default-features = false }
32+
substrate-wasm-builder = "25.0.0"
33+
sc-service = "0.49.0"
34+
sc-tracing = "38.0.0"
35+
sp-api-proc-macro = "21.0.0"
3636

3737
# local crates
38-
simnode-runtime-api = { path = "./runtime-api", version = "16.0.0", default-features = false }
39-
sc-simnode = { path = "./simnode", version = "16.0.0" }
38+
simnode-runtime-api = { path = "./runtime-api", version = "2412.0.0", default-features = false }
39+
sc-simnode = { path = "./simnode", version = "2412.0.0" }

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Installation and integration guides can be found in the [book](https://simnode.p
2424

2525
## Releases
2626

27-
`sc-simnode` exclusively follows the official [paritytech/polkadot-sdk](https://github.com/paritytech/polkadot-sdk/releases) stable releases. Therefore new versions of this crate will be published as a new major release for the minor version of the corresponding polkadot-sdk stable release.
28-
E.g [`polkadot-stable2409`](https://github.com/paritytech/polkadot-sdk/tree/polkadot-stable2409) corresponds to the [`polkadot-sdk-v1.160`](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.16.0) tag, which is supported by the `v16.0.0` version of this crate. Subsequent stable releases will see a major version bump in this crate.
27+
`sc-simnode` exclusively follows the official [paritytech/polkadot-sdk](https://github.com/paritytech/polkadot-sdk/releases) umbrella crate stable releases. Therefore new versions of this crate will be published for every major version of the corresponding polkadot-sdk stable release.
28+
E.g [`polkadot-stable2412`](https://github.com/paritytech/polkadot-sdk/tree/polkadot-stable2412) is supported by the `v2412.0.0` version of this crate. Subsequent stable releases will see a similar version bump in this crate.
2929

3030
## License
3131

examples/aura/node/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ name = "aura-node"
2020
clap = { version = "4.0.9", features = ["derive"] }
2121
futures = { version = "0.3.21", features = ["thread-pool"] }
2222
jsonrpsee = { workspace = true, features = ["server"] }
23-
try-runtime-cli = { optional = true, workspace = true }
2423
serde_json = "1.0"
2524

2625
aura-runtime = { path = "../runtime" }
@@ -81,5 +80,4 @@ runtime-benchmarks = [
8180
try-runtime = [
8281
"aura-runtime/try-runtime",
8382
"polkadot-sdk/try-runtime",
84-
"try-runtime-cli/try-runtime"
8583
]

examples/aura/node/src/cli.rs

-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ pub enum Subcommand {
4545
/// Runs the node with signature verification override and manual seal.
4646
Simnode(sc_simnode::cli::SimnodeCli),
4747

48-
/// Try some command against runtime state.
49-
#[cfg(feature = "try-runtime")]
50-
TryRuntime(try_runtime_cli::TryRuntimeCmd),
51-
5248
/// Try some command against runtime state. Note: `try-runtime` feature must be enabled.
5349
#[cfg(not(feature = "try-runtime"))]
5450
TryRuntime,

examples/aura/node/src/command.rs

+2-27
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ use sc_service::PartialComponents;
1414
use sp_keyring::Sr25519Keyring;
1515
use sp_runtime::generic::Era;
1616

17-
#[cfg(feature = "try-runtime")]
18-
use try_runtime_cli::block_building_info::timestamp_with_aura_info;
19-
2017
impl SubstrateCli for Cli {
2118
fn impl_name() -> String {
2219
"Substrate Node".into()
@@ -179,11 +176,12 @@ pub fn run() -> sc_cli::Result<()> {
179176
let ext_builder = RemarkBuilder::new(client.clone());
180177

181178
cmd.run(
182-
config,
179+
config.chain_spec.name().into(),
183180
client,
184181
inherent_benchmark_data()?,
185182
Vec::new(),
186183
&ext_builder,
184+
false,
187185
)
188186
},
189187
BenchmarkCmd::Extrinsic(cmd) => {
@@ -238,29 +236,6 @@ pub fn run() -> sc_cli::Result<()> {
238236
Ok(task_manager)
239237
})
240238
},
241-
#[cfg(feature = "try-runtime")]
242-
Some(Subcommand::TryRuntime(cmd)) => {
243-
use crate::service::ExecutorDispatch;
244-
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
245-
let runner = cli.create_runner(cmd)?;
246-
runner.async_run(|config| {
247-
// we don't need any of the components of new_partial, just a, executor runtime, or
248-
// a task manager to do `async_run`.
249-
let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
250-
let task_manager =
251-
sc_service::TaskManager::new(config.tokio_handle.clone(), registry)
252-
.map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?;
253-
let info_provider = timestamp_with_aura_info(6000);
254-
255-
Ok((
256-
cmd.run::<Block, ExtendedHostFunctions<
257-
sp_io::SubstrateHostFunctions,
258-
<ExecutorDispatch as NativeExecutionDispatch>::ExtendHostFunctions,
259-
>, _>(Some(info_provider)),
260-
task_manager,
261-
))
262-
})
263-
},
264239
#[cfg(not(feature = "try-runtime"))]
265240
Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \
266241
You can enable it with `--features try-runtime`."

examples/aura/node/src/service.rs

+11-8
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub fn new_partial<E>(
3535
FullBackend,
3636
FullSelectChain,
3737
sc_consensus::DefaultImportQueue<Block>,
38-
sc_transaction_pool::FullPool<Block, FullClient<E>>,
38+
sc_transaction_pool::TransactionPoolHandle<Block, FullClient<E>>,
3939
(
4040
sc_consensus_grandpa::GrandpaBlockImport<
4141
FullBackend,
@@ -78,12 +78,15 @@ where
7878

7979
let select_chain = sc_consensus::LongestChain::new(backend.clone());
8080

81-
let transaction_pool = sc_transaction_pool::BasicPool::new_full(
82-
config.transaction_pool.clone(),
83-
config.role.is_authority().into(),
84-
config.prometheus_registry(),
85-
task_manager.spawn_essential_handle(),
86-
client.clone(),
81+
let transaction_pool = Arc::from(
82+
sc_transaction_pool::Builder::new(
83+
task_manager.spawn_essential_handle(),
84+
client.clone(),
85+
config.role.is_authority().into(),
86+
)
87+
.with_options(config.transaction_pool.clone())
88+
.with_prometheus(config.prometheus_registry())
89+
.build(),
8790
);
8891

8992
let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import(
@@ -202,7 +205,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
202205
network_provider: Arc::new(network.clone()),
203206
enable_http_requests: true,
204207
custom_extensions: |_| vec![],
205-
})
208+
})?
206209
.run(client.clone(), task_manager.spawn_handle())
207210
.boxed(),
208211
);

examples/aura/runtime/src/lib.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use sp_api::impl_runtime_apis;
1414
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
1515
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
1616
use sp_runtime::{
17-
create_runtime_str, generic, impl_opaque_keys,
17+
generic, impl_opaque_keys,
1818
traits::{
1919
AccountIdLookup, BlakeTwo256, Block as BlockT, IdentifyAccount, NumberFor, One, Verify,
2020
},
@@ -98,8 +98,8 @@ pub mod opaque {
9898
// https://docs.substrate.io/main-docs/build/upgrade#runtime-versioning
9999
#[sp_version::runtime_version]
100100
pub const VERSION: RuntimeVersion = RuntimeVersion {
101-
spec_name: create_runtime_str!("node-template"),
102-
impl_name: create_runtime_str!("node-template"),
101+
spec_name: sp_std::borrow::Cow::Borrowed("node-template"),
102+
impl_name: sp_std::borrow::Cow::Borrowed("node-template"),
103103
authoring_version: 1,
104104
// The version of the runtime specification. A full node will not attempt to use its native
105105
// runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`,
@@ -110,7 +110,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
110110
impl_version: 1,
111111
apis: RUNTIME_API_VERSIONS,
112112
transaction_version: 1,
113-
state_version: 1,
113+
system_version: 1,
114114
};
115115

116116
/// This determines the average expected block time that we are targeting.
@@ -249,6 +249,7 @@ impl pallet_balances::Config for Runtime {
249249
type MaxLocks = ConstU32<50>;
250250
type MaxReserves = ();
251251
type MaxFreezes = ();
252+
type DoneSlashHandler = ();
252253
}
253254

254255
parameter_types! {
@@ -262,6 +263,7 @@ impl pallet_transaction_payment::Config for Runtime {
262263
type LengthToFee = IdentityFee<Balance>;
263264
type FeeMultiplierUpdate = ConstFeeMultiplier<FeeMultiplier>;
264265
type OperationalFeeMultiplier = ConstU8<5>;
266+
type WeightInfo = pallet_transaction_payment::weights::SubstrateWeight<Runtime>;
265267
}
266268

267269
impl pallet_sudo::Config for Runtime {

examples/babe/node/Cargo.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ sc-simnode = { workspace = true, features = ["babe"] }
5151

5252
# CLI-specific dependencies
5353
sc-service = { workspace = true }
54-
try-runtime-cli = { optional = true, workspace = true }
5554
serde_json = "1.0"
5655

5756
[dependencies.polkadot-sdk]
@@ -119,12 +118,11 @@ cli = [
119118
"polkadot-sdk/frame-benchmarking-cli",
120119
"sc-service/rocksdb",
121120
"clap",
122-
"try-runtime-cli",
123121
]
124122
runtime-benchmarks = [
125123
"polkadot-sdk/runtime-benchmarks",
126124
"babe-runtime/runtime-benchmarks",
127125
]
128126
# Enable features that allow the runtime to be tried and debugged.
129127
# Name might be subject to change in the near future.
130-
try-runtime = ["babe-runtime/try-runtime", "try-runtime-cli/try-runtime"]
128+
try-runtime = ["babe-runtime/try-runtime"]

examples/babe/node/src/cli.rs

-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ pub enum Subcommand {
5151
#[command(subcommand)]
5252
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
5353

54-
/// Try some command against runtime state.
55-
#[cfg(feature = "try-runtime")]
56-
TryRuntime(try_runtime_cli::TryRuntimeCmd),
57-
5854
/// Try some command against runtime state. Note: `try-runtime` feature must be enabled.
5955
#[cfg(not(feature = "try-runtime"))]
6056
TryRuntime,

examples/babe/node/src/command.rs

+3-28
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ use sp_runtime::generic::Era;
3434
use std::sync::Arc;
3535

3636
#[cfg(feature = "try-runtime")]
37-
use {
38-
babe_runtime::constants::time::SLOT_DURATION,
39-
try_runtime_cli::block_building_info::substrate_info,
40-
};
37+
use babe_runtime::constants::time::SLOT_DURATION;
4138

4239
impl SubstrateCli for Cli {
4340
fn impl_name() -> String {
@@ -146,11 +143,12 @@ pub fn run() -> Result<()> {
146143
let ext_builder = RemarkBuilder::new(partial.client.clone());
147144

148145
cmd.run(
149-
config,
146+
config.chain_spec.name().into(),
150147
partial.client,
151148
inherent_benchmark_data()?,
152149
Vec::new(),
153150
&ext_builder,
151+
false,
154152
)
155153
},
156154
BenchmarkCmd::Extrinsic(cmd) => {
@@ -253,29 +251,6 @@ pub fn run() -> Result<()> {
253251
Ok((cmd.run(client, backend, Some(aux_revert)), task_manager))
254252
})
255253
},
256-
#[cfg(feature = "try-runtime")]
257-
Some(Subcommand::TryRuntime(cmd)) => {
258-
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
259-
let runner = cli.create_runner(cmd)?;
260-
runner.async_run(|config| {
261-
// we don't need any of the components of new_partial, just a runtime, or a task
262-
// manager to do `async_run`.
263-
let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
264-
let task_manager =
265-
sc_service::TaskManager::new(config.tokio_handle.clone(), registry)
266-
.map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?;
267-
268-
let info_provider = substrate_info(SLOT_DURATION);
269-
270-
Ok((
271-
cmd.run::<Block, ExtendedHostFunctions<
272-
sp_io::SubstrateHostFunctions,
273-
<ExecutorDispatch as NativeExecutionDispatch>::ExtendHostFunctions,
274-
>, _>(Some(info_provider)),
275-
task_manager,
276-
))
277-
})
278-
},
279254
Some(Subcommand::Simnode(cmd)) => {
280255
let runner = cli.create_runner(&cmd.run.normalize())?;
281256
let config = runner.config();

examples/babe/node/src/service.rs

+12-9
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl sc_executor::NativeExecutionDispatch for ExecutorDispatch {
7272
}
7373

7474
/// The transaction pool type defintion.
75-
pub type TransactionPool = sc_transaction_pool::FullPool<Block, FullClient>;
75+
pub type TransactionPool = sc_transaction_pool::TransactionPoolHandle<Block, FullClient>;
7676

7777
/// Fetch the nonce of the given `account` from the chain state.
7878
///
@@ -160,7 +160,7 @@ pub fn new_partial<E>(
160160
FullBackend,
161161
FullSelectChain,
162162
sc_consensus::DefaultImportQueue<Block>,
163-
sc_transaction_pool::FullPool<Block, FullClient<E>>,
163+
sc_transaction_pool::TransactionPoolHandle<Block, FullClient<E>>,
164164
(
165165
impl Fn(
166166
sc_rpc::SubscriptionTaskExecutor,
@@ -205,12 +205,15 @@ where
205205

206206
let select_chain = sc_consensus::LongestChain::new(backend.clone());
207207

208-
let transaction_pool = sc_transaction_pool::BasicPool::new_full(
209-
config.transaction_pool.clone(),
210-
config.role.is_authority().into(),
211-
config.prometheus_registry(),
212-
task_manager.spawn_essential_handle(),
213-
client.clone(),
208+
let transaction_pool = Arc::from(
209+
sc_transaction_pool::Builder::new(
210+
task_manager.spawn_essential_handle(),
211+
client.clone(),
212+
config.role.is_authority().into(),
213+
)
214+
.with_options(config.transaction_pool.clone())
215+
.with_prometheus(config.prometheus_registry())
216+
.build(),
214217
);
215218

216219
let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import(
@@ -418,7 +421,7 @@ pub fn new_full_base(
418421
network_provider: Arc::new(network.clone()),
419422
enable_http_requests: true,
420423
custom_extensions: |_| vec![],
421-
})
424+
})?
422425
.run(client.clone(), task_manager.spawn_handle())
423426
.boxed(),
424427
);

0 commit comments

Comments
 (0)