Skip to content

Commit

Permalink
Feature/polkadot v0.9.36 (#852)
Browse files Browse the repository at this point in the history
* Uplift local runtime (with TODO)

* Add call index to contracts-migration

* Uplift Shiden runtime to Polkadot-v0.9.36

* Uplift Shibuya runtime to Polkadot-v0.9.36 (with TODO)

* Fixup for shiden

* Uplift Astar runtime to Polkadot-v0.9.36 (with TODO)

* Update collator dependencies

* Uplift collator service (WIP)

* Service uplifting WIP

* Fix backend definition for collator service

* Reformat the source

* TryRuntime fixes

* Reformat the source

* Update frontier and astar-frame deps after squash

* Add migration code for pallet_assets

* Register assets migration

* Reformat code

* Update frontier deps

* Uplift xcm-tools to Polkadot-0.9.36

* Fix try-runtime environment

* Set MaxDebugBufferLen as in Cumulus

* Reformat the source

* Adds migration for balances pallet

* Code cleanup

* Remove parity-util-mem dependency

* Fix BaseFilter::contains for Astar, set AssetIdParameter = Compact<AssetId>

* Reformat the source

* Format bin/collator/Cargo.toml

* Update frontier

* Bump versions

* Update package version of local runtime

* Address post-review comments

* Bump versions

* Update Cargo.lock
  • Loading branch information
0x7CFE authored Feb 16, 2023
1 parent 5f1852a commit 6f28dfb
Show file tree
Hide file tree
Showing 15 changed files with 1,238 additions and 1,158 deletions.
1,399 changes: 707 additions & 692 deletions Cargo.lock

Large diffs are not rendered by default.

154 changes: 77 additions & 77 deletions bin/collator/Cargo.toml

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions bin/collator/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,12 @@ pub fn run() -> Result<()> {
let runner = cli.create_runner(cmd)?;
let chain_spec = &runner.config().chain_spec;

use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
type HostFunctionsOf<E> = ExtendedHostFunctions<
sp_io::SubstrateHostFunctions,
<E as NativeExecutionDispatch>::ExtendHostFunctions,
>;

if chain_spec.is_shiden() {
runner.async_run(|config| {
let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
Expand All @@ -622,7 +628,7 @@ pub fn run() -> Result<()> {
sc_cli::Error::Service(sc_service::Error::Prometheus(e))
})?;
Ok((
cmd.run::<shiden_runtime::Block, shiden::Executor>(config),
cmd.run::<shiden_runtime::Block, HostFunctionsOf<shiden::Executor>>(),
task_manager,
))
})
Expand All @@ -635,7 +641,7 @@ pub fn run() -> Result<()> {
sc_cli::Error::Service(sc_service::Error::Prometheus(e))
})?;
Ok((
cmd.run::<shibuya_runtime::Block, shibuya::Executor>(config),
cmd.run::<shibuya_runtime::Block, HostFunctionsOf<shibuya::Executor>>(),
task_manager,
))
})
Expand All @@ -647,7 +653,10 @@ pub fn run() -> Result<()> {
.map_err(|e| {
sc_cli::Error::Service(sc_service::Error::Prometheus(e))
})?;
Ok((cmd.run::<Block, local::Executor>(config), task_manager))
Ok((
cmd.run::<Block, HostFunctionsOf<local::Executor>>(),
task_manager,
))
})
}
}
Expand Down
40 changes: 27 additions & 13 deletions bin/collator/src/parachain/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use fc_rpc_core::types::{FeeHistoryCache, FilterPool};
use futures::{lock::Mutex, StreamExt};
use polkadot_service::CollatorPair;
use sc_client_api::BlockchainEvents;
use sc_consensus::import_queue::BasicQueue;
use sc_consensus::{import_queue::BasicQueue, ImportQueue};
use sc_executor::NativeElseWasmExecutor;
use sc_network::{NetworkBlock, NetworkService};
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
Expand Down Expand Up @@ -140,11 +140,13 @@ pub fn new_partial<RuntimeApi, Executor, BIQ>(
>,
(
ParachainBlockImport<
Block,
FrontierBlockImport<
Block,
Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>,
>,
TFullBackend<Block>,
>,
Option<Telemetry>,
Option<TelemetryWorkerHandle>,
Expand Down Expand Up @@ -172,11 +174,13 @@ where
BIQ: FnOnce(
Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
ParachainBlockImport<
Block,
FrontierBlockImport<
Block,
Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>,
>,
TFullBackend<Block>,
>,
&Configuration,
Option<TelemetryHandle>,
Expand Down Expand Up @@ -236,8 +240,8 @@ where
let frontier_block_import =
FrontierBlockImport::new(client.clone(), client.clone(), frontier_backend.clone());

let parachain_block_import: ParachainBlockImport<_> =
ParachainBlockImport::<_>::new(frontier_block_import);
let parachain_block_import: ParachainBlockImport<_, _, _> =
ParachainBlockImport::new(frontier_block_import, backend.clone());

let import_queue = build_import_queue(
client.clone(),
Expand Down Expand Up @@ -276,17 +280,21 @@ async fn build_relay_chain_interface(
Arc<(dyn RelayChainInterface + 'static)>,
Option<CollatorPair>,
)> {
match collator_options.relay_chain_rpc_url {
Some(relay_chain_url) => {
build_minimal_relay_chain_node(polkadot_config, task_manager, relay_chain_url).await
}
None => build_inprocess_relay_chain(
if !collator_options.relay_chain_rpc_urls.is_empty() {
build_minimal_relay_chain_node(
polkadot_config,
task_manager,
collator_options.relay_chain_rpc_urls,
)
.await
} else {
build_inprocess_relay_chain(
polkadot_config,
parachain_config,
telemetry_worker_handle,
task_manager,
None,
),
)
}
}

Expand Down Expand Up @@ -329,11 +337,13 @@ where
BIQ: FnOnce(
Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
ParachainBlockImport<
Block,
FrontierBlockImport<
Block,
Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>,
>,
TFullBackend<Block>,
>,
&Configuration,
Option<TelemetryHandle>,
Expand All @@ -348,11 +358,13 @@ where
BIC: FnOnce(
Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
ParachainBlockImport<
Block,
FrontierBlockImport<
Block,
Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>,
>,
TFullBackend<Block>,
>,
Option<&Registry>,
Option<TelemetryHandle>,
Expand Down Expand Up @@ -397,14 +409,14 @@ where
let is_authority = parachain_config.role.is_authority();
let prometheus_registry = parachain_config.prometheus_registry().cloned();
let transaction_pool = params.transaction_pool.clone();
let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue);
let import_queue_service = params.import_queue.service();
let (network, system_rpc_tx, tx_handler_controller, start_network) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &parachain_config,
client: client.clone(),
transaction_pool: transaction_pool.clone(),
spawn_handle: task_manager.spawn_handle(),
import_queue: import_queue.clone(),
import_queue: params.import_queue,
block_announce_validator_builder: Some(Box::new(|_| {
Box::new(block_announce_validator)
})),
Expand Down Expand Up @@ -539,7 +551,7 @@ where
relay_chain_interface: relay_chain_interface.clone(),
spawner,
parachain_consensus,
import_queue,
import_queue: import_queue_service,
collator_key: collator_key.expect("Command line arguments do not allow this. qed"),
relay_chain_slot_duration,
};
Expand All @@ -553,7 +565,7 @@ where
para_id: id,
relay_chain_interface,
relay_chain_slot_duration,
import_queue,
import_queue: import_queue_service,
};

start_full_node(params)?;
Expand All @@ -568,11 +580,13 @@ where
pub fn build_import_queue<RuntimeApi, Executor>(
client: Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
block_import: ParachainBlockImport<
Block,
FrontierBlockImport<
Block,
Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>,
>,
TFullBackend<Block>,
>,
config: &Configuration,
telemetry_handle: Option<TelemetryHandle>,
Expand Down
18 changes: 9 additions & 9 deletions bin/xcm-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ path = "src/main.rs"

[dependencies]
clap = { version = "4.0.13", features = ["derive"] }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.33" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.33" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.33" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.33" }
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.33" }
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.33" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36" }

hex = "0.4.3"
regex = "1.6.0"

[build-dependencies]
build-script-utils = { package = "substrate-build-script-utils", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
build-script-utils = { package = "substrate-build-script-utils", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
Loading

0 comments on commit 6f28dfb

Please sign in to comment.