Skip to content

Commit

Permalink
chore: upgrade to stable2412 (#53)
Browse files Browse the repository at this point in the history
* 2412 upgrade

* fmt

* clippy

* TransactionExtension and node refactor

* fmt

* sp_keyring

* stray-key-gen

* todo and runtime-benchmark warning

---------

Co-authored-by: f-gate <felix@r0gue.io>
  • Loading branch information
f-gate and f-gate authored Jan 23, 2025
1 parent 368d6d9 commit 82741b4
Show file tree
Hide file tree
Showing 10 changed files with 3,160 additions and 2,311 deletions.
5,150 changes: 3,004 additions & 2,146 deletions Cargo.lock

Large diffs are not rendered by default.

185 changes: 93 additions & 92 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,114 +13,115 @@ members = ["node", "runtime"]
resolver = "2"

[workspace.dependencies]
clap = { version = "4.5.10", features = ["derive"] }
clap = { version = "4.5.26", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [
"derive",
] }
color-print = "0.3.4"
docify = "0.2.8"
futures = "0.3.30"
color-print = "0.3.7"
docify = "0.2.9"
futures = "0.3.31"
hex-literal = "0.4.1"
jsonrpsee = { version = "0.24.3", features = ["server"] }
log = { version = "0.4.21", default-features = false }
scale-info = { version = "2.11.1", default-features = false, features = [
jsonrpsee = { version = "0.24.7", features = ["server"] }
log = { version = "0.4.25", default-features = false }
scale-info = { version = "2.11.6", default-features = false, features = [
"derive",
] }
serde = { version = "1.0.209", default-features = false }
serde_json = { version = "1.0.127", default-features = false }
smallvec = "1.11.2"
serde = { version = "1.0.217", default-features = false }
serde_json = { version = "1.0.137", default-features = false }
smallvec = "1.13.2"

# Build
substrate-build-script-utils = "11.0.0"
substrate-wasm-builder = "24.0.1"
substrate-wasm-builder = "25.0.0"

# Local
parachain-template-runtime = { path = "./runtime" }

# Substrate
frame-benchmarking = { version = "38.0.0", default-features = false }
frame-benchmarking-cli = "43.0.0"
frame-executive = { version = "38.0.0", default-features = false }
frame-support = { version = "38.2.0", default-features = false }
frame-support-procedural = { version = "30.0.3", default-features = false }
frame-system = { version = "38.0.0", default-features = false }
frame-system-benchmarking = { version = "38.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "34.0.0", default-features = false }
frame-try-runtime = { version = "0.44.0", default-features = false }
frame-metadata-hash-extension = { version = "0.6.0", default-features = false }
pallet-aura = { version = "37.0.0", default-features = false }
pallet-authorship = { version = "38.0.0", default-features = false }
pallet-balances = { version = "39.0.0", default-features = false }
pallet-message-queue = { version = "41.0.2", default-features = false }
pallet-session = { version = "38.0.0", default-features = false }
pallet-sudo = { version = "38.0.0", default-features = false }
pallet-timestamp = { version = "37.0.0", default-features = false }
pallet-transaction-payment = { version = "38.0.2", default-features = false }
pallet-transaction-payment-rpc = "41.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "38.0.0", default-features = false }
prometheus-endpoint = { version = "0.17.0", default-features = false, package = "substrate-prometheus-endpoint" }
sc-basic-authorship = "0.45.0"
sc-chain-spec = "38.0.0"
sc-cli = "0.47.0"
sc-client-api = "37.0.0"
sc-offchain = "40.0.0"
sc-consensus = "0.44.0"
sc-executor = "0.40.1"
sc-network = "0.45.3"
sc-network-sync = "0.44.1"
sc-rpc = "40.0.0"
sc-service = "0.46.0"
sc-sysinfo = "38.0.0"
sc-telemetry = "25.0.0"
sc-tracing = "37.0.1"
sc-transaction-pool = "37.0.0"
sc-transaction-pool-api = "37.0.0"
sp-api = { version = "34.0.0", default-features = false }
sp-block-builder = { version = "34.0.0", default-features = false }
sp-blockchain = "37.0.1"
sp-consensus-aura = { version = "0.40.0", default-features = false }
sp-core = { version = "34.0.0", default-features = false }
sp-io = { version = "38.0.0", default-features = false }
sp-genesis-builder = { version = "0.15.1", default-features = false }
sp-inherents = { version = "34.0.0", default-features = false }
sp-keystore = "0.40.0"
sp-offchain = { version = "34.0.0", default-features = false }
sp-runtime = { version = "39.0.5", default-features = false }
sp-session = { version = "36.0.0", default-features = false }
frame-benchmarking = { version = "39.0.0", default-features = false }
frame-benchmarking-cli = "45.0.0"
frame-executive = { version = "39.0.0", default-features = false }
frame-support = { version = "39.0.0", default-features = false }
frame-support-procedural = { version = "31.0.0", default-features = false }
frame-system = { version = "39.0.0", default-features = false }
frame-system-benchmarking = { version = "39.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "35.0.0", default-features = false }
frame-try-runtime = { version = "0.45.0", default-features = false }
frame-metadata-hash-extension = { version = "0.7.0", default-features = false }
pallet-aura = { version = "38.0.0", default-features = false }
pallet-authorship = { version = "39.0.0", default-features = false }
pallet-balances = { version = "40.0.0", default-features = false }
pallet-message-queue = { version = "42.0.0", default-features = false }
pallet-session = { version = "39.0.0", default-features = false }
pallet-sudo = { version = "39.0.0", default-features = false }
pallet-timestamp = { version = "38.0.0", default-features = false }
pallet-transaction-payment = { version = "39.0.0", default-features = false }
pallet-transaction-payment-rpc = "42.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "39.0.0", default-features = false }
prometheus-endpoint = { version = "0.17.1", default-features = false, package = "substrate-prometheus-endpoint" }
sc-basic-authorship = "0.47.0"
sc-chain-spec = "40.0.0"
sc-cli = "0.49.0"
sc-client-api = "38.0.0"
sc-offchain = "42.0.0"
sc-consensus = "0.46.0"
sc-executor = "0.41.0"
sc-network = "0.47.0"
sc-network-sync = "0.46.0"
sc-rpc = "42.0.0"
sc-service = "0.48.0"
sc-sysinfo = "40.0.0"
sc-telemetry = "27.0.0"
sc-tracing = "38.0.0"
sc-transaction-pool = "38.0.0"
sc-transaction-pool-api = "38.0.0"
sp-api = { version = "35.0.0", default-features = false }
sp-block-builder = { version = "35.0.0", default-features = false }
sp-blockchain = "38.0.0"
sp-consensus-aura = { version = "0.41.0", default-features = false }
sp-core = { version = "35.0.0", default-features = false }
sp-io = { version = "39.0.0", default-features = false }
sp-genesis-builder = { version = "0.16.0", default-features = false }
sp-inherents = { version = "35.0.0", default-features = false }
sp-keyring = { version = "40.0.0", default-features = false }
sp-keystore = "0.41.0"
sp-offchain = { version = "35.0.0", default-features = false }
sp-runtime = { version = "40.0.0", default-features = false }
sp-session = { version = "37.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-timestamp = "34.0.0"
sp-transaction-pool = { version = "34.0.0", default-features = false }
sp-version = { version = "37.0.0", default-features = false }
substrate-frame-rpc-system = "39.0.0"
sp-timestamp = "35.0.0"
sp-transaction-pool = { version = "35.0.0", default-features = false }
sp-version = { version = "38.0.0", default-features = false }
substrate-frame-rpc-system = "41.0.0"

# Polkadot
pallet-xcm = { version = "17.0.1", default-features = false }
polkadot-cli = "19.0.0"
polkadot-parachain-primitives = { version = "14.0.0", default-features = false }
polkadot-primitives = "16.0.0"
polkadot-runtime-common = { version = "17.0.0", default-features = false }
xcm = { version = "14.2.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "17.0.3", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "17.0.0", package = "staging-xcm-executor", default-features = false }
pallet-xcm = { version = "18.0.0", default-features = false }
polkadot-cli = "21.0.0"
polkadot-parachain-primitives = { version = "15.0.0", default-features = false }
polkadot-primitives = "17.0.0"
polkadot-runtime-common = { version = "18.0.0", default-features = false }
xcm = { version = "15.0.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "18.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "18.0.0", package = "staging-xcm-executor", default-features = false }

# Cumulus
cumulus-client-cli = "0.18.0"
cumulus-client-collator = "0.18.0"
cumulus-client-consensus-aura = "0.18.0"
cumulus-client-consensus-common = "0.18.0"
cumulus-client-consensus-proposer = "0.16.0"
cumulus-client-service = "0.19.0"
cumulus-pallet-aura-ext = { version = "0.17.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.17.1", default-features = false }
cumulus-pallet-session-benchmarking = { version = "19.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.17.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.17.0", default-features = false }
cumulus-primitives-aura = { version = "0.15.0", default-features = false }
cumulus-primitives-core = { version = "0.16.0", default-features = false }
cumulus-primitives-parachain-inherent = "0.16.0"
cumulus-primitives-storage-weight-reclaim = { version = "8.0.0", default-features = false }
cumulus-primitives-utility = { version = "0.17.0", default-features = false }
cumulus-relay-chain-interface = "0.18.0"
pallet-collator-selection = { version = "19.0.0", default-features = false }
parachains-common = { version = "18.0.0", default-features = false }
parachain-info = { version = "0.17.0", package = "staging-parachain-info", default-features = false }
cumulus-client-cli = "0.20.0"
cumulus-client-collator = "0.20.0"
cumulus-client-consensus-aura = "0.20.0"
cumulus-client-consensus-common = "0.20.0"
cumulus-client-consensus-proposer = "0.17.0"
cumulus-client-service = "0.21.0"
cumulus-pallet-aura-ext = { version = "0.18.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.18.0", default-features = false }
cumulus-pallet-session-benchmarking = { version = "20.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.18.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.18.0", default-features = false }
cumulus-primitives-aura = { version = "0.16.0", default-features = false }
cumulus-primitives-core = { version = "0.17.0", default-features = false }
cumulus-primitives-parachain-inherent = "0.17.0"
cumulus-primitives-storage-weight-reclaim = { version = "9.0.0", default-features = false }
cumulus-primitives-utility = { version = "0.18.0", default-features = false }
cumulus-relay-chain-interface = "0.20.0"
pallet-collator-selection = { version = "20.0.0", default-features = false }
parachains-common = { version = "19.0.0", default-features = false }
parachain-info = { version = "0.18.0", package = "staging-parachain-info", default-features = false }
16 changes: 9 additions & 7 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,15 @@ pub fn run() -> Result<()> {

runner.run_node_until_exit(|config| async move {
let hwbench = (!cli.no_hardware_benchmarks)
.then_some(config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(
Some(database_path),
&SUBSTRATE_REFERENCE_HARDWARE,
)
}))
.then(|| {
config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(
Some(database_path),
&SUBSTRATE_REFERENCE_HARDWARE,
)
})
})
.flatten();

let para_id = chain_spec::Extensions::try_get(&*config.chain_spec)
Expand Down
33 changes: 19 additions & 14 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub type Service = PartialComponents<
ParachainBackend,
(),
sc_consensus::DefaultImportQueue<Block>,
sc_transaction_pool::FullPool<Block, ParachainClient>,
sc_transaction_pool::TransactionPoolHandle<Block, ParachainClient>,
(
ParachainBlockImport,
Option<Telemetry>,
Expand Down Expand Up @@ -111,12 +111,15 @@ pub fn new_partial(config: &Configuration) -> Result<Service, sc_service::Error>
telemetry
});

let transaction_pool = sc_transaction_pool::BasicPool::new_full(
config.transaction_pool.clone(),
config.role.is_authority().into(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
let transaction_pool = Arc::from(
sc_transaction_pool::Builder::new(
task_manager.spawn_essential_handle(),
client.clone(),
config.role.is_authority().into(),
)
.with_options(config.transaction_pool.clone())
.with_prometheus(config.prometheus_registry())
.build(),
);

let block_import = ParachainBlockImport::new(client.clone(), backend.clone());
Expand Down Expand Up @@ -177,7 +180,7 @@ fn start_consensus(
telemetry: Option<TelemetryHandle>,
task_manager: &TaskManager,
relay_chain_interface: Arc<dyn RelayChainInterface>,
transaction_pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient>>,
transaction_pool: Arc<sc_transaction_pool::TransactionPoolHandle<Block, ParachainClient>>,
keystore: KeystorePtr,
relay_chain_slot_duration: Duration,
para_id: ParaId,
Expand Down Expand Up @@ -293,9 +296,7 @@ pub async fn start_parachain_node(
if parachain_config.offchain_worker.enabled {
use futures::FutureExt;

task_manager.spawn_handle().spawn(
"offchain-workers-runner",
"offchain-work",
let offchain_workers =
sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions {
runtime_api_provider: client.clone(),
keystore: Some(params.keystore_container.keystore()),
Expand All @@ -307,9 +308,13 @@ pub async fn start_parachain_node(
is_validator: parachain_config.role.is_authority(),
enable_http_requests: false,
custom_extensions: move |_| vec![],
})
.run(client.clone(), task_manager.spawn_handle())
.boxed(),
})?;
task_manager.spawn_handle().spawn(
"offchain-workers-runner",
"offchain-work",
offchain_workers
.run(client.clone(), task_manager.spawn_handle())
.boxed(),
);
}

Expand Down
2 changes: 2 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ sp-consensus-aura.workspace = true
sp-core.workspace = true
sp-genesis-builder.workspace = true
sp-inherents.workspace = true
sp-keyring.workspace = true
sp-offchain.workspace = true
sp-runtime.workspace = true
sp-session.workspace = true
Expand Down Expand Up @@ -123,6 +124,7 @@ std = [
"sp-core/std",
"sp-genesis-builder/std",
"sp-inherents/std",
"sp-keyring/std",
"sp-offchain/std",
"sp-runtime/std",
"sp-session/std",
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl_runtime_apis! {

fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, alloc::string::String> {
use frame_benchmarking::{BenchmarkError, Benchmarking, BenchmarkBatch};
use super::*;

Expand Down
3 changes: 3 additions & 0 deletions runtime/src/configs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ impl pallet_balances::Config for Runtime {
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = RuntimeFreezeReason;
type MaxFreezes = VariantCountOf<RuntimeFreezeReason>;
type DoneSlashHandler = ();
}

parameter_types! {
Expand All @@ -173,6 +174,7 @@ impl pallet_transaction_payment::Config for Runtime {
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
type OperationalFeeMultiplier = ConstU8<5>;
type WeightInfo = ();
}

impl pallet_sudo::Config for Runtime {
Expand All @@ -199,6 +201,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
type ReservedXcmpWeight = ReservedXcmpWeight;
type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases;
type ConsensusHook = ConsensusHook;
type SelectCore = cumulus_pallet_parachain_system::DefaultCoreSelector<Runtime>;
}

impl parachain_info::Config for Runtime {}
Expand Down
Loading

0 comments on commit 82741b4

Please sign in to comment.