Skip to content

Commit

Permalink
Merge pull request #1 from use-ink/al3mart/sync-polkadot-stable2409
Browse files Browse the repository at this point in the history
chore(contracts-node): sync polkadot stable2409
  • Loading branch information
cmichi authored Nov 21, 2024
2 parents 120504a + 97ded67 commit 6e7f232
Show file tree
Hide file tree
Showing 16 changed files with 505 additions and 458 deletions.
200 changes: 101 additions & 99 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.41.0"
version = "0.42.0"
license = "Unlicense"
homepage = "https://github.com/paritytech/substrate-contracts-node"
repository = "https://github.com/paritytech/substrate-contracts-node"
Expand All @@ -18,120 +18,122 @@ members = [
panic = 'unwind'

[workspace.dependencies]
clap = { version = "4", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive"] }
clap = { version = "4.5.10", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = ["derive"] }
futures = "0.3.30"
hex-literal = { version = "0.4.1"}
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"
jsonrpsee = { version = "0.24.3", features = ["server"] }
log = { version = "0.4.22", default-features = false }
serde = { version = "1.0.209", features = ["derive"] }
serde_json = "1.0.127"
scale-info = { version = "2.11.1", default-features = false, features = ["derive"] }
smallvec = "1.11.2"
color-print = "0.3.5"
smallvec = "1.11.0"
color-print = "0.3.4"
wasmtime="8.0.1"

# Substrate
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 }
frame-benchmarking = { version = "38.0.0", default-features = false }
frame-benchmarking-cli = { version = "43.0.0" }
frame-executive = { version = "38.0.0", default-features = false }
frame-support = { version = "38.0.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 }
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-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.0", default-features = false }
pallet-message-queue = { version = "41.0.2", default-features = false }
pallet-transaction-payment-rpc = { version = "41.0.0" }
pallet-transaction-payment-rpc-runtime-api = { version = "38.0.0", default-features = false }
sc-basic-authorship = { version = "0.45.0" }
sc-chain-spec = { version = "38.0.0" }
sc-cli = { version = "0.47.0" }
sc-client-api = { version = "37.0.0" }
sc-consensus = { version = "0.44.0" }
sc-executor = { version = "0.40.1" }
sc-network = { version = "0.45.1" }
sc-network-sync = { version = "0.44.1" }
sc-offchain = { version = "40.0.0" }
sc-rpc = { version = "40.0.0" }
sc-service = { version = "0.46.0" }
sc-sysinfo = { version = "38.0.0" }
sc-telemetry = { version = "25.0.0" }
sc-tracing = { version = "37.0.1" }
sc-transaction-pool = { version = "37.0.0" }
sc-transaction-pool-api = { version = "37.0.0" }
sp-api = { version = "34.0.0", default-features = false }
sp-keyring = { version = "39.0.0", default-features = false }
sp-block-builder = { version = "34.0.0", default-features = false }
sp-blockchain = { version = "37.0.1" }
sp-consensus-aura = { version = "0.40.0", default-features = false }
sp-core = { version = "34.0.0", default-features = false }
sp-inherents = { version = "34.0.0", default-features = false }
sp-io = { version = "38.0.0", default-features = false }
sp-keystore = { version = "0.40.0" }
sp-offchain = { version = "34.0.0", default-features = false }
sp-runtime = { version = "39.0.1", default-features = false }
sp-session = { version = "36.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
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 = "21.0.0" }
sp-timestamp = { version = "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 = { version = "39.0.0" }
prometheus-endpoint = { version = "0.17.0", default-features = false, package = "substrate-prometheus-endpoint" }
substrate-wasm-builder = { version = "24.0.1" }
substrate-build-script-utils = { version = "11.0.0" }
try-runtime-cli = { version = "0.42.0" }

# extra deps for running a solo node on top of a parachain
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 }
pallet-grandpa = { version = "38.0.0", default-features = false }
sc-consensus-grandpa = { version = "0.30.0", default-features = false }
sp-consensus-grandpa = { version = "21.0.0", default-features = false }
sp-genesis-builder = { version = "0.15.1", 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 }
sc-consensus-aura = { version = "0.45.0", default-features = false }
sc-consensus-manual-seal = { version = "0.46.0", default-features = false }

# extra deps for setting up pallet-contracts
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 }
pallet-contracts = { version = "38.0.0", default-features = false }
pallet-insecure-randomness-collective-flip = { version = "26.0.0", default-features = false }
pallet-assets = { version = "40.0.0", default-features = false }
pallet-utility = { version = "38.0.0", default-features = false }

# Polkadot
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 }
pallet-xcm = { version = "17.0.1", default-features = false }
polkadot-cli = { version = "19.0.0", default-features = false }
polkadot-parachain-primitives = { version = "14.0.0", default-features = false }
polkadot-primitives = { version = "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.1", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "17.0.0", package = "staging-xcm-executor", default-features = false }

# Cumulus
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 }
cumulus-client-cli = { version = "0.18.0" }
cumulus-client-collator = { version = "0.18.0" }
cumulus-client-consensus-proposer = { version = "0.16.0" }
cumulus-client-consensus-aura = { version = "0.18.0" }
cumulus-client-consensus-common = { version = "0.18.0" }
cumulus-client-service = { version = "0.19.0" }
cumulus-pallet-aura-ext = { version = "0.17.0", default-features = false }
cumulus-pallet-dmp-queue = { 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 = { version = "0.16.0" }
cumulus-primitives-timestamp = { version = "0.16.0", default-features = false }
cumulus-primitives-utility = { version = "0.17.0", default-features = false }
cumulus-relay-chain-interface = { version = "0.18.0" }
pallet-collator-selection = { version = "19.0.0", default-features = false }
parachain-info = { version = "0.17.0", package = "staging-parachain-info", default-features = false }
parachains-common = { version = "18.0.0", default-features = false }

8 changes: 4 additions & 4 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.41.0" }
contracts-node-runtime = { path = "../runtime", version = "0.41.0" }
contracts-parachain-runtime = { path = "../parachain-runtime", features = ["parachain"], version = "0.42.0" }
contracts-node-runtime = { path = "../runtime", version = "0.42.0" }

# Substrate
frame-benchmarking = { workspace = true }
Expand Down Expand Up @@ -61,7 +61,7 @@ sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-timestamp = { workspace = true }
substrate-frame-rpc-system = { workspace = true }
substrate-prometheus-endpoint = { workspace = true }
prometheus-endpoint = { workspace = true }
try-runtime-cli = { workspace = true, optional = true }

# extra for running solo-chain
Expand All @@ -71,7 +71,7 @@ sc-consensus-aura = { workspace = true }
sc-consensus-manual-seal = { workspace = true }

# Polkadot
polkadot-cli = { workspace = true }
polkadot-cli = { features = ["rococo-native"], workspace = true }
polkadot-primitives = { workspace = true }
xcm = { workspace = true }

Expand Down
4 changes: 3 additions & 1 deletion node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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 All @@ -26,8 +26,10 @@ pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Pu
#[serde(deny_unknown_fields)]
pub struct Extensions {
/// The relay chain of the Parachain.
#[serde(alias = "relayChain", alias = "RelayChain")]
pub relay_chain: String,
/// The id of the Parachain.
#[serde(alias = "paraId", alias = "ParaId")]
pub para_id: u32,
}

Expand Down
56 changes: 26 additions & 30 deletions node/src/chain_spec/dev.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use contracts_node_runtime::{AccountId, RuntimeGenesisConfig, Signature, WASM_BINARY};
use contracts_node_runtime::{AccountId, Signature, WASM_BINARY};
use sc_service::ChainType;
use sp_core::{sr25519, Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};

/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
pub type ChainSpec = sc_service::GenericChainSpec<RuntimeGenesisConfig>;
pub type ChainSpec = sc_service::GenericChainSpec;

/// Generate a crypto pair from seed.
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
Expand All @@ -24,35 +24,31 @@ where
}

pub fn development_config() -> Result<ChainSpec, String> {
Ok(ChainSpec::builder(
WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?,
None,
)
.with_name("Development")
.with_id("dev")
.with_protocol_id("dev")
.with_chain_type(ChainType::Development)
.with_genesis_config_patch(testnet_genesis(
// Sudo account
get_account_id_from_seed::<sr25519::Public>("Alice"),
// Pre-funded accounts
vec![
Ok(ChainSpec::builder(WASM_BINARY.expect("Development wasm not available"), Default::default())
.with_name("Development")
.with_id("dev")
.with_chain_type(ChainType::Development)
.with_genesis_config_patch(testnet_genesis(
// Sudo account
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
get_account_id_from_seed::<sr25519::Public>("Charlie"),
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
get_account_id_from_seed::<sr25519::Public>("Dave"),
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
get_account_id_from_seed::<sr25519::Public>("Eve"),
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
true,
))
.build())
// Pre-funded accounts
vec![
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
get_account_id_from_seed::<sr25519::Public>("Charlie"),
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
get_account_id_from_seed::<sr25519::Public>("Dave"),
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
get_account_id_from_seed::<sr25519::Public>("Eve"),
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
true,
))
.build())
}

/// Configure initial storage state for FRAME modules.
Expand Down
5 changes: 0 additions & 5 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ pub enum Subcommand {
/// The pallet benchmarking moved to the `pallet` sub-command.
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// 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.
TryRuntime,
}

const AFTER_HELP_EXAMPLE: &str = color_print::cstr!(
Expand Down
Loading

0 comments on commit 6e7f232

Please sign in to comment.