Skip to content

Commit

Permalink
Merge pull request #9 from r0gue-io/frank/chore-polkadot-v1.9
Browse files Browse the repository at this point in the history
chore: update to polkadot v1.9
  • Loading branch information
Daanvdplas authored Mar 25, 2024
2 parents da97058 + 85d7c21 commit bcc25e2
Show file tree
Hide file tree
Showing 8 changed files with 780 additions and 621 deletions.
1,212 changes: 680 additions & 532 deletions Cargo.lock

Large diffs are not rendered by default.

155 changes: 78 additions & 77 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,94 +29,95 @@ serde_json = "1.0.114"


# Build
substrate-wasm-builder = "19.0.0"
substrate-wasm-builder = "20.0.0"
substrate-build-script-utils = "11.0.0"

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

# Substrate
sc-basic-authorship = "0.36.0"
sc-chain-spec = "29.0.0"
sc-cli = "0.38.0"
sc-client-api = "30.0.0"
sc-offchain = "31.0.0"
sc-consensus = "0.35.0"
sc-executor = "0.34.0"
sc-network = "0.36.0"
sc-network-sync = "0.35.0"
sc-rpc = "31.0.0"
sc-service = "0.37.0"
sc-sysinfo = "29.0.0"
sc-basic-authorship = "0.37.0"
sc-chain-spec = "30.0.0"
sc-cli = "0.39.0"
sc-client-api = "31.0.0"
sc-offchain = "32.0.0"
sc-consensus = "0.36.0"
sc-executor = "0.35.0"
sc-network = "0.37.0"
sc-network-sync = "0.36.0"
sc-rpc = "32.0.0"
sc-service = "0.38.0"
sc-sysinfo = "30.0.0"
sc-telemetry = "17.0.0"
sc-tracing = "30.0.0"
sc-transaction-pool = "30.0.0"
sc-transaction-pool-api = "30.0.0"
frame-benchmarking = { version = "30.0.0", default-features = false }
frame-benchmarking-cli = "34.0.0"
frame-executive = { version = "30.0.0", default-features = false }
frame-support = { version = "30.0.0", default-features = false }
frame-system = { version = "30.0.0", default-features = false }
frame-system-benchmarking = { version = "30.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "28.0.0", default-features = false }
frame-try-runtime = { version = "0.36.0", default-features = false }
pallet-aura = { version = "29.0.0", default-features = false }
pallet-authorship = { version = "30.0.0", default-features = false }
pallet-balances = { version = "30.0.0", default-features = false }
pallet-message-queue = { version = "33.0.0", default-features = false }
pallet-session = { version = "30.0.0", default-features = false }
pallet-sudo = { version = "30.0.0", default-features = false }
pallet-timestamp = { version = "29.0.0", default-features = false }
pallet-transaction-payment = { version = "30.0.0", default-features = false }
pallet-transaction-payment-rpc = "32.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "30.0.0", default-features = false }
sp-api = { version = "28.0.0", default-features = false }
sp-block-builder = { version = "28.0.0", default-features = false }
sp-blockchain = "30.0.0"
sp-consensus-aura = { version = "0.34.0", default-features = false }
sp-core = { version = "30.0.0", default-features = false }
sp-keystore = "0.36.0"
sp-io = { version = "32.0.0", default-features = false }
sp-genesis-builder = { version = "0.9.0", default-features = false }
sp-inherents = { version = "28.0.0", default-features = false }
sp-offchain = { version = "28.0.0", default-features = false }
sp-runtime = { version = "33.0.0", default-features = false }
sp-timestamp = "28.0.0"
substrate-frame-rpc-system = "30.0.0"
sc-tracing = "31.0.0"
sc-transaction-pool = "31.0.0"
sc-transaction-pool-api = "31.0.0"
frame-benchmarking = { version = "31.0.0", default-features = false }
frame-benchmarking-cli = "35.0.0"
frame-executive = { version = "31.0.0", default-features = false }
frame-support = { version = "31.0.0", default-features = false }
frame-system = { version = "31.0.0", default-features = false }
frame-system-benchmarking = { version = "31.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "29.0.0", default-features = false }
frame-try-runtime = { version = "0.37.0", default-features = false }
pallet-aura = { version = "30.0.0", default-features = false }
pallet-authorship = { version = "31.0.0", default-features = false }
pallet-balances = { version = "31.0.0", default-features = false }
pallet-message-queue = { version = "34.0.0", default-features = false }
pallet-session = { version = "31.0.0", default-features = false }
pallet-sudo = { version = "31.0.0", default-features = false }
pallet-timestamp = { version = "30.0.0", default-features = false }
pallet-transaction-payment = { version = "31.0.0", default-features = false }
pallet-transaction-payment-rpc = "33.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "31.0.0", default-features = false }
sp-api = { version = "29.0.0", default-features = false }
sp-block-builder = { version = "29.0.0", default-features = false }
sp-blockchain = "31.0.0"
sp-consensus-aura = { version = "0.35.0", default-features = false }
sp-core = { version = "31.0.0", default-features = false }
sp-keystore = "0.37.0"
sp-io = { version = "33.0.0", default-features = false }
sp-genesis-builder = { version = "0.10.0", default-features = false }
sp-inherents = { version = "29.0.0", default-features = false }
sp-offchain = { version = "29.0.0", default-features = false }
sp-runtime = { version = "34.0.0", default-features = false }
sp-timestamp = "29.0.0"
substrate-frame-rpc-system = "31.0.0"
substrate-prometheus-endpoint = "0.17.0"
sp-session = { version = "29.0.0", default-features = false }
sp-session = { version = "30.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-transaction-pool = { version = "28.0.0", default-features = false }
sp-version = { version = "31.0.0", default-features = false }
sp-transaction-pool = { version = "29.0.0", default-features = false }
sp-version = { version = "32.0.0", default-features = false }

# Polkadot
pallet-xcm = { version = "9.0.0", default-features = false }
polkadot-cli = "9.0.0"
polkadot-parachain-primitives = { version = "8.0.0", default-features = false }
polkadot-primitives = "9.0.0"
xcm = { package = "staging-xcm", version = "9.0.0", default-features = false }
polkadot-runtime-common = { version = "9.0.0", default-features = false }
xcm-builder = { package = "staging-xcm-builder", version = "9.0.0", default-features = false }
xcm-executor = { package = "staging-xcm-executor", version = "9.0.1", default-features = false }
pallet-xcm = { version = "10.0.0", default-features = false }
polkadot-cli = "10.0.0"
polkadot-parachain-primitives = { version = "9.0.0", default-features = false }
polkadot-primitives = "10.0.0"
xcm = { package = "staging-xcm", version = "10.0.0", default-features = false }
polkadot-runtime-common = { version = "10.0.0", default-features = false }
xcm-builder = { package = "staging-xcm-builder", version = "10.0.0", default-features = false }
xcm-executor = { package = "staging-xcm-executor", version = "10.0.0", default-features = false }

# Cumulus
cumulus-pallet-aura-ext = { version = "0.9.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.9.0", default-features = false, features = ["parameterized-consensus-hook"] }
cumulus-pallet-session-benchmarking = { version = "11.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.9.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.9.0", default-features = false }
cumulus-primitives-aura = { version = "0.9.0", default-features = false }
cumulus-primitives-core = { version = "0.9.0", default-features = false }
cumulus-primitives-utility = { version = "0.9.0", default-features = false }
pallet-collator-selection = { version = "11.0.0", default-features = false }
parachains-common = { version = "9.0.0", default-features = false }
parachain-info = { package = "staging-parachain-info", version = "0.9.0", default-features = false }
cumulus-primitives-parachain-inherent = "0.9.0"
cumulus-relay-chain-interface = "0.9.0"
cumulus-pallet-aura-ext = { version = "0.10.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.10.0", default-features = false, features = ["parameterized-consensus-hook"] }
cumulus-pallet-session-benchmarking = { version = "12.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.10.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.10.0", default-features = false }
cumulus-primitives-aura = { version = "0.10.0", default-features = false }
cumulus-primitives-core = { version = "0.10.0", default-features = false }
cumulus-primitives-utility = { version = "0.10.0", default-features = false }
cumulus-primitives-storage-weight-reclaim = { version = "1.0.0", default-features = false }
pallet-collator-selection = { version = "12.0.0", default-features = false }
parachains-common = { version = "10.0.0", default-features = false }
parachain-info = { package = "staging-parachain-info", version = "0.10.0", default-features = false }
cumulus-primitives-parachain-inherent = "0.10.0"
cumulus-relay-chain-interface = "0.10.0"
color-print = "0.3.4"
cumulus-client-cli = "0.9.0"
cumulus-client-collator = "0.9.0"
cumulus-client-consensus-aura = "0.9.0"
cumulus-client-consensus-common = "0.9.0"
cumulus-client-consensus-proposer = "0.9.0"
cumulus-client-service = "0.9.0"
cumulus-client-cli = "0.10.0"
cumulus-client-collator = "0.10.0"
cumulus-client-consensus-aura = "0.10.0"
cumulus-client-consensus-common = "0.10.0"
cumulus-client-consensus-proposer = "0.10.0"
cumulus-client-service = "0.10.0"
11 changes: 6 additions & 5 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use cumulus_primitives_core::ParaId;
use parachain_template_runtime::{AccountId, AuraId, Signature, EXISTENTIAL_DEPOSIT};
use parachain_template_runtime as runtime;
use runtime::{AccountId, AuraId, Signature, EXISTENTIAL_DEPOSIT};
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
use sc_service::ChainType;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -56,8 +57,8 @@ where
/// Generate the session keys from individual elements.
///
/// The input must be a tuple of individual keys (a single arg for now since we have just one key).
pub fn template_session_keys(keys: AuraId) -> parachain_template_runtime::SessionKeys {
parachain_template_runtime::SessionKeys { aura: keys }
pub fn template_session_keys(keys: AuraId) -> runtime::SessionKeys {
runtime::SessionKeys { aura: keys }
}

pub fn development_config() -> ChainSpec {
Expand All @@ -68,7 +69,7 @@ pub fn development_config() -> ChainSpec {
properties.insert("ss58Format".into(), 42.into());

ChainSpec::builder(
parachain_template_runtime::WASM_BINARY
runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions {
relay_chain: "rococo-local".into(),
Expand Down Expand Up @@ -120,7 +121,7 @@ pub fn local_testnet_config() -> ChainSpec {

#[allow(deprecated)]
ChainSpec::builder(
parachain_template_runtime::WASM_BINARY
runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions {
relay_chain: "rococo-local".into(),
Expand Down
2 changes: 1 addition & 1 deletion node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub enum Subcommand {

/// Try-runtime has migrated to a standalone
/// [CLI](<https://github.com/paritytech/try-runtime-cli>). The subcommand exists as a stub and
/// deprecation notice. It will be removed entirely some time after Janurary 2024.
/// deprecation notice. It will be removed entirely some time after January 2024.
TryRuntime,
}

Expand Down
3 changes: 2 additions & 1 deletion node/src/command.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::net::SocketAddr;

use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use log::info;
Expand Down Expand Up @@ -183,7 +184,7 @@ pub fn run() -> Result<()> {
match cmd {
BenchmarkCmd::Pallet(cmd) =>
if cfg!(feature = "runtime-benchmarks") {
runner.sync_run(|config| cmd.run::<sp_runtime::traits::HashingFor<Block>, ()>(config))
runner.sync_run(|config| cmd.run::<sp_runtime::traits::HashingFor<Block>, ReclaimHostFunctions>(config))
} else {
Err("Benchmarking wasn't enabled when building the node. \
You can enable it with `--features runtime-benchmarks`."
Expand Down
8 changes: 6 additions & 2 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ use substrate_prometheus_endpoint::Registry;
pub struct ParachainNativeExecutor;

impl sc_executor::NativeExecutionDispatch for ParachainNativeExecutor {
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
type ExtendHostFunctions = (
cumulus_client_service::storage_proof_size::HostFunctions,
frame_benchmarking::benchmarking::HostFunctions,
);

fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
parachain_template_runtime::api::dispatch(method, data)
Expand Down Expand Up @@ -103,10 +106,11 @@ pub fn new_partial(config: &Configuration) -> Result<Service, sc_service::Error>
let executor = ParachainExecutor::new_with_wasm_executor(wasm);

let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>(
sc_service::new_full_parts_record_import::<Block, RuntimeApi, _>(
config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor,
true,
)?;
let client = Arc::new(client);

Expand Down
3 changes: 3 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true
edition.workspace = true
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down Expand Up @@ -67,6 +68,7 @@ cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-primitives-aura = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-storage-weight-reclaim = { workspace = true }
cumulus-primitives-utility = { workspace = true }
pallet-collator-selection = { workspace = true }
parachains-common = { workspace = true }
Expand All @@ -83,6 +85,7 @@ std = [
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-aura/std",
"cumulus-primitives-core/std",
"cumulus-primitives-storage-weight-reclaim/std",
"cumulus-primitives-utility/std",
"frame-benchmarking/std",
"frame-executive/std",
Expand Down
7 changes: 4 additions & 3 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down Expand Up @@ -176,8 +177,8 @@ impl_opaque_keys! {

#[sp_version::runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("template-parachain"),
impl_name: create_runtime_str!("template-parachain"),
spec_name: create_runtime_str!("parachain-template-runtime"),
impl_name: create_runtime_str!("parachain-template-runtime"),
authoring_version: 1,
spec_version: 1,
impl_version: 0,
Expand Down Expand Up @@ -554,7 +555,7 @@ impl_runtime_apis! {
Executive::execute_block(block)
}

fn initialize_block(header: &<Block as BlockT>::Header) {
fn initialize_block(header: &<Block as BlockT>::Header) -> sp_runtime::ExtrinsicInclusionMode {
Executive::initialize_block(header)
}
}
Expand Down

0 comments on commit bcc25e2

Please sign in to comment.