Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade to polkadot v1.14.0 #8

Merged
merged 17 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,721 changes: 1,453 additions & 1,268 deletions Cargo.lock

Large diffs are not rendered by default.

177 changes: 88 additions & 89 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ resolver = "2"

[workspace.dependencies]
clap = { version = "4.5.3", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
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"
hex-literal = "0.4.1"
jsonrpsee = { version = "0.22", features = ["server"] }
log = { version = "0.4.20", default-features = false }
jsonrpsee = { version = "0.23.2", features = ["server"] }
log = { version = "0.4.21", default-features = false }
scale-info = { version = "2.11.1", default-features = false, features = [
"derive",
] }
Expand All @@ -32,99 +32,98 @@ smallvec = "1.11.2"

# Build
substrate-build-script-utils = "11.0.0"
substrate-wasm-builder = "22.0.0"
substrate-wasm-builder = "23.0.0"

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

# Substrate
frame-benchmarking = { version = "34.0.0", default-features = false }
frame-benchmarking-cli = "38.0.0"
frame-executive = { version = "34.0.0", default-features = false }
frame-support = { version = "34.0.0", default-features = false }
frame-system = { version = "34.0.1", default-features = false }
frame-system-benchmarking = { version = "34.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "32.0.0", default-features = false }
frame-try-runtime = { version = "0.40.0", default-features = false }
pallet-aura = { version = "33.0.0", default-features = false }
pallet-assets = { version = "35.0.0", default-features = false }
pallet-authorship = { version = "34.0.0", default-features = false }
pallet-balances = { version = "35.0.0", default-features = false }
pallet-message-queue = { version = "37.0.0", default-features = false }
pallet-nfts = { version = "28.0.0", default-features = false }
pallet-nfts-runtime-api = { version = "20.0.0", default-features = false }
pallet-nft-fractionalization = { version = "16.0.0", default-features = false }
pallet-session = { version = "34.0.0", default-features = false }
pallet-sudo = { version = "34.0.0", default-features = false }
pallet-timestamp = { version = "33.0.0", default-features = false }
pallet-transaction-payment = { version = "34.0.0", default-features = false }
pallet-transaction-payment-rpc = "36.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "34.0.0", default-features = false }
sc-basic-authorship = "0.40.0"
sc-chain-spec = "33.0.0"
sc-cli = "0.42.0"
sc-client-api = "34.0.0"
sc-offchain = "35.0.0"
sc-consensus = "0.39.1"
sc-executor = "0.38.0"
sc-network = "0.40.0"
sc-network-sync = "0.39.0"
sc-rpc = "35.0.0"
sc-service = "0.41.0"
sc-sysinfo = "33.0.0"
sc-telemetry = "20.0.0"
sc-tracing = "34.0.0"
sc-transaction-pool = "34.0.0"
sc-transaction-pool-api = "34.0.0"
sp-api = { version = "32.0.0", default-features = false }
sp-block-builder = { version = "32.0.0", default-features = false }
sp-blockchain = "34.0.0"
sp-consensus-aura = { version = "0.38.0", default-features = false }
sp-core = { version = "33.0.1", default-features = false }
sp-io = { version = "36.0.0", default-features = false }
sp-genesis-builder = { version = "0.13.0", default-features = false }
sp-inherents = { version = "32.0.0", default-features = false }
sp-keystore = "0.39.0"
sp-offchain = { version = "32.0.0", default-features = false }
sp-runtime = { version = "37.0.0", default-features = false }
sp-session = { version = "33.0.0", default-features = false }
frame-benchmarking = { version = "36.0.0", default-features = false }
frame-benchmarking-cli = "40.0.0"
frame-executive = { version = "36.0.0", default-features = false }
frame-support = { version = "36.0.0", default-features = false }
frame-system = { version = "36.1.0", default-features = false }
frame-system-benchmarking = { version = "36.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "33.0.0", default-features = false }
frame-try-runtime = { version = "0.42.0", default-features = false }
frame-metadata-hash-extension = { version = "0.4.0", default-features = false }
pallet-assets = { version = "37.0.0", default-features = false }
pallet-aura = { version = "35.0.0", default-features = false }
pallet-authorship = { version = "36.0.0", default-features = false }
pallet-balances = { version = "37.0.0", default-features = false }
pallet-message-queue = { version = "39.0.0", default-features = false }
pallet-nfts = { version = "30.0.0", default-features = false }
pallet-nfts-runtime-api = { version = "22.0.0", default-features = false }
pallet-nft-fractionalization = { version = "18.0.0", default-features = false }
pallet-session = { version = "36.0.0", default-features = false }
pallet-sudo = { version = "36.0.0", default-features = false }
pallet-timestamp = { version = "35.0.0", default-features = false }
pallet-transaction-payment = { version = "36.0.0", default-features = false }
pallet-transaction-payment-rpc = "38.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "36.0.0", default-features = false }
prometheus-endpoint = { version = "0.17.0", default-features = false, package = "substrate-prometheus-endpoint" }
sc-basic-authorship = "0.42.0"
sc-chain-spec = "35.0.0"
sc-cli = "0.44.0"
sc-client-api = "35.1.0"
sc-offchain = "37.0.0"
sc-consensus = "0.41.0"
sc-executor = "0.39.0"
sc-network = "0.42.0"
sc-network-sync = "0.41.0"
sc-rpc = "37.0.0"
sc-service = "0.43.0"
sc-sysinfo = "35.0.0"
sc-telemetry = "22.0.0"
sc-tracing = "35.0.0"
sc-transaction-pool = "35.0.0"
sc-transaction-pool-api = "35.0.0"
sp-api = { version = "33.0.0", default-features = false }
sp-block-builder = { version = "33.0.0", default-features = false }
sp-blockchain = "35.1.0"
sp-consensus-aura = { version = "0.39.0", default-features = false }
sp-core = { version = "34.0.0", default-features = false }
sp-io = { version = "37.0.0", default-features = false }
sp-genesis-builder = { version = "0.14.0", default-features = false }
sp-inherents = { version = "33.0.0", default-features = false }
sp-keystore = "0.40.0"
sp-offchain = { version = "33.0.0", default-features = false }
sp-runtime = { version = "38.0.0", default-features = false }
sp-session = { version = "34.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-timestamp = "32.0.0"
sp-transaction-pool = { version = "32.0.0", default-features = false }
sp-version = { version = "35.0.0", default-features = false }
substrate-frame-rpc-system = "34.0.0"
substrate-prometheus-endpoint = "0.17.0"
sp-timestamp = "33.0.0"
sp-transaction-pool = { version = "33.0.0", default-features = false }
sp-version = { version = "36.0.0", default-features = false }
substrate-frame-rpc-system = "36.0.0"

# Polkadot
pallet-xcm = { version = "13.0.0", default-features = false }
polkadot-cli = "13.0.0"
polkadot-parachain-primitives = { version = "12.0.0", default-features = false }
polkadot-primitives = "13.0.0"
polkadot-runtime-common = { version = "13.0.0", default-features = false }
xcm = { version = "13.0.1", package = "staging-xcm", default-features = false }
xcm-builder = { version = "13.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "13.0.0", package = "staging-xcm-executor", default-features = false }
pallet-xcm = { version = "15.0.0", default-features = false }
polkadot-cli = "15.0.0"
polkadot-parachain-primitives = { version = "13.0.0", default-features = false }
polkadot-primitives = "14.0.0"
polkadot-runtime-common = { version = "15.0.0", default-features = false }
xcm = { version = "14.0.3", package = "staging-xcm", default-features = false }
xcm-builder = { version = "15.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "15.0.0", package = "staging-xcm-executor", default-features = false }

# Cumulus
cumulus-client-cli = "0.13.0"
cumulus-client-collator = "0.13.0"
cumulus-client-consensus-aura = "0.13.0"
cumulus-client-consensus-common = "0.13.0"
cumulus-client-consensus-proposer = "0.13.0"
cumulus-client-service = "0.13.0"
cumulus-pallet-aura-ext = { version = "0.13.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.13.0", default-features = false, features = [
"parameterized-consensus-hook",
] }
cumulus-pallet-session-benchmarking = { version = "15.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.13.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.13.0", default-features = false }
cumulus-primitives-aura = { version = "0.13.0", default-features = false }
cumulus-primitives-core = { version = "0.13.0", default-features = false }
cumulus-primitives-parachain-inherent = "0.13.0"
cumulus-primitives-storage-weight-reclaim = { version = "4.0.0", default-features = false }
cumulus-primitives-utility = { version = "0.13.0", default-features = false }
cumulus-relay-chain-interface = "0.13.0"
pallet-collator-selection = { version = "15.0.0", default-features = false }
parachains-common = { version = "13.0.0", default-features = false }
parachain-info = { version = "0.13.0", package = "staging-parachain-info", default-features = false }
cumulus-client-cli = "0.15.0"
cumulus-client-collator = "0.15.0"
cumulus-client-consensus-aura = "0.15.0"
cumulus-client-consensus-common = "0.15.0"
cumulus-client-consensus-proposer = "0.14.0"
cumulus-client-service = "0.15.0"
cumulus-pallet-aura-ext = { version = "0.15.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.15.0", default-features = false }
cumulus-pallet-session-benchmarking = { version = "17.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.15.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.15.0", default-features = false }
cumulus-primitives-aura = { version = "0.14.0", default-features = false }
cumulus-primitives-core = { version = "0.14.0", default-features = false }
cumulus-primitives-parachain-inherent = "0.14.0"
cumulus-primitives-storage-weight-reclaim = { version = "6.0.2", default-features = false }
cumulus-primitives-utility = { version = "0.15.0", default-features = false }
cumulus-relay-chain-interface = "0.15.0"
pallet-collator-selection = { version = "17.0.0", default-features = false }
parachains-common = { version = "15.0.0", default-features = false }
parachain-info = { version = "0.15.0", package = "staging-parachain-info", default-features = false }
2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parachain-template-runtime.workspace = true
frame-benchmarking.workspace = true
frame-benchmarking-cli.workspace = true
pallet-transaction-payment-rpc.workspace = true
prometheus-endpoint.workspace = true
sc-basic-authorship.workspace = true
sc-chain-spec.workspace = true
sc-cli.workspace = true
Expand All @@ -58,7 +59,6 @@ sp-io.workspace = true
sp-runtime.workspace = true
sp-timestamp.workspace = true
substrate-frame-rpc-system.workspace = true
substrate-prometheus-endpoint.workspace = true

# Polkadot
polkadot-cli = { workspace = true, features = ["rococo-native"] }
Expand Down
2 changes: 1 addition & 1 deletion node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use sp_core::{sr25519, Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};

/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec = sc_service::GenericChainSpec<(), Extensions>;
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;

/// The default XCM version to set in genesis config.
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
Expand Down
4 changes: 2 additions & 2 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};

// Substrate Imports
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
use prometheus_endpoint::Registry;
use sc_client_api::Backend;
use sc_consensus::ImportQueue;
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
Expand All @@ -37,7 +38,6 @@ use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, Ta
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_keystore::KeystorePtr;
use substrate_prometheus_endpoint::Registry;

#[docify::export(wasm_executor)]
type ParachainExecutor = WasmExecutor<ParachainHostFunctions>;
Expand Down Expand Up @@ -339,7 +339,7 @@ pub async fn start_parachain_node(
config: parachain_config,
keystore: params.keystore_container.keystore(),
backend: backend.clone(),
network: network,
network,
sync_service: sync_service.clone(),
system_rpc_tx,
tx_handler_controller,
Expand Down
21 changes: 18 additions & 3 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ frame-support.workspace = true
frame-system.workspace = true
frame-system-benchmarking = { optional = true, workspace = true }
frame-system-rpc-runtime-api.workspace = true
frame-metadata-hash-extension.workspace = true
frame-try-runtime = { optional = true, workspace = true }
pallet-assets.workspace = true
pallet-aura.workspace = true
Expand Down Expand Up @@ -93,13 +94,14 @@ std = [
"cumulus-primitives-core/std",
"cumulus-primitives-storage-weight-reclaim/std",
"cumulus-primitives-utility/std",
"frame-benchmarking/std",
"frame-benchmarking?/std",
"frame-executive/std",
"frame-support/std",
"frame-system-benchmarking/std",
"frame-system-benchmarking?/std",
"frame-system-rpc-runtime-api/std",
"frame-system/std",
"frame-try-runtime/std",
"frame-try-runtime?/std",
"frame-metadata-hash-extension/std",
"log/std",
"pallet-assets/std",
"pallet-aura/std",
Expand Down Expand Up @@ -191,3 +193,16 @@ try-runtime = [
"polkadot-runtime-common/try-runtime",
"sp-runtime/try-runtime",
]

# Enable the metadata hash generation.
#
# This is hidden behind a feature because it increases the compile time.
# The wasm binary needs to be compiled twice, once to fetch the metadata,
# generate the metadata hash and then a second time with the
# `RUNTIME_METADATA_HASH` environment variable set for the `CheckMetadataHash`
# extension.
metadata-hash = ["substrate-wasm-builder/metadata-hash"]

# A convenience feature for enabling things when doing a build
# for an on-chain release.
on-chain-release-build = ["metadata-hash"]
12 changes: 11 additions & 1 deletion runtime/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#[cfg(feature = "std")]
#[cfg(all(feature = "std", feature = "metadata-hash"))]
#[docify::export(template_enable_metadata_hash)]
fn main() {
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("UNIT", 12)
.build();
}

#[cfg(all(feature = "std", not(feature = "metadata-hash")))]
fn main() {
substrate_wasm_builder::WasmBuilder::build_using_defaults();
}

/// The wasm builder is deactivated when compiling
/// this crate for wasm to speed up the compilation.
#[cfg(not(feature = "std"))]
fn main() {}
4 changes: 2 additions & 2 deletions runtime/src/apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl_runtime_apis! {
Runtime::metadata_at_version(version)
}

fn metadata_versions() -> sp_std::vec::Vec<u32> {
fn metadata_versions() -> Vec<u32> {
Runtime::metadata_versions()
}
}
Expand Down Expand Up @@ -293,7 +293,7 @@ impl_runtime_apis! {

use frame_system_benchmarking::Pallet as SystemBench;
impl frame_system_benchmarking::Config for Runtime {
fn setup_set_code_requirements(code: &sp_std::vec::Vec<u8>) -> Result<(), BenchmarkError> {
fn setup_set_code_requirements(code: &Vec<u8>) -> Result<(), BenchmarkError> {
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
Ok(())
}
Expand Down
14 changes: 10 additions & 4 deletions runtime/src/configs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ use frame_support::{
derive_impl,
dispatch::DispatchClass,
parameter_types,
traits::{ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, TransformOrigin},
traits::{
ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, TransformOrigin, VariantCountOf,
},
weights::{ConstantMultiplier, Weight},
PalletId,
};
Expand Down Expand Up @@ -156,8 +158,8 @@ impl pallet_balances::Config for Runtime {
type ReserveIdentifier = [u8; 8];
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxFreezes = ConstU32<0>;
type FreezeIdentifier = RuntimeFreezeReason;
type MaxFreezes = VariantCountOf<RuntimeFreezeReason>;
}

parameter_types! {
Expand Down Expand Up @@ -223,7 +225,7 @@ impl pallet_message_queue::Config for Runtime {
// The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin:
type QueueChangeHandler = NarrowOriginToSibling<XcmpQueue>;
type QueuePausedQuery = NarrowOriginToSibling<XcmpQueue>;
type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>;
type HeapSize = sp_core::ConstU32<{ 103 * 1024 }>;
type MaxStale = sp_core::ConstU32<8>;
type ServiceWeight = MessageQueueServiceWeight;
type IdleMaxServiceWeight = ();
Expand All @@ -242,6 +244,10 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
type WeightInfo = (); // Configure based on benchmarking results.
type PriceForSiblingDelivery = NoPriceForMessageDelivery<ParaId>;
// Limit the number of messages and signals a HRMP channel can have at most
type MaxActiveOutboundChannels = ConstU32<128>;
// Limit the number of HRMP channels
type MaxPageSize = ConstU32<{ 103 * 1024 }>;
}

parameter_types! {
Expand Down
Loading
Loading