Skip to content

Commit

Permalink
polkadot-sdk v1.11.0 uplift (#1314)
Browse files Browse the repository at this point in the history
* Update deps - init commit

* Local uplift WIP

* Shibuya progress

* mend

* Shibuya compiles

* Changes

* Basic compilation

* All features compile

* Tests passing

* Integration tests

* Fix evm-tracing init block code

* Rename to make it consistent with frontier

* Remove getters

* Fix tests

* Resolve issues

* Review comments

* Minor changes

* tracing integration test update

* xcm api integration tests wip

* Finish integration tests

* Weights

* Fixes

* Benchmark fixes

* fixes

* Revert some changes

* Missing migrations, dead code removal

* Fix for broken benchmarks

* Comments

* Fixes

* Minor fix for xcm-simulator

* weight updates

* remove NativeElseWasmExecutor

* fix benchmarking

---------

Co-authored-by: Ermal Kaleci <[email protected]>
  • Loading branch information
Dinonard and ermalkaleci authored Aug 9, 2024
1 parent 6f34256 commit 29b0731
Show file tree
Hide file tree
Showing 85 changed files with 4,102 additions and 4,475 deletions.
2,235 changes: 1,281 additions & 954 deletions Cargo.lock

Large diffs are not rendered by default.

308 changes: 154 additions & 154 deletions Cargo.toml

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions bin/collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ cumulus-test-relay-sproof-builder = { workspace = true }

# polkadot dependencies
polkadot-cli = { workspace = true, optional = true }
polkadot-core-primitives = { workspace = true }
polkadot-parachain = { workspace = true, features = ["std"] }
polkadot-primitives = { workspace = true, features = ["std"] }
polkadot-service = { workspace = true }
Expand All @@ -139,7 +140,6 @@ polkadot-runtime-common = { workspace = true, features = ["std"], optional = tru

# try-runtime
frame-try-runtime = { workspace = true, features = ["std"], optional = true }
try-runtime-cli = { workspace = true, optional = true }

# evm-tracing
moonbeam-rpc-primitives-debug = { workspace = true, features = ["std"], optional = true }
Expand Down Expand Up @@ -182,10 +182,8 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"cumulus-primitives-core/runtime-benchmarks",
]
cli = ["try-runtime-cli"]
try-runtime = [
"local-runtime/try-runtime",
"try-runtime-cli/try-runtime",
"astar-primitives/try-runtime",
"astar-runtime/try-runtime",
"frame-system/try-runtime",
Expand Down
78 changes: 31 additions & 47 deletions bin/collator/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
// You should have received a copy of the GNU General Public License
// along with Astar. If not, see <http://www.gnu.org/licenses/>.

use crate::parachain::service::ParachainExecutor;
use astar_primitives::{AccountId, Balance, Block};
use cumulus_primitives_core::PersistedValidationData;
use cumulus_primitives_parachain_inherent::{ParachainInherentData, INHERENT_IDENTIFIER};
use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;
use parity_scale_codec::Encode;
use polkadot_runtime_common::BlockHashCount;
use sc_executor::NativeElseWasmExecutor;
use sc_service::TFullClient;
use sp_api::ConstructRuntimeApi;
use sp_core::{Pair, H256};
Expand All @@ -33,41 +33,35 @@ use std::sync::Arc;
/// Generates `System::Remark` extrinsics for the benchmarks.
///
/// Note: Should only be used for benchmarking.
pub struct RemarkBuilder<RuntimeApi, Executor>
pub struct RemarkBuilder<RuntimeApi>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, ParachainExecutor>>
+ Send
+ Sync
+ 'static,
Executor: sc_executor::NativeExecutionDispatch + 'static,
{
client: Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
client: Arc<TFullClient<Block, RuntimeApi, ParachainExecutor>>,
}

impl<RuntimeApi, Executor> RemarkBuilder<RuntimeApi, Executor>
impl<RuntimeApi> RemarkBuilder<RuntimeApi>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, ParachainExecutor>>
+ Send
+ Sync
+ 'static,
Executor: sc_executor::NativeExecutionDispatch + 'static,
{
/// Creates a new [`Self`] from the given client.
pub fn new(
client: Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
) -> Self {
pub fn new(client: Arc<TFullClient<Block, RuntimeApi, ParachainExecutor>>) -> Self {
Self { client }
}
}

impl<RuntimeApi, Executor> frame_benchmarking_cli::ExtrinsicBuilder
for RemarkBuilder<RuntimeApi, Executor>
impl<RuntimeApi> frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder<RuntimeApi>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, ParachainExecutor>>
+ Send
+ Sync
+ 'static,
Executor: sc_executor::NativeExecutionDispatch + 'static,
{
fn pallet(&self) -> &str {
"system"
Expand Down Expand Up @@ -100,30 +94,28 @@ where
/// Generates `Balances::TransferKeepAlive` extrinsics for the benchmarks.
///
/// Note: Should only be used for benchmarking.
pub struct TransferKeepAliveBuilder<RuntimeApi, Executor>
pub struct TransferKeepAliveBuilder<RuntimeApi>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, ParachainExecutor>>
+ Send
+ Sync
+ 'static,
Executor: sc_executor::NativeExecutionDispatch + 'static,
{
client: Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
client: Arc<TFullClient<Block, RuntimeApi, ParachainExecutor>>,
dest: AccountId,
value: Balance,
}

impl<RuntimeApi, Executor> TransferKeepAliveBuilder<RuntimeApi, Executor>
impl<RuntimeApi> TransferKeepAliveBuilder<RuntimeApi>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, ParachainExecutor>>
+ Send
+ Sync
+ 'static,
Executor: sc_executor::NativeExecutionDispatch + 'static,
{
/// Creates a new [`Self`] from the given client.
pub fn new(
client: Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
client: Arc<TFullClient<Block, RuntimeApi, ParachainExecutor>>,
dest: AccountId,
value: Balance,
) -> Self {
Expand All @@ -135,14 +127,12 @@ where
}
}

impl<RuntimeApi, Executor> frame_benchmarking_cli::ExtrinsicBuilder
for TransferKeepAliveBuilder<RuntimeApi, Executor>
impl<RuntimeApi> frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder<RuntimeApi>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, ParachainExecutor>>
+ Send
+ Sync
+ 'static,
Executor: sc_executor::NativeExecutionDispatch + 'static,
{
fn pallet(&self) -> &str {
"balances"
Expand Down Expand Up @@ -192,14 +182,13 @@ trait BenchmarkCallSigner<RuntimeCall: Encode + Clone, Signer: Pair> {
) -> OpaqueExtrinsic;
}

impl<RuntimeApi, Executor> BenchmarkCallSigner<local_runtime::RuntimeCall, sp_core::sr25519::Pair>
for TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>
impl<RuntimeApi> BenchmarkCallSigner<local_runtime::RuntimeCall, sp_core::sr25519::Pair>
for TFullClient<Block, RuntimeApi, ParachainExecutor>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, ParachainExecutor>>
+ Send
+ Sync
+ 'static,
Executor: sc_executor::NativeExecutionDispatch + 'static,
{
fn sign_call(
&self,
Expand Down Expand Up @@ -251,14 +240,13 @@ where
}
}

impl<RuntimeApi, Executor> BenchmarkCallSigner<astar_runtime::RuntimeCall, sp_core::sr25519::Pair>
for TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>
impl<RuntimeApi> BenchmarkCallSigner<astar_runtime::RuntimeCall, sp_core::sr25519::Pair>
for TFullClient<Block, RuntimeApi, ParachainExecutor>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, ParachainExecutor>>
+ Send
+ Sync
+ 'static,
Executor: sc_executor::NativeExecutionDispatch + 'static,
{
fn sign_call(
&self,
Expand Down Expand Up @@ -310,14 +298,13 @@ where
}
}

impl<RuntimeApi, Executor> BenchmarkCallSigner<shiden_runtime::RuntimeCall, sp_core::sr25519::Pair>
for TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>
impl<RuntimeApi> BenchmarkCallSigner<shiden_runtime::RuntimeCall, sp_core::sr25519::Pair>
for TFullClient<Block, RuntimeApi, ParachainExecutor>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, ParachainExecutor>>
+ Send
+ Sync
+ 'static,
Executor: sc_executor::NativeExecutionDispatch + 'static,
{
fn sign_call(
&self,
Expand Down Expand Up @@ -369,14 +356,13 @@ where
}
}

impl<RuntimeApi, Executor> BenchmarkCallSigner<shibuya_runtime::RuntimeCall, sp_core::sr25519::Pair>
for TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>
impl<RuntimeApi> BenchmarkCallSigner<shibuya_runtime::RuntimeCall, sp_core::sr25519::Pair>
for TFullClient<Block, RuntimeApi, ParachainExecutor>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, ParachainExecutor>>
+ Send
+ Sync
+ 'static,
Executor: sc_executor::NativeExecutionDispatch + 'static,
{
fn sign_call(
&self,
Expand Down Expand Up @@ -434,14 +420,12 @@ pub trait ExistentialDepositProvider {
fn existential_deposit(&self) -> Balance;
}

impl<RuntimeApi, Executor> ExistentialDepositProvider
for TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>
impl<RuntimeApi> ExistentialDepositProvider for TFullClient<Block, RuntimeApi, ParachainExecutor>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, ParachainExecutor>>
+ Send
+ Sync
+ 'static,
Executor: sc_executor::NativeExecutionDispatch + 'static,
{
fn existential_deposit(&self) -> Balance {
with_runtime! {
Expand Down
4 changes: 0 additions & 4 deletions bin/collator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ pub enum Subcommand {
#[clap(name = "benchmark", about = "Benchmark runtime pallets.")]
#[clap(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// Try some command against runtime state.
/// No moved to separte cli and just a placeholder command here
TryRuntime,
}

#[derive(Debug)]
Expand Down
Loading

0 comments on commit 29b0731

Please sign in to comment.