Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
Upgrade to polkadot-1.3.0 (#98)
Browse files Browse the repository at this point in the history
* feat: upgrate to polkadot-1.3.0

* remove: try-runtime from node (#99)

---------

Co-authored-by: Abhishek Shah <[email protected]>
  • Loading branch information
José Molina Colmenero and weezy20 authored Nov 17, 2023
1 parent f378691 commit 2ef1fa8
Show file tree
Hide file tree
Showing 9 changed files with 1,242 additions and 1,161 deletions.
2,086 changes: 1,081 additions & 1,005 deletions Cargo.lock

Large diffs are not rendered by default.

190 changes: 95 additions & 95 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,104 +36,104 @@ pallet-motion = { path = "pallets/motion", default-features = false }
runtime-common = { path = "runtime/common", default-features = false }

# Substrate
frame-benchmarking = { version = "23.0.0", default-features = false }
frame-benchmarking-cli = { version = "27.0.0" }
frame-executive = { version = "23.0.0", default-features = false }
frame-support = { version = "23.0.0", default-features = false }
frame-system = { version = "23.0.0", default-features = false }
frame-system-benchmarking = { version = "23.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "21.0.0", default-features = false }
frame-try-runtime = { version = "0.29.0", default-features = false }
pallet-aura = { version = "22.0.0", default-features = false }
pallet-authorship = { version = "23.0.0", default-features = false }
pallet-assets = { version = "24.0.0", default-features = false }
pallet-balances = { version = "23.0.0", default-features = false }
pallet-collective = { version = "23.0.0", default-features = false }
pallet-membership = { version = "23.0.0", default-features = false }
pallet-multisig = { version = "23.0.0", default-features = false }
pallet-preimage = { version = "23.0.0", default-features = false }
pallet-session = { version = "23.0.0", default-features = false }
pallet-scheduler = { version = "24.0.0", default-features = false }
pallet-sudo = { version = "23.0.0", default-features = false }
pallet-timestamp = { version = "22.0.0", default-features = false }
pallet-transaction-payment = { version = "23.0.0", default-features = false }
pallet-transaction-payment-rpc = { version = "25.0.0" }
pallet-transaction-payment-rpc-runtime-api = { version = "23.0.0", default-features = false }
pallet-utility = { version = "23.0.0", default-features = false }
pallet-safe-mode = { version = "4.0.0", default-features = false }
pallet-tx-pause = { version = "4.0.0", default-features = false }
sc-basic-authorship = { version = "0.29.0" }
sc-chain-spec = { version = "22.0.0" }
sc-cli = { version = "0.31.0" }
sc-client-api = { version = "23.0.0" }
sc-consensus = { version = "0.28.0" }
sc-executor = { version = "0.27.0" }
sc-network = { version = "0.29.0" }
sc-network-sync = { version = "0.28.0" }
sc-rpc = { version = "24.0.0" }
sc-service = { version = "0.30.0" }
sc-sysinfo = { version = "22.0.0" }
sc-telemetry = { version = "10.0.0" }
sc-tracing = { version = "23.0.0" }
sc-transaction-pool = { version = "23.0.0" }
sc-transaction-pool-api = { version = "23.0.0" }
sc-offchain = { version = "24.0.0" }
sp-api = { version = "21.0.0", default-features = false }
sp-block-builder = { version = "21.0.0", default-features = false }
sp-blockchain = { version = "23.0.0" }
sp-consensus-aura = { version = "0.27.0", default-features = false }
sp-core = { version = "23.0.0", default-features = false }
sp-inherents = { version = "21.0.0", default-features = false }
sp-io = { version = "25.0.0", default-features = false }
sp-keystore = { version = "0.29.0" }
sp-offchain = { version = "21.0.0", default-features = false }
sp-runtime = { version = "26.0.0", default-features = false }
sp-session = { version = "22.0.0", default-features = false }
sp-std = { version = "10.0.0", default-features = false }
sp-timestamp = { version = "21.0.0" }
sp-transaction-pool = { version = "21.0.0", default-features = false }
sp-version = { version = "24.0.0", default-features = false }
substrate-build-script-utils = { version = "7.0.0" }
substrate-frame-rpc-system = { version = "23.0.0" }
substrate-prometheus-endpoint = { version = "0.14.0" }
substrate-wasm-builder = { version = "12.0.0" }
try-runtime-cli = { version = "0.33.0" }
frame-benchmarking = { version = "25.0.0", default-features = false }
frame-benchmarking-cli = { version = "29.0.0" }
frame-executive = { version = "25.0.0", default-features = false }
frame-support = { version = "25.0.0", default-features = false }
frame-system = { version = "25.0.0", default-features = false }
frame-system-benchmarking = { version = "25.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "23.0.0", default-features = false }
frame-try-runtime = { version = "0.31.0", default-features = false }
pallet-aura = { version = "24.0.0", default-features = false }
pallet-authorship = { version = "25.0.0", default-features = false }
pallet-assets = { version = "26.0.0", default-features = false }
pallet-balances = { version = "25.0.0", default-features = false }
pallet-collective = { version = "25.0.0", default-features = false }
pallet-membership = { version = "25.0.0", default-features = false }
pallet-multisig = { version = "25.0.0", default-features = false }
pallet-preimage = { version = "25.0.0", default-features = false }
pallet-session = { version = "25.0.0", default-features = false }
pallet-scheduler = { version = "26.0.0", default-features = false }
pallet-sudo = { version = "25.0.0", default-features = false }
pallet-timestamp = { version = "24.0.0", default-features = false }
pallet-transaction-payment = { version = "25.0.0", default-features = false }
pallet-transaction-payment-rpc = { version = "27.0.0" }
pallet-transaction-payment-rpc-runtime-api = { version = "25.0.0", default-features = false }
pallet-utility = { version = "25.0.0", default-features = false }
pallet-safe-mode = { version = "6.0.0", default-features = false }
pallet-tx-pause = { version = "6.0.0", default-features = false }
sc-basic-authorship = { version = "0.31.0" }
sc-chain-spec = { version = "24.0.0" }
sc-cli = { version = "0.33.0" }
sc-client-api = { version = "25.0.0" }
sc-consensus = { version = "0.30.0" }
sc-executor = { version = "0.29.0" }
sc-network = { version = "0.31.0" }
sc-network-sync = { version = "0.30.0" }
sc-rpc = { version = "26.0.0" }
sc-service = { version = "0.32.0" }
sc-sysinfo = { version = "24.0.0" }
sc-telemetry = { version = "12.0.0" }
sc-tracing = { version = "25.0.0" }
sc-transaction-pool = { version = "25.0.0" }
sc-transaction-pool-api = { version = "25.0.0" }
sc-offchain = { version = "26.0.0" }
sp-api = { version = "23.0.0", default-features = false }
sp-block-builder = { version = "23.0.0", default-features = false }
sp-blockchain = { version = "25.0.0" }
sp-consensus-aura = { version = "0.29.0", default-features = false }
sp-core = { version = "25.0.0", default-features = false }
sp-inherents = { version = "23.0.0", default-features = false }
sp-io = { version = "27.0.0", default-features = false }
sp-keystore = { version = "0.31.0" }
sp-offchain = { version = "23.0.0", default-features = false }
sp-runtime = { version = "28.0.0", default-features = false }
sp-session = { version = "24.0.0", default-features = false }
sp-std = { version = "12.0.0", default-features = false }
sp-timestamp = { version = "23.0.0" }
sp-transaction-pool = { version = "23.0.0", default-features = false }
sp-version = { version = "26.0.0", default-features = false }
substrate-build-script-utils = { version = "9.0.0" }
substrate-frame-rpc-system = { version = "25.0.0" }
substrate-prometheus-endpoint = { version = "0.16.0" }
substrate-wasm-builder = { version = "14.0.0" }
try-runtime-cli = { version = "0.35.0" }

# Cumulus
assets-common = { version = "0.2.0", default-features = false }
cumulus-client-cli = { version = "0.2.0" }
cumulus-client-consensus-aura = { version = "0.2.0" }
cumulus-client-consensus-common = { version = "0.2.0" }
cumulus-client-collator = { version = "0.2.0" }
cumulus-client-service = { version = "0.2.0" }
cumulus-client-consensus-proposer = { version = "0.2.0" }
cumulus-pallet-aura-ext = { version = "0.2.0", default-features = false }
cumulus-pallet-dmp-queue = { version = "0.2.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.2.0", default-features = false }
cumulus-pallet-session-benchmarking = { version = "4.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.2.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.2.0", default-features = false }
cumulus-primitives-core = { version = "0.2.0", default-features = false }
cumulus-primitives-parachain-inherent = { version = "0.2.0" }
cumulus-primitives-timestamp = { version = "0.2.0", default-features = false }
cumulus-primitives-utility = { version = "0.2.0", default-features = false }
cumulus-relay-chain-inprocess-interface = { version = "0.2.0" }
cumulus-relay-chain-interface = { version = "0.2.0" }
cumulus-relay-chain-minimal-node = { version = "0.2.0" }
cumulus-relay-chain-rpc-interface = { version = "0.2.0" }
pallet-collator-selection = { version = "4.0.0", default-features = false }
parachain-info = { package = "staging-parachain-info", version = "0.2.0", default-features = false }
parachains-common = { version = "2.0.0", default-features = false }
assets-common = { version = "0.4.0", default-features = false }
cumulus-client-cli = { version = "0.4.0" }
cumulus-client-consensus-aura = { version = "0.4.0" }
cumulus-client-consensus-common = { version = "0.4.0" }
cumulus-client-collator = { version = "0.4.0" }
cumulus-client-service = { version = "0.4.0" }
cumulus-client-consensus-proposer = { version = "0.4.0" }
cumulus-pallet-aura-ext = { version = "0.4.0", default-features = false }
cumulus-pallet-dmp-queue = { version = "0.4.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.4.0", default-features = false }
cumulus-pallet-session-benchmarking = { version = "6.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.4.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.4.0", default-features = false }
cumulus-primitives-core = { version = "0.4.0", default-features = false }
cumulus-primitives-parachain-inherent = { version = "0.4.0" }
cumulus-primitives-timestamp = { version = "0.4.0", default-features = false }
cumulus-primitives-utility = { version = "0.4.0", default-features = false }
cumulus-relay-chain-inprocess-interface = { version = "0.4.0" }
cumulus-relay-chain-interface = { version = "0.4.0" }
cumulus-relay-chain-minimal-node = { version = "0.4.0" }
cumulus-relay-chain-rpc-interface = { version = "0.4.0" }
pallet-collator-selection = { version = "6.0.0", default-features = false }
parachain-info = { package = "staging-parachain-info", version = "0.4.0", default-features = false }
parachains-common = { version = "4.0.0", default-features = false }

# Polkadot
pallet-xcm = { version = "2.0.0", default-features = false }
polkadot-cli = { version = "2.0.0", features = [
pallet-xcm = { version = "4.0.0", default-features = false }
polkadot-cli = { version = "4.0.0", features = [
"rococo-native",
] }
polkadot-parachain-primitives = { version = "1.0.0", default-features = false }
polkadot-primitives = { version = "2.0.0", default-features = false }
polkadot-runtime-common = { version = "2.0.0", default-features = false }
polkadot-service = { version = "2.0.0" }
xcm = { package = "staging-xcm", version = "2.0.0", default-features = false }
xcm-builder = { package = "staging-xcm-builder", version = "2.0.0", default-features = false }
xcm-executor = { package = "staging-xcm-executor", version = "2.0.0", default-features = false }
polkadot-parachain-primitives = { version = "3.0.0", default-features = false }
polkadot-primitives = { version = "4.0.0", default-features = false }
polkadot-runtime-common = { version = "4.0.0", default-features = false }
polkadot-service = { version = "4.0.0" }
xcm = { package = "staging-xcm", version = "4.0.0", default-features = false }
xcm-builder = { package = "staging-xcm-builder", version = "4.0.0", default-features = false }
xcm-executor = { package = "staging-xcm-executor", version = "4.0.0", default-features = false }
8 changes: 3 additions & 5 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ pub enum Subcommand {
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

#[cfg(feature = "try-runtime")]
/// Try some testing command against a specified runtime state.
TryRuntime(try_runtime_cli::TryRuntimeCmd),

#[cfg(not(feature = "try-runtime"))]
/// Placeholder when binary is not built with `--feature try-runtime`
/// 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,
}

Expand Down
45 changes: 1 addition & 44 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,50 +320,7 @@ pub fn run() -> Result<()> {
_ => Err("Benchmarking sub-command unsupported".into()),
}
},
#[cfg(feature = "try-runtime")]
Some(Subcommand::TryRuntime(cmd)) => {
use runtime_common::MILLISECS_PER_BLOCK;
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
use try_runtime_cli::block_building_info::timestamp_with_aura_info;

let runner = cli.create_runner(cmd)?;

type HostFunctionsOf<E> = ExtendedHostFunctions<
sp_io::SubstrateHostFunctions,
<E as NativeExecutionDispatch>::ExtendHostFunctions,
>;

// grab the task manager.
let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry);
let task_manager =
sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry)
.map_err(|e| format!("Error: {:?}", e))?;

let info_provider = timestamp_with_aura_info(MILLISECS_PER_BLOCK);

match runner.config().chain_spec.runtime() {
Runtime::Devnet | Runtime::Default => runner.async_run(|_config| {
Ok((
cmd.run::<Block, HostFunctionsOf<DevnetRuntimeExecutor>, _>(Some(
info_provider,
)),
task_manager,
))
}),
Runtime::Mainnet => runner.async_run(|_config| {
Ok((
cmd.run::<Block, HostFunctionsOf<MainnetRuntimeExecutor>, _>(Some(
info_provider,
)),
task_manager,
))
}),
}
},
#[cfg(not(feature = "try-runtime"))]
Some(Subcommand::TryRuntime) => Err("Try-runtime was not enabled when building the node. \
You can enable it with `--features try-runtime`."
.into()),
Some(Subcommand::TryRuntime) => Err("The `try-runtime` subcommand has been migrated to a standalone CLI (https://github.com/paritytech/try-runtime-cli). It is no longer being maintained here and will be removed entirely some time after January 2024. Please remove this subcommand from your runtime and use the standalone CLI.".into()),
None => {
let runner = cli.create_runner(&cli.run.normalize())?;
let collator_options = cli.run.collator_options();
Expand Down
3 changes: 1 addition & 2 deletions node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use runtime_common::{AccountId, Balance, Block, Nonce};
use sc_client_api::AuxStore;
pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor};
use sc_transaction_pool_api::TransactionPool;
use sp_api::{CallApiAt, ProvideRuntimeApi};
use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};

Expand Down Expand Up @@ -41,7 +41,6 @@ where
+ Send
+ Sync
+ 'static,
C: CallApiAt<Block>,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
C::Api: BlockBuilder<Block>,
Expand Down
1 change: 1 addition & 0 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ where
collator_service,
// Very limited proposal time.
authoring_duration: Duration::from_millis(500),
collation_request_receiver: None,
};

let fut =
Expand Down
3 changes: 2 additions & 1 deletion pallets/motion/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ impl pallet_balances::Config for Test {
type ExistentialDeposit = ConstU64<1>;
type AccountStore = System;
type ReserveIdentifier = [u8; 8];
type RuntimeHoldReason = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxLocks = ();
type MaxReserves = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
type RuntimeFreezeReason = RuntimeFreezeReason;
}

parameter_types! {
Expand Down
33 changes: 29 additions & 4 deletions runtime/devnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub mod xcm_config;
pub use fee::WeightToFee;

use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
use cumulus_primitives_core::{AssetId, Concrete};
use pallet_tx_pause::RuntimeCallNameOf;
use sp_api::impl_runtime_apis;
use sp_core::{crypto::KeyTypeId, ConstBool, OpaqueMetadata};
Expand All @@ -26,6 +27,8 @@ use sp_std::prelude::*;
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;

use frame_support::traits::fungible::HoldConsideration;
use frame_support::traits::LinearStoragePrice;
use frame_support::{
construct_runtime,
dispatch::DispatchClass,
Expand Down Expand Up @@ -355,8 +358,9 @@ impl pallet_balances::Config for Runtime {
type FreezeIdentifier = ();
type MaxLocks = ConstU32<50>;
type MaxReserves = ConstU32<50>;
type MaxHolds = ConstU32<0>;
type MaxHolds = ConstU32<2>;
type MaxFreezes = ConstU32<0>;
type RuntimeFreezeReason = RuntimeFreezeReason;
}

parameter_types! {
Expand Down Expand Up @@ -450,6 +454,22 @@ impl parachain_info::Config for Runtime {}

impl cumulus_pallet_aura_ext::Config for Runtime {}

parameter_types! {
/// The asset ID for the asset that we use to pay for message delivery fees.
pub FeeAssetId: AssetId = Concrete(xcm_config::RelayLocation::get());
/// The base fee for the message delivery fees.
pub const BaseDeliveryFee: Balance = 300_000_000;
/// The fee per byte
pub const ByteFee: Balance = 1_000_000;
}

pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
FeeAssetId,
BaseDeliveryFee,
ByteFee,
XcmpQueue,
>;

impl cumulus_pallet_xcmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type XcmExecutor = XcmExecutor<XcmConfig>;
Expand All @@ -458,7 +478,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type ExecuteOverweightOrigin = EnsureRoot<AccountId>;
type ControllerOrigin = EnsureRoot<AccountId>;
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
type PriceForSiblingDelivery = ();
type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
type WeightInfo = ();
}

Expand Down Expand Up @@ -564,15 +584,20 @@ impl pallet_multisig::Config for Runtime {
parameter_types! {
pub const PreimageBaseDeposit: Balance = deposit(2, 64);
pub const PreimageByteDeposit: Balance = deposit(0, 1);
pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage);
}

impl pallet_preimage::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = pallet_preimage::weights::SubstrateWeight<Runtime>;
type Currency = Balances;
type ManagerOrigin = EnsureRoot<AccountId>;
type BaseDeposit = PreimageBaseDeposit;
type ByteDeposit = PreimageByteDeposit;
type Consideration = HoldConsideration<
AccountId,
Balances,
PreimageHoldReason,
LinearStoragePrice<PreimageBaseDeposit, PreimageByteDeposit, Balance>,
>;
}

impl pallet_aura::Config for Runtime {
Expand Down
Loading

0 comments on commit 2ef1fa8

Please sign in to comment.