Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
5,729 changes: 3,021 additions & 2,708 deletions Cargo.lock

Large diffs are not rendered by default.

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

[workspace.dependencies]
clap = { version = "4.5.26", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [
codec = { package = "parity-scale-codec", version = "3.7.5", default-features = false, features = [
"derive",
] }
color-print = "0.3.7"
docify = "0.2.9"
docify = "0.4.1"
futures = "0.3.31"
hex-literal = "0.4.1"
jsonrpsee = { version = "0.24.7", features = ["server"] }
hex-literal = "1.0.0"
jsonrpsee = { version = "0.24.9", features = ["server"] }
log = { version = "0.4.25", default-features = false }
scale-info = { version = "2.11.6", default-features = false, features = [
"derive",
Expand All @@ -32,96 +32,96 @@ smallvec = "1.13.2"

# Build
substrate-build-script-utils = "11.0.0"
substrate-wasm-builder = "25.0.0"
substrate-wasm-builder = "26.0.0"

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

# Substrate
frame-benchmarking = { version = "39.0.0", default-features = false }
frame-benchmarking-cli = "45.0.0"
frame-executive = { version = "39.0.0", default-features = false }
frame-support = { version = "39.0.0", default-features = false }
frame-support-procedural = { version = "31.0.0", default-features = false }
frame-system = { version = "39.0.0", default-features = false }
frame-system-benchmarking = { version = "39.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "35.0.0", default-features = false }
frame-try-runtime = { version = "0.45.0", default-features = false }
frame-metadata-hash-extension = { version = "0.7.0", default-features = false }
pallet-aura = { version = "38.0.0", default-features = false }
pallet-authorship = { version = "39.0.0", default-features = false }
pallet-balances = { version = "40.0.0", default-features = false }
pallet-message-queue = { version = "42.0.0", default-features = false }
pallet-session = { version = "39.0.0", default-features = false }
pallet-sudo = { version = "39.0.0", default-features = false }
pallet-timestamp = { version = "38.0.0", default-features = false }
pallet-transaction-payment = { version = "39.0.0", default-features = false }
pallet-transaction-payment-rpc = "42.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "39.0.0", default-features = false }
prometheus-endpoint = { version = "0.17.1", default-features = false, package = "substrate-prometheus-endpoint" }
sc-basic-authorship = "0.47.0"
sc-chain-spec = "40.0.0"
sc-cli = "0.49.0"
sc-client-api = "38.0.0"
sc-offchain = "42.0.0"
sc-consensus = "0.46.0"
sc-executor = "0.41.0"
sc-network = "0.47.0"
sc-network-sync = "0.46.0"
sc-rpc = "42.0.0"
sc-service = "0.48.0"
sc-sysinfo = "40.0.0"
sc-telemetry = "27.0.0"
sc-tracing = "38.0.0"
sc-transaction-pool = "38.0.0"
sc-transaction-pool-api = "38.0.0"
sp-api = { version = "35.0.0", default-features = false }
sp-block-builder = { version = "35.0.0", default-features = false }
sp-blockchain = "38.0.0"
sp-consensus-aura = { version = "0.41.0", default-features = false }
sp-core = { version = "35.0.0", default-features = false }
sp-io = { version = "39.0.0", default-features = false }
sp-genesis-builder = { version = "0.16.0", default-features = false }
sp-inherents = { version = "35.0.0", default-features = false }
sp-keyring = { version = "40.0.0", default-features = false }
sp-keystore = "0.41.0"
sp-offchain = { version = "35.0.0", default-features = false }
sp-runtime = { version = "40.0.0", default-features = false }
sp-session = { version = "37.0.0", default-features = false }
frame-benchmarking = { version = "40.0.0", default-features = false }
frame-benchmarking-cli = "47.0.0"
frame-executive = { version = "40.0.0", default-features = false }
frame-support = { version = "40.1.0", default-features = false }
frame-support-procedural = { version = "33.0.0", default-features = false }
frame-system = { version = "40.1.0", default-features = false }
frame-system-benchmarking = { version = "40.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "36.0.0", default-features = false }
frame-try-runtime = { version = "0.46.0", default-features = false }
frame-metadata-hash-extension = { version = "0.8.0", default-features = false }
pallet-aura = { version = "39.0.0", default-features = false }
pallet-authorship = { version = "40.0.0", default-features = false }
pallet-balances = { version = "41.1.0", default-features = false }
pallet-message-queue = { version = "43.1.0", default-features = false }
pallet-session = { version = "40.0.0", default-features = false }
pallet-sudo = { version = "40.0.0", default-features = false }
pallet-timestamp = { version = "39.0.0", default-features = false }
pallet-transaction-payment = { version = "40.0.0", default-features = false }
pallet-transaction-payment-rpc = "43.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "40.0.0", default-features = false }
prometheus-endpoint = { version = "0.17.2", default-features = false, package = "substrate-prometheus-endpoint" }
sc-basic-authorship = "0.49.0"
sc-chain-spec = "42.0.0"
sc-cli = "0.51.0"
sc-client-api = "39.0.0"
sc-offchain = "44.0.0"
sc-consensus = "0.48.0"
sc-executor = "0.42.0"
sc-network = "0.49.0"
sc-network-sync = "0.48.0"
sc-rpc = "44.0.0"
sc-service = "0.50.0"
sc-sysinfo = "42.0.0"
sc-telemetry = "28.1.0"
sc-tracing = "39.0.0"
sc-transaction-pool = "39.0.0"
sc-transaction-pool-api = "39.0.0"
sp-api = { version = "36.0.1", default-features = false }
sp-block-builder = { version = "36.0.0", default-features = false }
sp-blockchain = "39.0.0"
sp-consensus-aura = { version = "0.42.0", default-features = false }
sp-core = { version = "36.1.0", default-features = false }
sp-io = { version = "40.0.0", default-features = false }
sp-genesis-builder = { version = "0.17.0", default-features = false }
sp-inherents = { version = "36.0.0", default-features = false }
sp-keyring = { version = "41.0.0", default-features = false }
sp-keystore = "0.42.0"
sp-offchain = { version = "36.0.0", default-features = false }
sp-runtime = { version = "41.1.0", default-features = false }
sp-session = { version = "38.1.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-timestamp = "35.0.0"
sp-transaction-pool = { version = "35.0.0", default-features = false }
sp-version = { version = "38.0.0", default-features = false }
substrate-frame-rpc-system = "41.0.0"
sp-timestamp = "36.0.0"
sp-transaction-pool = { version = "36.0.0", default-features = false }
sp-version = { version = "39.0.0", default-features = false }
substrate-frame-rpc-system = "43.0.0"

# Polkadot
pallet-xcm = { version = "18.0.0", default-features = false }
polkadot-cli = "21.0.0"
polkadot-parachain-primitives = { version = "15.0.0", default-features = false }
polkadot-primitives = "17.0.0"
polkadot-runtime-common = { version = "18.0.0", default-features = false }
xcm = { version = "15.0.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "18.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "18.0.0", package = "staging-xcm-executor", default-features = false }
pallet-xcm = { version = "19.1.0", default-features = false }
polkadot-cli = "23.0.0"
polkadot-parachain-primitives = { version = "16.1.0", default-features = false }
polkadot-primitives = "18.1.0"
polkadot-runtime-common = { version = "19.1.0", default-features = false }
xcm = { version = "16.1.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "20.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "19.1.0", package = "staging-xcm-executor", default-features = false }

# Cumulus
cumulus-client-cli = "0.20.0"
cumulus-client-collator = "0.20.0"
cumulus-client-consensus-aura = "0.20.0"
cumulus-client-consensus-common = "0.20.0"
cumulus-client-consensus-proposer = "0.17.0"
cumulus-client-service = "0.21.0"
cumulus-pallet-aura-ext = { version = "0.18.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.18.0", default-features = false }
cumulus-pallet-session-benchmarking = { version = "20.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.18.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.18.0", default-features = false }
cumulus-primitives-aura = { version = "0.16.0", default-features = false }
cumulus-primitives-core = { version = "0.17.0", default-features = false }
cumulus-primitives-parachain-inherent = "0.17.0"
cumulus-primitives-storage-weight-reclaim = { version = "9.0.0", default-features = false }
cumulus-primitives-utility = { version = "0.18.0", default-features = false }
cumulus-relay-chain-interface = "0.20.0"
pallet-collator-selection = { version = "20.0.0", default-features = false }
parachains-common = { version = "19.0.0", default-features = false }
parachain-info = { version = "0.18.0", package = "staging-parachain-info", default-features = false }
cumulus-client-cli = "0.22.0"
cumulus-client-collator = "0.22.0"
cumulus-client-consensus-aura = "0.22.0"
cumulus-client-consensus-common = "0.22.0"
cumulus-client-consensus-proposer = "0.19.0"
cumulus-client-service = "0.23.0"
cumulus-pallet-aura-ext = { version = "0.20.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.20.0", default-features = false }
cumulus-pallet-session-benchmarking = { version = "21.0.0", default-features = false }
cumulus-pallet-weight-reclaim = { version = "0.2.0", default-features = false }
cumulus-pallet-xcm = { version = "0.19.1", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.20.0", default-features = false }
cumulus-primitives-aura = { version = "0.17.0", default-features = false }
cumulus-primitives-core = { version = "0.18.1", default-features = false }
cumulus-primitives-parachain-inherent = "0.18.1"
cumulus-primitives-utility = { version = "0.20.0", default-features = false }
cumulus-relay-chain-interface = "0.22.0"
pallet-collator-selection = { version = "21.0.0", default-features = false }
parachains-common = { version = "21.0.0", default-features = false }
parachain-info = { version = "0.20.0", package = "staging-parachain-info", default-features = false }
5 changes: 2 additions & 3 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ fn start_consensus(
collator_service,
authoring_duration: Duration::from_millis(2000),
reinitialize: false,
max_pov_percentage: None,
};

let fut = aura::run::<Block, sp_consensus_aura::sr25519::AuthorityPair, _, _, _, _, _, _, _, _>(
Expand Down Expand Up @@ -279,7 +280,7 @@ pub async fn start_parachain_node(

// NOTE: because we use Aura here explicitly, we can use `CollatorSybilResistance::Resistant`
// when starting the network.
let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
let (network, system_rpc_tx, tx_handler_controller, sync_service) =
build_network(BuildNetworkParams {
parachain_config: &parachain_config,
net_config,
Expand Down Expand Up @@ -419,7 +420,5 @@ pub async fn start_parachain_node(
)?;
}

start_network.start_network();

Ok((task_manager, client))
}
5 changes: 3 additions & 2 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ xcm-executor.workspace = true
cumulus-pallet-aura-ext.workspace = true
cumulus-pallet-parachain-system.workspace = true
cumulus-pallet-session-benchmarking.workspace = true
cumulus-pallet-weight-reclaim.workspace = true
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 @@ -86,11 +86,11 @@ std = [
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-session-benchmarking/std",
"cumulus-pallet-weight-reclaim/std",
"cumulus-pallet-xcm/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 Expand Up @@ -139,6 +139,7 @@ std = [
runtime-benchmarks = [
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
"cumulus-pallet-weight-reclaim/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
"cumulus-primitives-core/runtime-benchmarks",
"cumulus-primitives-utility/runtime-benchmarks",
Expand Down
13 changes: 11 additions & 2 deletions runtime/src/apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@
}
}

impl frame_support::view_functions::runtime_api::RuntimeViewFunction<Block> for Runtime {
fn execute_view_function(
id: frame_support::view_functions::ViewFunctionId,
input: Vec<u8>
) -> Result<Vec<u8>, frame_support::view_functions::ViewFunctionDispatchError> {
Runtime::execute_view_function(id, input)
}
}

impl sp_block_builder::BlockBuilder<Block> for Runtime {
fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
Executive::apply_extrinsic(extrinsic)
Expand Down Expand Up @@ -227,7 +236,7 @@
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
use frame_benchmarking::BenchmarkList;
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand All @@ -243,7 +252,7 @@
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, alloc::string::String> {
use frame_benchmarking::{BenchmarkError, Benchmarking, BenchmarkBatch};
use frame_benchmarking::{BenchmarkError, BenchmarkBatch};
use super::*;

use frame_system_benchmarking::Pallet as SystemBench;
Expand All @@ -259,7 +268,7 @@
}

use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
impl cumulus_pallet_session_benchmarking::Config for Runtime {}

Check warning on line 271 in runtime/src/apis.rs

View workflow job for this annotation

GitHub Actions / clippy

non-local `impl` definition, `impl` blocks should be written at the same level as their item

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item --> runtime/src/apis.rs:271:13 | 252 | / fn dispatch_benchmark( 253 | | config: frame_benchmarking::BenchmarkConfig 254 | | ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, alloc::string::String> { | |___________________________________________________________________________________- move the `impl` block outside of this associated function `dispatch_benchmark` ... 271 | impl cumulus_pallet_session_benchmarking::Config for Runtime {} | ^^^^^-------------------------------------------^^^^^------- | | | | | `Runtime` is not local | `Config` is not local | = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`

use frame_support::traits::WhitelistedStorageKeys;
let whitelist = AllPalletsWithSystem::whitelisted_storage_keys();
Expand Down
1 change: 1 addition & 0 deletions runtime/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ frame_benchmarking::define_benchmarks!(
[pallet_session, SessionBench::<Runtime>]
[cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_message_queue, MessageQueue]
[cumulus_pallet_weight_reclaim, WeightReclaim]
);
5 changes: 5 additions & 0 deletions runtime/src/configs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ impl frame_system::Config for Runtime {
type MaxConsumers = frame_support::traits::ConstU32<16>;
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
type WeightInfo = ();
}

impl pallet_timestamp::Config for Runtime {
/// A timestamp: milliseconds since the unix epoch.
type Moment = u64;
Expand Down Expand Up @@ -258,6 +262,7 @@ parameter_types! {
}

impl pallet_session::Config for Runtime {
type DisablingStrategy = ();
type RuntimeEvent = RuntimeEvent;
type ValidatorId = <Self as frame_system::Config>::AccountId;
// we don't have stash and controller, thus we don't need the convert as well.
Expand Down
31 changes: 26 additions & 5 deletions runtime/src/configs/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@
// For more information, please refer to <http://unlicense.org>

use crate::{
AccountId, AllPalletsWithSystem, Balances, ParachainInfo, ParachainSystem, PolkadotXcm,
Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue,
AccountId, AllPalletsWithSystem, Balance, Balances, ParachainInfo, ParachainSystem,
PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin, WeightToFee,
XcmpQueue, MILLIUNIT, UNIT,
};
use frame_support::{
parameter_types,
traits::{ConstU32, Contains, Everything, Nothing},
traits::{
fungible::HoldConsideration, ConstU32, Contains, Everything, LinearStoragePrice, Nothing,
},
weights::Weight,
};
use frame_system::EnsureRoot;
use pallet_xcm::XcmPassthrough;
use pallet_xcm::{AuthorizedAliasers, XcmPassthrough};
use parachains_common::TREASURY_PALLET_ID;
use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::impls::ToAuthor;
Expand Down Expand Up @@ -176,11 +179,13 @@ impl xcm_executor::Config for XcmConfig {
type UniversalAliases = Nothing;
type CallDispatcher = RuntimeCall;
type SafeCallFilter = Everything;
type Aliasers = Nothing;
// Allow origins explicitly authorized by the alias target location.
type Aliasers = AuthorizedAliasers<Runtime>;
type TransactionalProcessor = FrameTransactionalProcessor;
type HrmpNewChannelOpenRequestHandler = ();
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
type XcmEventEmitter = PolkadotXcm;
type XcmRecorder = PolkadotXcm;
}

Expand All @@ -196,6 +201,16 @@ pub type XcmRouter = WithUniqueTopic<(
XcmpQueue,
)>;

/// Deposits.
pub const fn deposit(items: u32, bytes: u32) -> Balance {
(items as Balance * UNIT + (bytes as Balance) * (5 * MILLIUNIT / 100)) / 10
}
parameter_types! {
pub const AuthorizeAliasHoldReason: RuntimeHoldReason = RuntimeHoldReason::PolkadotXcm(pallet_xcm::HoldReason::AuthorizeAlias);
pub const DepositPerItem: Balance = deposit(1, 0);
pub const DepositPerByte: Balance = deposit(0, 1);
}

impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
Expand All @@ -215,6 +230,12 @@ impl pallet_xcm::Config for Runtime {
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
// ^ Override for AdvertisedXcmVersion default
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
type AuthorizedAliasConsideration = HoldConsideration<
AccountId,
Balances,
AuthorizeAliasHoldReason,
LinearStoragePrice<DepositPerItem, DepositPerByte, Balance>,
>;
type Currency = Balances;
type CurrencyMatcher = ();
type TrustedLockers = ();
Expand Down
1 change: 1 addition & 0 deletions runtime/src/genesis_config_presets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fn testnet_genesis(
.cloned()
.map(|k| (k, 1u128 << 60))
.collect::<Vec<_>>(),
..Default::default()
},
parachain_info: ParachainInfoConfig {
parachain_id: id,
Expand Down
Loading
Loading