Skip to content

Commit

Permalink
Merge pull request #26 from r0gue-io/daan/chore-polkadot-v1.12.0
Browse files Browse the repository at this point in the history
chore: polkadot v1.12.0
  • Loading branch information
Daanvdplas authored Jun 21, 2024
2 parents 543834e + 23d0395 commit 85d9781
Show file tree
Hide file tree
Showing 10 changed files with 1,399 additions and 1,150 deletions.
2,328 changes: 1,297 additions & 1,031 deletions Cargo.lock

Large diffs are not rendered by default.

176 changes: 89 additions & 87 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,116 +9,118 @@ license = "Unlicense"
repository = "https://github.com/r0gue-io/base-parachain"

[workspace]
members = [
"node",
"runtime",
]
members = ["node", "runtime"]
resolver = "2"

[workspace.dependencies]
clap = { version = "4.5.3", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0", 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 }
scale-info = { version = "2.11.1", default-features = false, features = ["derive"] }
scale-info = { version = "2.11.1", default-features = false, features = [
"derive",
] }
serde = "1.0.197"
serde_json = "1.0.114"
smallvec = "1.11.2"

# Build
substrate-build-script-utils = "11.0.0"
substrate-wasm-builder = "22.0.1"
docify = "0.2.8"
substrate-wasm-builder = "22.0.0"

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

# Substrate
frame-benchmarking = { version = "33.0.0", default-features = false }
frame-benchmarking-cli = "37.0.0"
frame-executive = { version = "33.0.0", default-features = false }
frame-metadata-hash-extension = { version = "0.2.0", default-features = false }
frame-support = { version = "33.0.0", default-features = false }
frame-system = { version = "33.0.0", default-features = false }
frame-system-benchmarking = { version = "33.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "31.0.0", default-features = false }
frame-try-runtime = { version = "0.39.0", default-features = false }
pallet-aura = { version = "32.0.0", default-features = false }
pallet-authorship = { version = "33.0.0", default-features = false }
pallet-balances = { version = "34.0.0", default-features = false }
pallet-message-queue = { version = "36.0.0", default-features = false }
pallet-session = { version = "33.0.0", default-features = false }
pallet-sudo = { version = "33.0.0", default-features = false }
pallet-timestamp = { version = "32.0.0", default-features = false }
pallet-transaction-payment = { version = "33.0.0", default-features = false }
pallet-transaction-payment-rpc = "35.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "33.0.0", default-features = false }
sc-basic-authorship = "0.39.0"
sc-chain-spec = "32.0.0"
sc-cli = "0.41.0"
sc-client-api = "33.0.0"
sc-offchain = "34.0.0"
sc-consensus = "0.38.0"
sc-executor = "0.37.0"
sc-network = "0.39.0"
sc-network-sync = "0.38.0"
sc-rpc = "34.0.0"
sc-service = "0.40.0"
sc-sysinfo = "32.0.0"
sc-telemetry = "19.0.0"
sc-tracing = "33.0.0"
sc-transaction-pool = "33.0.0"
sc-transaction-pool-api = "33.0.0"
sp-api = { version = "31.0.0", default-features = false }
sp-block-builder = { version = "31.0.0", default-features = false }
sp-blockchain = "33.0.0"
sp-consensus-aura = { version = "0.37.0", default-features = false }
sp-core = { version = "32.0.0", default-features = false }
sp-io = { version = "35.0.0", default-features = false }
sp-genesis-builder = { version = "0.12.0", default-features = false }
sp-inherents = { version = "31.0.0", default-features = false }
sp-keystore = "0.38.0"
sp-offchain = { version = "31.0.0", default-features = false }
sp-runtime = { version = "36.0.0", default-features = false }
sp-session = { version = "32.0.0", default-features = false }
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-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-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 }
sp-std = { version = "14.0.0", default-features = false }
sp-timestamp = "31.0.0"
sp-transaction-pool = { version = "31.0.0", default-features = false }
sp-version = { version = "34.0.0", default-features = false }
substrate-frame-rpc-system = "33.0.0"
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"

# Polkadot
pallet-xcm = { version = "12.0.0", default-features = false }
polkadot-cli = "12.0.0"
polkadot-parachain-primitives = { version = "11.0.0", default-features = false }
polkadot-primitives = "12.0.0"
polkadot-runtime-common = { version = "12.0.0", default-features = false }
xcm = { version = "12.0.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "12.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "12.0.0", package = "staging-xcm-executor", default-features = false }
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 }

# Cumulus
cumulus-client-cli = "0.12.0"
cumulus-client-collator = "0.12.0"
cumulus-client-consensus-aura = "0.12.0"
cumulus-client-consensus-common = "0.12.0"
cumulus-client-consensus-proposer = "0.12.0"
cumulus-client-service = "0.12.0"
cumulus-pallet-aura-ext = { version = "0.12.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.12.0", default-features = false, features = ["parameterized-consensus-hook"] }
cumulus-pallet-session-benchmarking = { version = "14.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.12.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.12.0", default-features = false }
cumulus-primitives-aura = { version = "0.12.0", default-features = false }
cumulus-primitives-core = { version = "0.12.0", default-features = false }
cumulus-primitives-parachain-inherent = "0.12.0"
cumulus-primitives-storage-weight-reclaim = { version = "3.0.0", default-features = false }
cumulus-primitives-utility = { version = "0.12.0", default-features = false }
cumulus-relay-chain-interface = "0.12.0"
pallet-collator-selection = { version = "14.0.0", default-features = false }
parachains-common = { version = "12.0.0", default-features = false }
parachain-info = { version = "0.12.0", package = "staging-parachain-info", default-features = false }
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 }
1 change: 1 addition & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ substrate-build-script-utils.workspace = true
clap.workspace = true
codec.workspace = true
color-print.workspace = true
docify.workspace = true
futures.workspace = true
jsonrpsee.workspace = true
log.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Pu

/// The extensions for the [`ChainSpec`].
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)]
#[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
8 changes: 5 additions & 3 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_keystore::KeystorePtr;
use substrate_prometheus_endpoint::Registry;

#[docify::export(wasm_executor)]
type ParachainExecutor = WasmExecutor<ParachainHostFunctions>;

type ParachainClient = TFullClient<Block, RuntimeApi, ParachainExecutor>;
Expand All @@ -65,6 +66,7 @@ pub type Service = PartialComponents<
///
/// Use this macro if you don't actually need the full service, but just the builder in order to
/// be able to perform chain operations.
#[docify::export(component_instantiation)]
pub fn new_partial(config: &Configuration) -> Result<Service, sc_service::Error> {
let telemetry = config
.telemetry_endpoints
Expand Down Expand Up @@ -337,7 +339,7 @@ pub async fn start_parachain_node(
config: parachain_config,
keystore: params.keystore_container.keystore(),
backend: backend.clone(),
network: network.clone(),
network: network,

Check warning on line 342 in node/src/service.rs

View workflow job for this annotation

GitHub Actions / clippy

redundant field names in struct initialization

warning: redundant field names in struct initialization --> node/src/service.rs:342:9 | 342 | network: network, | ^^^^^^^^^^^^^^^^ help: replace it with: `network` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names = note: `#[warn(clippy::redundant_field_names)]` on by default
sync_service: sync_service.clone(),
system_rpc_tx,
tx_handler_controller,
Expand Down Expand Up @@ -405,9 +407,9 @@ pub async fn start_parachain_node(
prometheus_registry.as_ref(),
telemetry.as_ref().map(|t| t.handle()),
&task_manager,
relay_chain_interface.clone(),
relay_chain_interface,
transaction_pool,
sync_service.clone(),
sync_service,
params.keystore_container.keystore(),
relay_chain_slot_duration,
para_id,
Expand Down
16 changes: 1 addition & 15 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ hex-literal.workspace = true
log.workspace = true
scale-info.workspace = true
smallvec.workspace = true
docify.workspace = true

# Substrate
frame-benchmarking = { optional = true, workspace = true }
frame-executive.workspace = true
frame-metadata-hash-extension.workspace = true
frame-support.workspace = true
frame-system.workspace = true
frame-system-benchmarking = { optional = true, workspace = true }
Expand Down Expand Up @@ -91,7 +91,6 @@ std = [
"cumulus-primitives-utility/std",
"frame-benchmarking/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system-benchmarking/std",
"frame-system-rpc-runtime-api/std",
Expand Down Expand Up @@ -178,16 +177,3 @@ 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: 1 addition & 11 deletions runtime/build.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
#[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")))]
#[cfg(feature = "std")]
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() {}
2 changes: 1 addition & 1 deletion runtime/src/configs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl pallet_timestamp::Config for Runtime {
/// A timestamp: milliseconds since the unix epoch.
type Moment = u64;
type OnTimestampSet = Aura;
type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>;
type MinimumPeriod = ConstU64<0>;
type WeightInfo = (); // Configure based on benchmarking results.
}

Expand Down
1 change: 1 addition & 0 deletions runtime/src/configs/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ impl xcm_executor::Config for XcmConfig {
type HrmpNewChannelOpenRequestHandler = ();
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
type XcmRecorder = PolkadotXcm;
}

/// No local origins on this chain are allowed to dispatch XCM sends/executions.
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ pub type SignedBlock = generic::SignedBlock<Block>;
pub type BlockId = generic::BlockId<Block>;

/// The SignedExtension to the basic transaction logic.
#[docify::export(template_signed_extra)]
pub type SignedExtra = (
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>,
Expand All @@ -109,7 +110,6 @@ pub type SignedExtra = (
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down

0 comments on commit 85d9781

Please sign in to comment.