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

Update to polkadot v1.10.0 #233

Merged
merged 1 commit into from
May 16, 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
1,467 changes: 704 additions & 763 deletions Cargo.lock

Large diffs are not rendered by default.

186 changes: 93 additions & 93 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace.package]
authors = ["anonymous"]
edition = "2021"
version = "0.40.0"
version = "0.41.0"
license = "Unlicense"
homepage = "https://github.com/paritytech/substrate-contracts-node"
repository = "https://github.com/paritytech/substrate-contracts-node"
Expand All @@ -26,112 +26,112 @@ jsonrpsee = { version = "0.22", features = ["server"] }
log = { version = "0.4.20", default-features = false }
serde = { version = "1.0.195", features = ["derive"] }
serde_json = "1.0.111"
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
scale-info = { version = "2.11.1", default-features = false, features = ["derive"] }
smallvec = "1.11.2"
color-print = "0.3.5"
wasmtime="8.0.1"

# Substrate
frame-benchmarking = { version = "31.0.0", default-features = false }
frame-benchmarking-cli = { version = "35.0.1" }
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-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-message-queue = { version = "34.0.0", default-features = false }
pallet-transaction-payment-rpc = { version = "33.0.0" }
pallet-transaction-payment-rpc-runtime-api = { version = "31.0.0", default-features = false }
sc-basic-authorship = { version = "0.37.0" }
sc-chain-spec = { version = "30.0.1" }
sc-cli = { version = "0.39.0" }
sc-client-api = { version = "31.0.0" }
sc-consensus = { version = "0.36.0" }
sc-executor = { version = "0.35.0" }
sc-network = { version = "0.37.0" }
sc-network-sync = { version = "0.36.0" }
sc-offchain = { version = "32.0.0" }
sc-rpc = { version = "32.0.0" }
sc-service = { version = "0.38.0" }
sc-sysinfo = { version = "30.0.0" }
sc-telemetry = { version = "17.0.0" }
sc-tracing = { version = "31.0.0" }
sc-transaction-pool = { version = "31.0.0" }
sc-transaction-pool-api = { version = "31.0.0" }
sp-api = { version = "29.0.0", default-features = false }
sp-keyring = { version = "34.0.0", default-features = false }
sp-block-builder = { version = "29.0.0", default-features = false }
sp-blockchain = { version = "31.0.0" }
sp-consensus-aura = { version = "0.35.0", default-features = false }
sp-core = { version = "31.0.0", default-features = false }
sp-inherents = { version = "29.0.0", default-features = false }
sp-io = { version = "33.0.0", default-features = false }
sp-keystore = { version = "0.37.0" }
sp-offchain = { version = "29.0.0", default-features = false }
sp-runtime = { version = "34.0.0", default-features = false }
sp-session = { version = "30.0.0", default-features = false }
frame-benchmarking = { version = "32.0.0", default-features = false }
frame-benchmarking-cli = { version = "36.0.0" }
frame-executive = { version = "32.0.0", default-features = false }
frame-support = { version = "32.0.0", default-features = false }
frame-system = { version = "32.0.0", default-features = false }
frame-system-benchmarking = { version = "32.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "30.0.0", default-features = false }
frame-try-runtime = { version = "0.38.0", default-features = false }
pallet-aura = { version = "31.0.0", default-features = false }
pallet-authorship = { version = "32.0.0", default-features = false }
pallet-balances = { version = "33.0.0", default-features = false }
pallet-session = { version = "32.0.0", default-features = false }
pallet-sudo = { version = "32.0.0", default-features = false }
pallet-timestamp = { version = "31.0.0", default-features = false }
pallet-transaction-payment = { version = "32.0.0", default-features = false }
pallet-message-queue = { version = "35.0.0", default-features = false }
pallet-transaction-payment-rpc = { version = "34.0.0" }
pallet-transaction-payment-rpc-runtime-api = { version = "32.0.0", default-features = false }
sc-basic-authorship = { version = "0.38.0" }
sc-chain-spec = { version = "31.0.0" }
sc-cli = { version = "0.40.0" }
sc-client-api = { version = "32.0.0" }
sc-consensus = { version = "0.37.0" }
sc-executor = { version = "0.36.0" }
sc-network = { version = "0.38.0" }
sc-network-sync = { version = "0.37.0" }
sc-offchain = { version = "33.0.0" }
sc-rpc = { version = "33.0.0" }
sc-service = { version = "0.39.0" }
sc-sysinfo = { version = "31.0.0" }
sc-telemetry = { version = "18.0.0" }
sc-tracing = { version = "32.0.0" }
sc-transaction-pool = { version = "32.0.0" }
sc-transaction-pool-api = { version = "32.0.0" }
sp-api = { version = "30.0.0", default-features = false }
sp-keyring = { version = "35.0.0", default-features = false }
sp-block-builder = { version = "30.0.0", default-features = false }
sp-blockchain = { version = "32.0.0" }
sp-consensus-aura = { version = "0.36.0", default-features = false }
sp-core = { version = "32.0.0", default-features = false }
sp-inherents = { version = "30.0.0", default-features = false }
sp-io = { version = "34.0.0", default-features = false }
sp-keystore = { version = "0.38.0" }
sp-offchain = { version = "30.0.0", default-features = false }
sp-runtime = { version = "35.0.0", default-features = false }
sp-session = { version = "31.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-timestamp = { version = "29.0.0" }
sp-transaction-pool = { version = "29.0.0", default-features = false }
sp-version = { version = "32.0.0", default-features = false }
substrate-frame-rpc-system = { version = "31.0.0" }
sp-timestamp = { version = "30.0.0" }
sp-transaction-pool = { version = "30.0.0", default-features = false }
sp-version = { version = "33.0.0", default-features = false }
substrate-frame-rpc-system = { version = "32.0.0" }
substrate-prometheus-endpoint = { version = "0.17.0" }
substrate-wasm-builder = { version = "20.0.0" }
substrate-wasm-builder = { version = "21.0.0" }
substrate-build-script-utils = { version = "11.0.0" }
try-runtime-cli = { version = "0.41.0" }
try-runtime-cli = { version = "0.42.0" }

# extra deps for running a solo node on top of a parachain
pallet-grandpa = { version = "31.0.0", default-features = false }
sc-consensus-grandpa = { version = "0.22.0", default-features = false }
sp-consensus-grandpa = { version = "16.0.0", default-features = false }
sp-genesis-builder = { version = "0.10.0", default-features = false }
sp-storage = { version = "20.0.0", default-features = false }
sc-consensus-aura = { version = "0.37.0", default-features = false }
sc-consensus-manual-seal = { version = "0.38.0", default-features = false }
pallet-grandpa = { version = "32.0.0", default-features = false }
sc-consensus-grandpa = { version = "0.23.0", default-features = false }
sp-consensus-grandpa = { version = "17.0.0", default-features = false }
sp-genesis-builder = { version = "0.11.0", default-features = false }
sp-storage = { version = "21.0.0", default-features = false }
sc-consensus-aura = { version = "0.38.0", default-features = false }
sc-consensus-manual-seal = { version = "0.39.0", default-features = false }

# extra deps for setting up pallet-contracts
pallet-contracts = { version = "30.0.0", default-features = false }
pallet-insecure-randomness-collective-flip = { version = "19.0.0", default-features = false }
pallet-assets = { version = "32.0.0", default-features = false }
pallet-utility = { version = "31.0.0", default-features = false }
pallet-contracts = { version = "31.0.0", default-features = false }
pallet-insecure-randomness-collective-flip = { version = "20.0.0", default-features = false }
pallet-assets = { version = "33.0.0", default-features = false }
pallet-utility = { version = "32.0.0", default-features = false }

# Polkadot
pallet-xcm = { version = "10.0.1", default-features = false }
polkadot-cli = { version = "10.0.0", features = ["rococo-native"] }
polkadot-parachain-primitives = { version = "9.0.0", default-features = false }
polkadot-primitives = { version = "10.0.0" }
polkadot-runtime-common = { version = "10.0.0", default-features = false }
xcm = { version = "10.0.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "10.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "10.0.0", package = "staging-xcm-executor", default-features = false }
pallet-xcm = { version = "11.0.0", default-features = false }
polkadot-cli = { version = "11.0.0", features = ["rococo-native"] }
polkadot-parachain-primitives = { version = "10.0.0", default-features = false }
polkadot-primitives = { version = "11.0.0" }
polkadot-runtime-common = { version = "11.0.0", default-features = false }
xcm = { version = "11.0.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "11.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "11.0.0", package = "staging-xcm-executor", default-features = false }

# Cumulus
cumulus-client-cli = { version = "0.10.0" }
cumulus-client-collator = { version = "0.10.0" }
cumulus-client-consensus-proposer = { version = "0.10.0" }
cumulus-client-consensus-aura = { version = "0.10.0" }
cumulus-client-consensus-common = { version = "0.10.0" }
cumulus-client-service = { version = "0.10.0" }
cumulus-pallet-aura-ext = { version = "0.10.0", default-features = false }
cumulus-pallet-dmp-queue = { 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-core = { version = "0.10.0", default-features = false }
cumulus-primitives-parachain-inherent = { version = "0.10.0" }
cumulus-primitives-timestamp = { version = "0.10.0", default-features = false }
cumulus-primitives-utility = { version = "0.10.0", default-features = false }
cumulus-relay-chain-interface = { version = "0.10.0" }
pallet-collator-selection = { version = "12.0.0", default-features = false }
parachain-info = { version = "0.10.0", package = "staging-parachain-info", default-features = false }
parachains-common = { version = "10.0.0", default-features = false }
cumulus-client-cli = { version = "0.11.0" }
cumulus-client-collator = { version = "0.11.0" }
cumulus-client-consensus-proposer = { version = "0.11.0" }
cumulus-client-consensus-aura = { version = "0.11.0" }
cumulus-client-consensus-common = { version = "0.11.0" }
cumulus-client-service = { version = "0.11.0" }
cumulus-pallet-aura-ext = { version = "0.11.0", default-features = false }
cumulus-pallet-dmp-queue = { version = "0.11.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.11.0", default-features = false, features = ["parameterized-consensus-hook",] }
cumulus-pallet-session-benchmarking = { version = "13.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.11.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.11.0", default-features = false }
cumulus-primitives-core = { version = "0.11.0", default-features = false }
cumulus-primitives-parachain-inherent = { version = "0.11.0" }
cumulus-primitives-timestamp = { version = "0.11.0", default-features = false }
cumulus-primitives-utility = { version = "0.11.0", default-features = false }
cumulus-relay-chain-interface = { version = "0.11.0" }
pallet-collator-selection = { version = "13.0.0", default-features = false }
parachain-info = { version = "0.11.0", package = "staging-parachain-info", default-features = false }
parachains-common = { version = "11.0.0", default-features = false }

4 changes: 2 additions & 2 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ serde_json = { workspace = true }
wasmtime = { workspace = true }

# Local
contracts-parachain-runtime = { path = "../parachain-runtime", features = ["parachain"], version = "0.40.0" }
contracts-node-runtime = { path = "../runtime", version = "0.40.0" }
contracts-parachain-runtime = { path = "../parachain-runtime", features = ["parachain"], version = "0.41.0" }
contracts-node-runtime = { path = "../runtime", version = "0.41.0" }

# Substrate
frame-benchmarking = { workspace = true }
Expand Down
28 changes: 5 additions & 23 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImpo
use cumulus_client_consensus_proposer::Proposer;
use cumulus_client_service::{
build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks,
BuildNetworkParams, CollatorSybilResistance, DARecoveryProfile, StartRelayChainTasksParams,
BuildNetworkParams, CollatorSybilResistance, DARecoveryProfile, ParachainHostFunctions,
StartRelayChainTasksParams,
};
use cumulus_primitives_core::{relay_chain::CollatorPair, ParaId};
use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};
Expand All @@ -27,9 +28,7 @@ use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
use sc_client_api::Backend;
use sc_consensus::ImportQueue;
use sc_executor::{
HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
};
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
use sc_network::NetworkBlock;
use sc_network_sync::SyncingService;
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
Expand All @@ -38,22 +37,7 @@ use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_keystore::KeystorePtr;
use substrate_prometheus_endpoint::Registry;

/// Native executor type.
pub struct ParachainNativeExecutor;

impl sc_executor::NativeExecutionDispatch for ParachainNativeExecutor {
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;

fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
contracts_parachain_runtime::api::dispatch(method, data)
}

fn native_version() -> sc_executor::NativeVersion {
contracts_parachain_runtime::native_version()
}
}

type ParachainExecutor = NativeElseWasmExecutor<ParachainNativeExecutor>;
type ParachainExecutor = WasmExecutor<ParachainHostFunctions>;

type ParachainClient = TFullClient<Block, RuntimeApi, ParachainExecutor>;

Expand Down Expand Up @@ -91,16 +75,14 @@ pub fn new_partial(config: &Configuration) -> Result<Service, sc_service::Error>
.default_heap_pages
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });

let wasm = WasmExecutor::builder()
let executor = ParachainExecutor::builder()
.with_execution_method(config.wasm_method)
.with_onchain_heap_alloc_strategy(heap_pages)
.with_offchain_heap_alloc_strategy(heap_pages)
.with_max_runtime_instances(config.max_runtime_instances)
.with_runtime_cache_size(config.runtime_cache_size)
.build();

let executor = ParachainExecutor::new_with_wasm_executor(wasm);

let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>(
config,
Expand Down
3 changes: 1 addition & 2 deletions parachain-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ substrate-wasm-builder = {workspace = true, optional = true }
codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive"] }
hex-literal = { version = "0.4.1", optional = true }
log = { version = "0.4.20", default-features = false }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
scale-info = { version = "2.11.1", default-features = false, features = ["derive"] }
smallvec = "1.11.2"

# Substrate
Expand Down Expand Up @@ -178,5 +178,4 @@ try-runtime = [
"sp-runtime/try-runtime",
]

experimental = [ "pallet-aura/experimental" ]
parachain = []
6 changes: 3 additions & 3 deletions parachain-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ parameter_types! {
/// The default types are being injected by [`derive_impl`](`frame_support::derive_impl`) from
/// [`ParaChainDefaultConfig`](`struct@frame_system::config_preludes::ParaChainDefaultConfig`),
/// but overridden as needed.
#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig)]
impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
Expand Down Expand Up @@ -411,6 +411,7 @@ impl pallet_message_queue::Config for Runtime {
type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>;
type MaxStale = sp_core::ConstU32<8>;
type ServiceWeight = MessageQueueServiceWeight;
type IdleMaxServiceWeight = ();
}

impl cumulus_pallet_aura_ext::Config for Runtime {}
Expand Down Expand Up @@ -452,7 +453,6 @@ impl pallet_aura::Config for Runtime {
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = ConstBool<false>;
#[cfg(feature = "experimental")]
type SlotDuration = pallet_aura::MinimumPeriodTimesTwo<Self>;
}

Expand Down Expand Up @@ -560,7 +560,7 @@ impl_runtime_apis! {
}

fn authorities() -> Vec<AuraId> {
Aura::authorities().into_inner()
pallet_aura::Authorities::<Runtime>::get().into_inner()
}
}

Expand Down
3 changes: 3 additions & 0 deletions parachain-runtime/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ impl xcm_executor::Config for XcmConfig {
type SafeCallFilter = Everything;
type Aliasers = Nothing;
type TransactionalProcessor = FrameTransactionalProcessor;
type HrmpNewChannelOpenRequestHandler = ();
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
}

/// No local origins on this chain are allowed to dispatch XCM sends/executions.
Expand Down
1 change: 0 additions & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,3 @@ try-runtime = [
"pallet-assets/try-runtime",
"sp-runtime/try-runtime",
]
experimental = [ "pallet-aura/experimental" ]
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ parameter_types! {

// Configure FRAME pallets to include in runtime.

#[derive_impl(frame_system::config_preludes::SolochainDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::SolochainDefaultConfig)]
impl frame_system::Config for Runtime {
/// The block type for the runtime.
type Block = Block;
Expand Down