From 5e332dc09a3dbcb1794e34f2320e53a7b518b22e Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 30 May 2024 12:53:09 +0200 Subject: [PATCH 01/16] cleanup --- .../src/bridge_to_ethereum_config.rs | 181 +++++++++++++++++- .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 180 +---------------- 2 files changed, 181 insertions(+), 180 deletions(-) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs index 01a762d4b99f..2b0dfeb186b9 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs @@ -14,9 +14,20 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -use crate::{xcm_config::UniversalLocation, Runtime}; +use frame_support::parameter_types; +use crate::{xcm_config::UniversalLocation, Runtime, RuntimeEvent, Balances}; use snowbridge_router_primitives::outbound::EthereumBlobExporter; use testnet_parachains_constants::rococo::snowbridge::EthereumNetwork; +use snowbridge_beacon_primitives::{Fork, ForkVersions}; +use snowbridge_core::{ + gwei, meth, + outbound::{Command, Fee}, + AgentId, AllowSiblingsOnly, PricingParameters, Rewards, +}; +use snowbridge_router_primitives::inbound::MessageToXcm; +use testnet_parachains_constants::rococo::snowbridge::INBOUND_QUEUE_PALLET_INDEX; +#[cfg(feature = "runtime-benchmarks")] +use benchmark_helpers::DoNothingRouter; /// Exports message to the Ethereum Gateway contract. pub type SnowbridgeExporter = EthereumBlobExporter< @@ -25,3 +36,171 @@ pub type SnowbridgeExporter = EthereumBlobExporter< snowbridge_pallet_outbound_queue::Pallet, snowbridge_core::AgentIdOf, >; + +// Ethereum Bridge +parameter_types! { + pub storage EthereumGatewayAddress: H160 = H160(hex_literal::hex!("EDa338E4dC46038493b885327842fD3E301CaB39")); +} + +parameter_types! { + pub const CreateAssetCall: [u8;2] = [53, 0]; + pub const CreateAssetDeposit: u128 = (UNITS / 10) + EXISTENTIAL_DEPOSIT; + pub Parameters: PricingParameters = PricingParameters { + exchange_rate: FixedU128::from_rational(1, 400), + fee_per_gas: gwei(20), + rewards: Rewards { local: 1 * UNITS, remote: meth(1) }, + multiplier: FixedU128::from_rational(1, 1), + }; +} + +impl snowbridge_pallet_inbound_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Verifier = snowbridge_pallet_ethereum_client::Pallet; + type Token = Balances; + #[cfg(not(feature = "runtime-benchmarks"))] + type XcmSender = XcmRouter; + #[cfg(feature = "runtime-benchmarks")] + type XcmSender = DoNothingRouter; + type ChannelLookup = EthereumSystem; + type GatewayAddress = EthereumGatewayAddress; + #[cfg(feature = "runtime-benchmarks")] + type Helper = Runtime; + type MessageConverter = MessageToXcm< + CreateAssetCall, + CreateAssetDeposit, + ConstU8, + AccountId, + Balance, + >; + type WeightToFee = WeightToFee; + type LengthToFee = ConstantMultiplier; + type MaxMessageSize = ConstU32<2048>; + type WeightInfo = weights::snowbridge_pallet_inbound_queue::WeightInfo; + type PricingParameters = EthereumSystem; + type AssetTransactor = ::AssetTransactor; +} + +impl snowbridge_pallet_outbound_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Hashing = Keccak256; + type MessageQueue = MessageQueue; + type Decimals = ConstU8<12>; + type MaxMessagePayloadSize = ConstU32<2048>; + type MaxMessagesPerBlock = ConstU32<32>; + type GasMeter = snowbridge_core::outbound::ConstantGasMeter; + type Balance = Balance; + type WeightToFee = WeightToFee; + type WeightInfo = weights::snowbridge_pallet_outbound_queue::WeightInfo; + type PricingParameters = EthereumSystem; + type Channels = EthereumSystem; +} + +#[cfg(any(feature = "std", feature = "fast-runtime", feature = "runtime-benchmarks", test))] +parameter_types! { + pub const ChainForkVersions: ForkVersions = ForkVersions { + genesis: Fork { + version: [0, 0, 0, 0], // 0x00000000 + epoch: 0, + }, + altair: Fork { + version: [1, 0, 0, 0], // 0x01000000 + epoch: 0, + }, + bellatrix: Fork { + version: [2, 0, 0, 0], // 0x02000000 + epoch: 0, + }, + capella: Fork { + version: [3, 0, 0, 0], // 0x03000000 + epoch: 0, + }, + deneb: Fork { + version: [4, 0, 0, 0], // 0x04000000 + epoch: 0, + } + }; +} + +#[cfg(not(any(feature = "std", feature = "fast-runtime", feature = "runtime-benchmarks", test)))] +parameter_types! { + pub const ChainForkVersions: ForkVersions = ForkVersions { + genesis: Fork { + version: [144, 0, 0, 111], // 0x90000069 + epoch: 0, + }, + altair: Fork { + version: [144, 0, 0, 112], // 0x90000070 + epoch: 50, + }, + bellatrix: Fork { + version: [144, 0, 0, 113], // 0x90000071 + epoch: 100, + }, + capella: Fork { + version: [144, 0, 0, 114], // 0x90000072 + epoch: 56832, + }, + deneb: Fork { + version: [144, 0, 0, 115], // 0x90000073 + epoch: 132608, + }, + }; +} + +impl snowbridge_pallet_ethereum_client::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type ForkVersions = ChainForkVersions; + type WeightInfo = weights::snowbridge_pallet_ethereum_client::WeightInfo; +} + +impl snowbridge_pallet_system::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type OutboundQueue = EthereumOutboundQueue; + type SiblingOrigin = EnsureXcm; + type AgentIdOf = snowbridge_core::AgentIdOf; + type TreasuryAccount = TreasuryAccount; + type Token = Balances; + type WeightInfo = weights::snowbridge_pallet_system::WeightInfo; + #[cfg(feature = "runtime-benchmarks")] + type Helper = (); + type DefaultPricingParameters = Parameters; + type InboundDeliveryCost = EthereumInboundQueue; +} + +#[cfg(feature = "runtime-benchmarks")] +pub mod benchmark_helpers { + use crate::{EthereumBeaconClient, Runtime, RuntimeOrigin}; + use codec::Encode; + use snowbridge_beacon_primitives::BeaconHeader; + use snowbridge_pallet_inbound_queue::BenchmarkHelper; + use sp_core::H256; + use xcm::latest::{Assets, Location, SendError, SendResult, SendXcm, Xcm, XcmHash}; + + impl BenchmarkHelper for Runtime { + fn initialize_storage(beacon_header: BeaconHeader, block_roots_root: H256) { + EthereumBeaconClient::store_finalized_header(beacon_header, block_roots_root).unwrap(); + } + } + + pub struct DoNothingRouter; + impl SendXcm for DoNothingRouter { + type Ticket = Xcm<()>; + + fn validate( + _dest: &mut Option, + xcm: &mut Option>, + ) -> SendResult { + Ok((xcm.clone().unwrap(), Assets::new())) + } + fn deliver(xcm: Xcm<()>) -> Result { + let hash = xcm.using_encoded(sp_io::hashing::blake2_256); + Ok(hash) + } + } + + impl snowbridge_pallet_system::BenchmarkHelper for () { + fn make_xcm_origin(location: Location) -> RuntimeOrigin { + RuntimeOrigin::from(pallet_xcm::Origin::Xcm(location)) + } + } +} diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 0c72b000c2a0..95fdd0f6ae40 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -42,13 +42,6 @@ use bridge_runtime_common::extensions::{ refund_relayer_extension::RefundableParachain, }; use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; -use snowbridge_beacon_primitives::{Fork, ForkVersions}; -use snowbridge_core::{ - gwei, meth, - outbound::{Command, Fee}, - AgentId, AllowSiblingsOnly, PricingParameters, Rewards, -}; -use snowbridge_router_primitives::inbound::MessageToXcm; use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H160}; use sp_runtime::{ @@ -78,7 +71,7 @@ use frame_system::{ EnsureRoot, }; use testnet_parachains_constants::rococo::{ - consensus::*, currency::*, fee::WeightToFee, snowbridge::INBOUND_QUEUE_PALLET_INDEX, time::*, + consensus::*, currency::*, fee::WeightToFee, time::*, }; use bp_runtime::HeaderId; @@ -106,9 +99,6 @@ use parachains_common::{ AVERAGE_ON_INITIALIZE_RATIO, NORMAL_DISPATCH_RATIO, }; -#[cfg(feature = "runtime-benchmarks")] -use benchmark_helpers::DoNothingRouter; - /// The address format for describing accounts. pub type Address = MultiAddress; @@ -510,174 +500,6 @@ impl pallet_utility::Config for Runtime { type WeightInfo = weights::pallet_utility::WeightInfo; } -// Ethereum Bridge -parameter_types! { - pub storage EthereumGatewayAddress: H160 = H160(hex_literal::hex!("EDa338E4dC46038493b885327842fD3E301CaB39")); -} - -parameter_types! { - pub const CreateAssetCall: [u8;2] = [53, 0]; - pub const CreateAssetDeposit: u128 = (UNITS / 10) + EXISTENTIAL_DEPOSIT; - pub Parameters: PricingParameters = PricingParameters { - exchange_rate: FixedU128::from_rational(1, 400), - fee_per_gas: gwei(20), - rewards: Rewards { local: 1 * UNITS, remote: meth(1) }, - multiplier: FixedU128::from_rational(1, 1), - }; -} - -#[cfg(feature = "runtime-benchmarks")] -pub mod benchmark_helpers { - use crate::{EthereumBeaconClient, Runtime, RuntimeOrigin}; - use codec::Encode; - use snowbridge_beacon_primitives::BeaconHeader; - use snowbridge_pallet_inbound_queue::BenchmarkHelper; - use sp_core::H256; - use xcm::latest::{Assets, Location, SendError, SendResult, SendXcm, Xcm, XcmHash}; - - impl BenchmarkHelper for Runtime { - fn initialize_storage(beacon_header: BeaconHeader, block_roots_root: H256) { - EthereumBeaconClient::store_finalized_header(beacon_header, block_roots_root).unwrap(); - } - } - - pub struct DoNothingRouter; - impl SendXcm for DoNothingRouter { - type Ticket = Xcm<()>; - - fn validate( - _dest: &mut Option, - xcm: &mut Option>, - ) -> SendResult { - Ok((xcm.clone().unwrap(), Assets::new())) - } - fn deliver(xcm: Xcm<()>) -> Result { - let hash = xcm.using_encoded(sp_io::hashing::blake2_256); - Ok(hash) - } - } - - impl snowbridge_pallet_system::BenchmarkHelper for () { - fn make_xcm_origin(location: Location) -> RuntimeOrigin { - RuntimeOrigin::from(pallet_xcm::Origin::Xcm(location)) - } - } -} - -impl snowbridge_pallet_inbound_queue::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Verifier = snowbridge_pallet_ethereum_client::Pallet; - type Token = Balances; - #[cfg(not(feature = "runtime-benchmarks"))] - type XcmSender = XcmRouter; - #[cfg(feature = "runtime-benchmarks")] - type XcmSender = DoNothingRouter; - type ChannelLookup = EthereumSystem; - type GatewayAddress = EthereumGatewayAddress; - #[cfg(feature = "runtime-benchmarks")] - type Helper = Runtime; - type MessageConverter = MessageToXcm< - CreateAssetCall, - CreateAssetDeposit, - ConstU8, - AccountId, - Balance, - >; - type WeightToFee = WeightToFee; - type LengthToFee = ConstantMultiplier; - type MaxMessageSize = ConstU32<2048>; - type WeightInfo = weights::snowbridge_pallet_inbound_queue::WeightInfo; - type PricingParameters = EthereumSystem; - type AssetTransactor = ::AssetTransactor; -} - -impl snowbridge_pallet_outbound_queue::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Hashing = Keccak256; - type MessageQueue = MessageQueue; - type Decimals = ConstU8<12>; - type MaxMessagePayloadSize = ConstU32<2048>; - type MaxMessagesPerBlock = ConstU32<32>; - type GasMeter = snowbridge_core::outbound::ConstantGasMeter; - type Balance = Balance; - type WeightToFee = WeightToFee; - type WeightInfo = weights::snowbridge_pallet_outbound_queue::WeightInfo; - type PricingParameters = EthereumSystem; - type Channels = EthereumSystem; -} - -#[cfg(any(feature = "std", feature = "fast-runtime", feature = "runtime-benchmarks", test))] -parameter_types! { - pub const ChainForkVersions: ForkVersions = ForkVersions { - genesis: Fork { - version: [0, 0, 0, 0], // 0x00000000 - epoch: 0, - }, - altair: Fork { - version: [1, 0, 0, 0], // 0x01000000 - epoch: 0, - }, - bellatrix: Fork { - version: [2, 0, 0, 0], // 0x02000000 - epoch: 0, - }, - capella: Fork { - version: [3, 0, 0, 0], // 0x03000000 - epoch: 0, - }, - deneb: Fork { - version: [4, 0, 0, 0], // 0x04000000 - epoch: 0, - } - }; -} - -#[cfg(not(any(feature = "std", feature = "fast-runtime", feature = "runtime-benchmarks", test)))] -parameter_types! { - pub const ChainForkVersions: ForkVersions = ForkVersions { - genesis: Fork { - version: [144, 0, 0, 111], // 0x90000069 - epoch: 0, - }, - altair: Fork { - version: [144, 0, 0, 112], // 0x90000070 - epoch: 50, - }, - bellatrix: Fork { - version: [144, 0, 0, 113], // 0x90000071 - epoch: 100, - }, - capella: Fork { - version: [144, 0, 0, 114], // 0x90000072 - epoch: 56832, - }, - deneb: Fork { - version: [144, 0, 0, 115], // 0x90000073 - epoch: 132608, - }, - }; -} - -impl snowbridge_pallet_ethereum_client::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type ForkVersions = ChainForkVersions; - type WeightInfo = weights::snowbridge_pallet_ethereum_client::WeightInfo; -} - -impl snowbridge_pallet_system::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type OutboundQueue = EthereumOutboundQueue; - type SiblingOrigin = EnsureXcm; - type AgentIdOf = snowbridge_core::AgentIdOf; - type TreasuryAccount = TreasuryAccount; - type Token = Balances; - type WeightInfo = weights::snowbridge_pallet_system::WeightInfo; - #[cfg(feature = "runtime-benchmarks")] - type Helper = (); - type DefaultPricingParameters = Parameters; - type InboundDeliveryCost = EthereumInboundQueue; -} - // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime From 0b302ffc482771a316616d4ad221c0203342ef2e Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 30 May 2024 13:45:07 +0200 Subject: [PATCH 02/16] cleanup ethereum mods --- .../src/bridge_to_ethereum_config.rs | 25 ++++++++++++------- .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 11 +++++--- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs index 2b0dfeb186b9..dd62f21ebf24 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs @@ -14,20 +14,27 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -use frame_support::parameter_types; -use crate::{xcm_config::UniversalLocation, Runtime, RuntimeEvent, Balances}; +use crate::{xcm_config::UniversalLocation, Runtime, RuntimeEvent, Balances, EthereumSystem, + EthereumOutboundQueue, TreasuryAccount, EthereumInboundQueue, MessageQueue, TransactionByteFee, xcm_config, XcmRouter}; use snowbridge_router_primitives::outbound::EthereumBlobExporter; use testnet_parachains_constants::rococo::snowbridge::EthereumNetwork; use snowbridge_beacon_primitives::{Fork, ForkVersions}; use snowbridge_core::{ - gwei, meth, - outbound::{Command, Fee}, - AgentId, AllowSiblingsOnly, PricingParameters, Rewards, + gwei, meth, AllowSiblingsOnly, PricingParameters, Rewards, }; use snowbridge_router_primitives::inbound::MessageToXcm; use testnet_parachains_constants::rococo::snowbridge::INBOUND_QUEUE_PALLET_INDEX; +use testnet_parachains_constants::rococo::{ + currency::*, fee::WeightToFee, +}; +use parachains_common::{AccountId, Balance}; +use sp_core::H160; + +use sp_runtime::{traits::{ConstU32, ConstU8, Keccak256}, FixedU128}; #[cfg(feature = "runtime-benchmarks")] use benchmark_helpers::DoNothingRouter; +use frame_support::{parameter_types, weights::ConstantMultiplier}; +use pallet_xcm::EnsureXcm; /// Exports message to the Ethereum Gateway contract. pub type SnowbridgeExporter = EthereumBlobExporter< @@ -75,7 +82,7 @@ impl snowbridge_pallet_inbound_queue::Config for Runtime { type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; type MaxMessageSize = ConstU32<2048>; - type WeightInfo = weights::snowbridge_pallet_inbound_queue::WeightInfo; + type WeightInfo = crate::weights::snowbridge_pallet_inbound_queue::WeightInfo; type PricingParameters = EthereumSystem; type AssetTransactor = ::AssetTransactor; } @@ -90,7 +97,7 @@ impl snowbridge_pallet_outbound_queue::Config for Runtime { type GasMeter = snowbridge_core::outbound::ConstantGasMeter; type Balance = Balance; type WeightToFee = WeightToFee; - type WeightInfo = weights::snowbridge_pallet_outbound_queue::WeightInfo; + type WeightInfo = crate::weights::snowbridge_pallet_outbound_queue::WeightInfo; type PricingParameters = EthereumSystem; type Channels = EthereumSystem; } @@ -150,7 +157,7 @@ parameter_types! { impl snowbridge_pallet_ethereum_client::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ForkVersions = ChainForkVersions; - type WeightInfo = weights::snowbridge_pallet_ethereum_client::WeightInfo; + type WeightInfo = crate::weights::snowbridge_pallet_ethereum_client::WeightInfo; } impl snowbridge_pallet_system::Config for Runtime { @@ -160,7 +167,7 @@ impl snowbridge_pallet_system::Config for Runtime { type AgentIdOf = snowbridge_core::AgentIdOf; type TreasuryAccount = TreasuryAccount; type Token = Balances; - type WeightInfo = weights::snowbridge_pallet_system::WeightInfo; + type WeightInfo = crate::weights::snowbridge_pallet_system::WeightInfo; #[cfg(feature = "runtime-benchmarks")] type Helper = (); type DefaultPricingParameters = Parameters; diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 95fdd0f6ae40..210c06ae6cb9 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -43,12 +43,12 @@ use bridge_runtime_common::extensions::{ }; use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; use sp_api::impl_runtime_apis; -use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H160}; +use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, - traits::{Block as BlockT, Keccak256}, + traits::{Block as BlockT}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, FixedU128, + ApplyExtrinsicResult, }; use sp_std::prelude::*; @@ -79,7 +79,6 @@ use bridge_hub_common::{ message_queue::{NarrowOriginToSibling, ParaIdToSibling}, AggregateMessageOrigin, }; -use pallet_xcm::EnsureXcm; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; pub use sp_runtime::{MultiAddress, Perbill, Permill}; use xcm::VersionedLocation; @@ -91,6 +90,10 @@ pub use sp_runtime::BuildStorage; use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use rococo_runtime_constants::system_parachain::{ASSET_HUB_ID, BRIDGE_HUB_ID}; use xcm::latest::prelude::*; +use snowbridge_core::{ + outbound::{Command, Fee}, + AgentId, PricingParameters, +}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; From 3b4980d5b9c9205dcc0e48daf1951a8622b13657 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 30 May 2024 15:57:28 +0200 Subject: [PATCH 03/16] start on migration work --- Cargo.lock | 1 + .../pallets/ethereum-client/src/lib.rs | 1 + .../ethereum-client/src/migration/mod.rs | 114 ++++++++++++++++++ .../ethereum-client/src/migration/test.rs | 27 +++++ .../ethereum-client/src/migration/weights.rs | 53 ++++++++ .../bridge-hubs/bridge-hub-rococo/Cargo.toml | 1 + .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 17 +++ 7 files changed, 214 insertions(+) create mode 100644 bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs create mode 100644 bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs create mode 100644 bridges/snowbridge/pallets/ethereum-client/src/migration/weights.rs diff --git a/Cargo.lock b/Cargo.lock index 4cafb447e71a..7cc50ab53d12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2050,6 +2050,7 @@ dependencies = [ "pallet-bridge-relayers", "pallet-collator-selection", "pallet-message-queue", + "pallet-migrations", "pallet-multisig", "pallet-session", "pallet-timestamp", diff --git a/bridges/snowbridge/pallets/ethereum-client/src/lib.rs b/bridges/snowbridge/pallets/ethereum-client/src/lib.rs index 6a5972ca7a14..02109558e283 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/lib.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/lib.rs @@ -31,6 +31,7 @@ mod tests; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; +mod migration; use frame_support::{ dispatch::DispatchResult, pallet_prelude::OptionQuery, traits::Get, transactional, diff --git a/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs b/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs new file mode 100644 index 000000000000..fbaa46290c6a --- /dev/null +++ b/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs @@ -0,0 +1,114 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use crate::pallet::Config; +use frame_support::{ + migrations::{MigrationId, SteppedMigration, SteppedMigrationError}, + pallet_prelude::PhantomData, + weights::WeightMeter, +}; +use frame_support::migration::clear_storage_prefix; +use frame_support::storage::unhashed::clear_prefix; +use sp_core::Get; +use sp_runtime::Saturating; + +mod weights; +pub const PALLET_MIGRATIONS_ID: &[u8; 26] = b"ethereum-execution-headers"; + +/// Module containing the old Ethereum execution headers that should be cleaned up. +mod v0 { + use super::Config; + use crate::pallet::Pallet; + use frame_support::{storage_alias, Blake2_128Concat, Identity}; + use frame_support::pallet_prelude::{OptionQuery, ValueQuery}; + use sp_core::H256; + + #[storage_alias] + pub(super) type LatestExecutionState = + StorageValue, ExecutionHeaderState, ValueQuery>; + + #[storage_alias] + pub type ExecutionHeaders = + StorageMap, Identity, H256, CompactExecutionHeader, OptionQuery>; + + #[storage_alias] + pub type ExecutionHeaderIndex = StorageValue, u32, ValueQuery>; + + #[storage_alias] + pub type ExecutionHeaderMapping = StorageMap, Identity, u32, H256, ValueQuery>; +} + +#[derive(Copy, Clone, Default, Encode, Decode, TypeInfo, MaxEncodedLen)] +pub struct ExecutionHeaderState { + pub beacon_block_root: H256, + pub beacon_slot: u64, + pub block_hash: H256, + pub block_number: u64, +} + +#[derive( +Default, +Encode, +Decode, +CloneNoBound, +PartialEqNoBound, +RuntimeDebugNoBound, +TypeInfo, +MaxEncodedLen, +)] +pub struct CompactExecutionHeader { + pub parent_hash: H256, + #[codec(compact)] + pub block_number: u64, + pub state_root: H256, + pub receipts_root: H256, +} + +pub struct EthereumExecutionHeaderCleanup>(PhantomData<(T, W)>); +impl> SteppedMigration for EthereumExecutionHeaderCleanup { + type Cursor = u32; + type Identifier = MigrationId<26>; // Length of the migration ID PALLET_MIGRATIONS_ID + + fn id() -> Self::Identifier { + MigrationId { pallet_id: *PALLET_MIGRATIONS_ID, version_from: 0, version_to: 1 } + } + + fn step( + mut cursor: Option, + meter: &mut WeightMeter, + ) -> Result, SteppedMigrationError> { + let required = W::step(); + // If there is not enough weight for a single step, return an error. This case can be + // problematic if it is the first migration that ran in this block. But there is nothing + // that we can do about it here. + if meter.remaining().any_lt(required) { + return Err(SteppedMigrationError::InsufficientWeight { required }); + } + + // We loop here to do as much progress as possible per step. + loop { + if meter.try_consume(required).is_err() { + break; + } + + let mut index = if let Some(last_key) = cursor { + last_key.saturating_add(1) + } else { + // If no cursor is provided, start iterating from the beginning. + 0 + }; + + if index >= M::get() { + v0::LatestExecutionState::::kill(); + v0::ExecutionHeaderIndex::::kill(); + // We are at the end of the migration, signal complete. + cursor = None; + } else { + let execution_hash = v0::ExecutionHeaderMapping::::get(index); + v0::ExecutionHeaders::::delete(execution_hash); + v0::ExecutionHeaderMapping::::delete(index); + cursor = Some(index) + } + } + Ok(cursor) + } +} diff --git a/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs b/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs new file mode 100644 index 000000000000..0bf81683eaa6 --- /dev/null +++ b/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +#![cfg(all(test, not(feature = "runtime-benchmarks")))] + +use frame_support::traits::OnRuntimeUpgrade; +use pallet_migrations::WeightInfo as _; +use crate::mock::new_test_ext; + +#[test] +fn ethereum_execution_header_migration_works() { + new_test_ext().execute_with(|| { + frame_support::__private::sp_tracing::try_init_simple(); + // Insert some values into the old storage items. + + + // Give it enough weight to do exactly 16 iterations: + let limit = ::WeightInfo::progress_mbms_none() + + pallet_migrations::Pallet::::exec_migration_max_weight() + + weights::SubstrateWeight::::step() * 16; + MigratorServiceWeight::set(&limit); + + System::set_block_number(1); + AllPalletsWithSystem::on_runtime_upgrade(); // onboard MBMs + + // Check everything is empty + }); +} diff --git a/bridges/snowbridge/pallets/ethereum-client/src/migration/weights.rs b/bridges/snowbridge/pallets/ethereum-client/src/migration/weights.rs new file mode 100644 index 000000000000..2fb3aeb27077 --- /dev/null +++ b/bridges/snowbridge/pallets/ethereum-client/src/migration/weights.rs @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Autogenerated weights for `pallet_example_mbm` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-03-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `Olivers-MBP`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use core::marker::PhantomData; + +/// Weight functions needed for `pallet_example_mbm`. +pub trait WeightInfo { + fn step() -> Weight; +} + +/// Weights for `pallet_example_mbm` using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + /// Storage: `PalletExampleMbms::MyMap` (r:2 w:1) + /// Proof: `PalletExampleMbms::MyMap` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) + fn step() -> Weight { + // Proof Size summary in bytes: + // Measured: `28` + // Estimated: `5996` + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(8_000_000, 5996) // TODO update - add weights in rococo runtime + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } +} + +// For backwards compatibility and tests. +impl WeightInfo for () { + /// Storage: `PalletExampleMbms::MyMap` (r:2 w:1) + /// Proof: `PalletExampleMbms::MyMap` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) + fn step() -> Weight { + // Proof Size summary in bytes: + // Measured: `28` + // Estimated: `5996` + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(8_000_000, 5996) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } +} diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index af243998d43a..4cc57af3d112 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -37,6 +37,7 @@ pallet-authorship = { path = "../../../../../substrate/frame/authorship", defaul pallet-balances = { path = "../../../../../substrate/frame/balances", default-features = false } pallet-session = { path = "../../../../../substrate/frame/session", default-features = false } pallet-message-queue = { path = "../../../../../substrate/frame/message-queue", default-features = false } +pallet-migrations = { path = "../../../../../substrate/frame/migrations", default-features = false } pallet-multisig = { path = "../../../../../substrate/frame/multisig", default-features = false } pallet-timestamp = { path = "../../../../../substrate/frame/timestamp", default-features = false } pallet-transaction-payment = { path = "../../../../../substrate/frame/transaction-payment", default-features = false } diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 210c06ae6cb9..5f35c92e43fa 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -272,6 +272,7 @@ impl frame_system::Config for Runtime { /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type MultiBlockMigrator = pallet_migrations::Pallet; } impl pallet_timestamp::Config for Runtime { @@ -503,6 +504,21 @@ impl pallet_utility::Config for Runtime { type WeightInfo = weights::pallet_utility::WeightInfo; } +parameter_types! { + pub MbmServiceWeight: Weight = Perbill::from_percent(80) * RuntimeBlockWeights::get().max_block; +} + +impl pallet_migrations::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Migrations = (); + type CursorMaxLen = ConstU32<65_536>; + type IdentifierMaxLen = ConstU32<256>; + type MigrationStatusHandler = (); + type FailedMigrationHandler = frame_support::migrations::FreezeChainOnFailedMigration; + type MaxServiceWeight = MbmServiceWeight; + type WeightInfo = pallet_migrations::weights::SubstrateWeight; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime @@ -512,6 +528,7 @@ construct_runtime!( ParachainSystem: cumulus_pallet_parachain_system = 1, Timestamp: pallet_timestamp = 2, ParachainInfo: parachain_info = 3, + MultiBlockMigrations: pallet_migrations = 4, // Monetary stuff. Balances: pallet_balances = 10, From 1d53294a15b5d5f0e7d378821a1612c53640b190 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Tue, 4 Jun 2024 16:50:10 +0200 Subject: [PATCH 04/16] migration tests --- bridges/snowbridge/Cargo.lock | 1808 +++++------------ .../pallets/ethereum-client/Cargo.toml | 7 +- .../ethereum-client/src/migration/mod.rs | 190 +- .../ethereum-client/src/migration/test.rs | 65 +- .../pallets/ethereum-client/src/mock.rs | 55 +- 5 files changed, 720 insertions(+), 1405 deletions(-) diff --git a/bridges/snowbridge/Cargo.lock b/bridges/snowbridge/Cargo.lock index f090b5a0395d..fa1335eef6fc 100644 --- a/bridges/snowbridge/Cargo.lock +++ b/bridges/snowbridge/Cargo.lock @@ -43,18 +43,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ "crypto-common", - "generic-array 0.14.7", -] - -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom", - "once_cell", - "version_check", + "generic-array", ] [[package]] @@ -79,6 +68,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "alloy-primitives" version = "0.4.2" @@ -105,22 +100,10 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d58d9f5da7b40e9bfff0b7e7816700be4019db97d4b6359fe7f94a9e22e42ac" dependencies = [ - "alloy-rlp-derive", - "arrayvec 0.7.4", + "arrayvec", "bytes", ] -[[package]] -name = "alloy-rlp-derive" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - [[package]] name = "alloy-sol-macro" version = "0.4.2" @@ -129,11 +112,11 @@ checksum = "8a98ad1696a2e17f010ae8e43e9f2a1e930ed176a8e3ff77acfeff6dfb07b42c" dependencies = [ "const-hex", "dunce", - "heck", + "heck 0.4.1", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", "syn-solidity", "tiny-keccak", ] @@ -174,6 +157,55 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.80" @@ -196,11 +228,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" dependencies = [ "include_dir", - "itertools", + "itertools 0.10.5", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -289,7 +321,7 @@ dependencies = [ "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", - "itertools", + "itertools 0.10.5", "num-traits", "rayon", "zeroize", @@ -375,7 +407,7 @@ dependencies = [ "ark-std 0.4.0", "derivative", "digest 0.10.7", - "itertools", + "itertools 0.10.5", "num-bigint", "num-traits", "paste", @@ -546,16 +578,10 @@ dependencies = [ "ark-serialize 0.4.2", "ark-std 0.4.0", "digest 0.10.7", - "rand_core 0.6.4", + "rand_core", "sha3", ] -[[package]] -name = "array-bytes" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" - [[package]] name = "array-bytes" version = "6.2.2" @@ -568,89 +594,21 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - [[package]] name = "arrayvec" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "asset-test-utils" -version = "7.0.0" -dependencies = [ - "cumulus-pallet-parachain-system", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "frame-support", - "frame-system", - "pallet-assets", - "pallet-balances", - "pallet-collator-selection", - "pallet-session", - "pallet-timestamp", - "pallet-xcm", - "pallet-xcm-bridge-hub-router", - "parachains-common", - "parachains-runtimes-test-utils", - "parity-scale-codec", - "sp-io", - "sp-runtime", - "sp-std 14.0.0", - "staging-parachain-info", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "substrate-wasm-builder", -] - -[[package]] -name = "assets-common" -version = "0.7.0" -dependencies = [ - "cumulus-primitives-core", - "frame-support", - "impl-trait-for-tuples", - "log", - "pallet-asset-conversion", - "pallet-xcm", - "parachains-common", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-runtime", - "sp-std 14.0.0", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "substrate-wasm-builder", -] - [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", + "syn 2.0.58", ] [[package]] @@ -661,7 +619,7 @@ checksum = "823b8bb275161044e2ac7a25879cb3e2480cb403e3943022c7c769c599b756aa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -698,9 +656,9 @@ dependencies = [ "ark-std 0.4.0", "dleq_vrf", "fflonk", - "merlin 3.0.0", - "rand_chacha 0.3.1", - "rand_core 0.6.4", + "merlin", + "rand_chacha", + "rand_core", "ring", "sha2 0.10.8", "sp-ark-bls12-381", @@ -735,19 +693,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bip39" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" -dependencies = [ - "bitcoin_hashes", - "rand", - "rand_core 0.6.4", - "serde", - "unicode-normalization", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -763,11 +708,21 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + [[package]] name = "bitcoin_hashes" -version = "0.11.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative", +] [[package]] name = "bitflags" @@ -810,29 +765,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", - "arrayvec 0.7.4", + "arrayvec", "constant_time_eq", ] -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -841,16 +784,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", + "generic-array", ] [[package]] @@ -865,130 +799,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bp-header-chain" -version = "0.7.0" -dependencies = [ - "bp-runtime", - "finality-grandpa", - "frame-support", - "parity-scale-codec", - "scale-info", - "serde", - "sp-consensus-grandpa", - "sp-core", - "sp-runtime", - "sp-std 14.0.0", -] - -[[package]] -name = "bp-messages" -version = "0.7.0" -dependencies = [ - "bp-header-chain", - "bp-runtime", - "frame-support", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-std 14.0.0", -] - -[[package]] -name = "bp-parachains" -version = "0.7.0" -dependencies = [ - "bp-header-chain", - "bp-polkadot-core", - "bp-runtime", - "frame-support", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std 14.0.0", -] - -[[package]] -name = "bp-polkadot-core" -version = "0.7.0" -dependencies = [ - "bp-messages", - "bp-runtime", - "frame-support", - "frame-system", - "parity-scale-codec", - "parity-util-mem", - "scale-info", - "serde", - "sp-core", - "sp-runtime", - "sp-std 14.0.0", -] - -[[package]] -name = "bp-relayers" -version = "0.7.0" -dependencies = [ - "bp-messages", - "bp-runtime", - "frame-support", - "parity-scale-codec", - "scale-info", - "sp-runtime", - "sp-std 14.0.0", -] - -[[package]] -name = "bp-runtime" -version = "0.7.0" -dependencies = [ - "frame-support", - "frame-system", - "hash-db", - "impl-trait-for-tuples", - "log", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-state-machine", - "sp-std 14.0.0", - "sp-trie", - "trie-db", -] - -[[package]] -name = "bp-test-utils" -version = "0.7.0" -dependencies = [ - "bp-header-chain", - "bp-parachains", - "bp-polkadot-core", - "bp-runtime", - "ed25519-dalek", - "finality-grandpa", - "parity-scale-codec", - "sp-application-crypto", - "sp-consensus-grandpa", - "sp-core", - "sp-runtime", - "sp-std 14.0.0", - "sp-trie", -] - -[[package]] -name = "bp-xcm-bridge-hub" -version = "0.2.0" -dependencies = [ - "sp-std 14.0.0", -] - [[package]] name = "bp-xcm-bridge-hub-router" version = "0.6.0" @@ -1001,7 +811,7 @@ dependencies = [ [[package]] name = "bridge-hub-common" -version = "0.0.0" +version = "0.1.0" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1015,80 +825,6 @@ dependencies = [ "staging-xcm", ] -[[package]] -name = "bridge-hub-test-utils" -version = "0.7.0" -dependencies = [ - "asset-test-utils", - "bp-header-chain", - "bp-messages", - "bp-polkadot-core", - "bp-relayers", - "bp-runtime", - "bp-test-utils", - "bridge-runtime-common", - "cumulus-pallet-parachain-system", - "cumulus-pallet-xcmp-queue", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-balances", - "pallet-bridge-grandpa", - "pallet-bridge-messages", - "pallet-bridge-parachains", - "pallet-bridge-relayers", - "pallet-timestamp", - "pallet-utility", - "parachains-common", - "parachains-runtimes-test-utils", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-keyring", - "sp-runtime", - "sp-std 14.0.0", - "sp-tracing 16.0.0", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", -] - -[[package]] -name = "bridge-runtime-common" -version = "0.7.0" -dependencies = [ - "bp-header-chain", - "bp-messages", - "bp-parachains", - "bp-polkadot-core", - "bp-relayers", - "bp-runtime", - "bp-xcm-bridge-hub", - "bp-xcm-bridge-hub-router", - "frame-support", - "frame-system", - "hash-db", - "log", - "pallet-bridge-grandpa", - "pallet-bridge-messages", - "pallet-bridge-parachains", - "pallet-bridge-relayers", - "pallet-transaction-payment", - "pallet-utility", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 14.0.0", - "sp-trie", - "staging-xcm", - "staging-xcm-builder", - "static_assertions", -] - [[package]] name = "bs58" version = "0.5.0" @@ -1119,12 +855,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - [[package]] name = "bytemuck" version = "1.14.3" @@ -1221,6 +951,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + [[package]] name = "common" version = "0.1.0" @@ -1233,8 +969,8 @@ dependencies = [ "ark-std 0.4.0", "fflonk", "getrandom_or_panic", - "merlin 3.0.0", - "rand_chacha 0.3.1", + "merlin", + "rand_chacha", ] [[package]] @@ -1402,8 +1138,8 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", + "generic-array", + "rand_core", "subtle", "zeroize", ] @@ -1414,8 +1150,8 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", + "generic-array", + "rand_core", "typenum", ] @@ -1425,37 +1161,10 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.7", + "generic-array", "subtle", ] -[[package]] -name = "crypto-mac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" -dependencies = [ - "generic-array 0.14.7", - "subtle", -] - -[[package]] -name = "cumulus-pallet-aura-ext" -version = "0.7.0" -dependencies = [ - "cumulus-pallet-parachain-system", - "frame-support", - "frame-system", - "pallet-aura", - "pallet-timestamp", - "parity-scale-codec", - "scale-info", - "sp-application-crypto", - "sp-consensus-aura", - "sp-runtime", - "sp-std 14.0.0", -] - [[package]] name = "cumulus-pallet-parachain-system" version = "0.7.0" @@ -1474,6 +1183,7 @@ dependencies = [ "pallet-message-queue", "parity-scale-codec", "polkadot-parachain-primitives", + "polkadot-runtime-common", "polkadot-runtime-parachains", "scale-info", "sp-core", @@ -1486,6 +1196,7 @@ dependencies = [ "sp-trie", "sp-version", "staging-xcm", + "staging-xcm-builder", "trie-db", ] @@ -1493,38 +1204,10 @@ dependencies = [ name = "cumulus-pallet-parachain-system-proc-macro" version = "0.6.0" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.50", -] - -[[package]] -name = "cumulus-pallet-session-benchmarking" -version = "9.0.0" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-session", - "parity-scale-codec", - "sp-runtime", - "sp-std 14.0.0", -] - -[[package]] -name = "cumulus-pallet-xcm" -version = "0.7.0" -dependencies = [ - "cumulus-primitives-core", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-io", - "sp-runtime", - "sp-std 14.0.0", - "staging-xcm", + "syn 2.0.58", ] [[package]] @@ -1548,6 +1231,7 @@ dependencies = [ "sp-runtime", "sp-std 14.0.0", "staging-xcm", + "staging-xcm-builder", "staging-xcm-executor", ] @@ -1568,55 +1252,15 @@ dependencies = [ ] [[package]] -name = "cumulus-primitives-parachain-inherent" -version = "0.7.0" -dependencies = [ - "async-trait", - "cumulus-primitives-core", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-inherents", - "sp-std 14.0.0", - "sp-trie", -] - -[[package]] -name = "cumulus-primitives-proof-size-hostfunction" -version = "0.2.0" -dependencies = [ - "sp-externalities 0.25.0", - "sp-runtime-interface 24.0.0", - "sp-trie", -] - -[[package]] -name = "cumulus-primitives-utility" -version = "0.7.0" -dependencies = [ - "cumulus-primitives-core", - "frame-support", - "log", - "pallet-asset-conversion", - "pallet-xcm-benchmarks", - "parity-scale-codec", - "polkadot-runtime-common", - "polkadot-runtime-parachains", - "sp-io", - "sp-runtime", - "sp-std 14.0.0", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", -] - -[[package]] -name = "cumulus-test-relay-sproof-builder" +name = "cumulus-primitives-parachain-inherent" version = "0.7.0" dependencies = [ + "async-trait", "cumulus-primitives-core", "parity-scale-codec", - "polkadot-primitives", + "scale-info", + "sp-core", + "sp-inherents", "sp-runtime", "sp-state-machine", "sp-std 14.0.0", @@ -1624,29 +1268,25 @@ dependencies = [ ] [[package]] -name = "curve25519-dalek" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" +name = "cumulus-primitives-proof-size-hostfunction" +version = "0.2.0" dependencies = [ - "byteorder", - "digest 0.8.1", - "rand_core 0.5.1", - "subtle", - "zeroize", + "sp-externalities 0.25.0", + "sp-runtime-interface 24.0.0", + "sp-trie", ] [[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +name = "cumulus-test-relay-sproof-builder" +version = "0.7.0" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", + "cumulus-primitives-core", + "parity-scale-codec", + "polkadot-primitives", + "sp-runtime", + "sp-state-machine", + "sp-std 14.0.0", + "sp-trie", ] [[package]] @@ -1674,7 +1314,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -1701,7 +1341,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -1718,7 +1358,7 @@ checksum = "5d914fcc6452d133236ee067a9538be25ba6a644a450e1a6c617da84bf029854" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -1753,6 +1393,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive-syn-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1766,22 +1417,13 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] - [[package]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -1808,32 +1450,32 @@ dependencies = [ "ark-serialize 0.4.2", "ark-std 0.4.0", "ark-transcript", - "arrayvec 0.7.4", + "arrayvec", "zeroize", ] [[package]] name = "docify" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc4fd38aaa9fb98ac70794c82a00360d1e165a87fbf96a8a91f9dfc602aaee2" +checksum = "43a2f138ad521dc4a2ced1a4576148a6a610b4c5923933b062a263130a6802ce" dependencies = [ "docify_macros", ] [[package]] name = "docify_macros" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63fa215f3a0d40fb2a221b3aa90d8e1fbb8379785a990cb60d62ac71ebdc6460" +checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" dependencies = [ "common-path", - "derive-syn-parse", + "derive-syn-parse 0.2.0", "once_cell", "proc-macro2", "quote", "regex", - "syn 2.0.50", + "syn 2.0.58", "termcolor", "toml", "walkdir", @@ -1882,6 +1524,7 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", + "serdect", "signature", "spki", ] @@ -1902,7 +1545,7 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek 4.1.2", + "curve25519-dalek", "ed25519", "serde", "sha2 0.10.8", @@ -1912,15 +1555,16 @@ dependencies = [ [[package]] name = "ed25519-zebra" -version = "3.1.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.3", "hex", - "rand_core 0.6.4", - "sha2 0.9.9", + "rand_core", + "sha2 0.10.8", "zeroize", ] @@ -1940,11 +1584,12 @@ dependencies = [ "crypto-bigint", "digest 0.10.7", "ff", - "generic-array 0.14.7", + "generic-array", "group", "pkcs8", - "rand_core 0.6.4", + "rand_core", "sec1", + "serdect", "subtle", "zeroize", ] @@ -1972,7 +1617,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -1983,20 +1628,30 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", +] + +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", ] [[package]] name = "env_logger" -version = "0.9.3" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ - "atty", + "anstream", + "anstyle", + "env_filter", "humantime", "log", - "regex", - "termcolor", ] [[package]] @@ -2072,15 +1727,9 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - [[package]] name = "fallible-iterator" version = "0.2.0" @@ -2105,7 +1754,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", "auto_impl", "bytes", ] @@ -2116,7 +1765,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -2130,7 +1779,7 @@ dependencies = [ "ark-poly", "ark-serialize 0.4.2", "ark-std 0.4.0", - "merlin 3.0.0", + "merlin", ] [[package]] @@ -2151,22 +1800,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "finality-grandpa" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" -dependencies = [ - "either", - "futures", - "futures-timer", - "log", - "num-traits", - "parity-scale-codec", - "parking_lot", - "scale-info", -] - [[package]] name = "fixed-hash" version = "0.8.0" @@ -2222,10 +1855,10 @@ dependencies = [ name = "frame-election-provider-solution-type" version = "13.0.0" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -2244,23 +1877,6 @@ dependencies = [ "sp-std 14.0.0", ] -[[package]] -name = "frame-executive" -version = "28.0.0" -dependencies = [ - "frame-support", - "frame-system", - "frame-try-runtime", - "log", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 14.0.0", - "sp-tracing 16.0.0", -] - [[package]] name = "frame-metadata" version = "16.0.0" @@ -2278,7 +1894,7 @@ name = "frame-support" version = "28.0.0" dependencies = [ "aquamarine", - "array-bytes 6.2.2", + "array-bytes", "bitflags 1.3.2", "docify", "environmental", @@ -2319,16 +1935,16 @@ version = "23.0.0" dependencies = [ "Inflector", "cfg-expr", - "derive-syn-parse", + "derive-syn-parse 0.2.0", "expander", "frame-support-procedural-tools", - "itertools", + "itertools 0.11.0", "macro_magic", "proc-macro-warning", "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -2336,10 +1952,10 @@ name = "frame-support-procedural-tools" version = "10.0.0" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -2348,7 +1964,7 @@ version = "11.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -2370,39 +1986,6 @@ dependencies = [ "sp-weights", ] -[[package]] -name = "frame-system-benchmarking" -version = "28.0.0" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std 14.0.0", -] - -[[package]] -name = "frame-system-rpc-runtime-api" -version = "26.0.0" -dependencies = [ - "parity-scale-codec", - "sp-api", -] - -[[package]] -name = "frame-try-runtime" -version = "0.34.0" -dependencies = [ - "frame-support", - "parity-scale-codec", - "sp-api", - "sp-runtime", - "sp-std 14.0.0", -] - [[package]] name = "fs-err" version = "2.11.0" @@ -2475,7 +2058,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -2490,12 +2073,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - [[package]] name = "futures-util" version = "0.3.30" @@ -2514,15 +2091,6 @@ dependencies = [ "slab", ] -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -2552,7 +2120,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ "rand", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -2583,7 +2151,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -2607,9 +2175,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] [[package]] name = "hashbrown" @@ -2617,7 +2182,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.9", + "ahash", ] [[package]] @@ -2625,6 +2190,10 @@ name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "heck" @@ -2633,13 +2202,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] -name = "hermit-abi" -version = "0.1.19" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -2653,6 +2219,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + [[package]] name = "hex-literal" version = "0.4.1" @@ -2665,17 +2237,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", -] - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac 0.11.0", + "crypto-mac", "digest 0.9.0", ] @@ -2695,7 +2257,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.7", + "generic-array", "hmac 0.8.1", ] @@ -2831,11 +2393,17 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.8", + "hermit-abi", "libc", "windows-sys 0.48.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -2845,6 +2413,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.10" @@ -2870,6 +2447,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", + "serdect", "sha2 0.10.8", ] @@ -2990,18 +2568,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "lru" -version = "0.8.1" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" -dependencies = [ - "hashbrown 0.12.3", -] +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "mach" @@ -3021,7 +2590,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -3031,11 +2600,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" dependencies = [ "const-random", - "derive-syn-parse", + "derive-syn-parse 0.1.5", "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -3046,7 +2615,7 @@ checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -3057,7 +2626,7 @@ checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -3069,6 +2638,15 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "matrixmultiply" version = "0.3.8" @@ -3112,18 +2690,6 @@ dependencies = [ "hash-db", ] -[[package]] -name = "merlin" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.5.1", - "zeroize", -] - [[package]] name = "merlin" version = "3.0.0" @@ -3132,7 +2698,7 @@ checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", "keccak", - "rand_core 0.6.4", + "rand_core", "zeroize", ] @@ -3178,6 +2744,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-bigint" version = "0.4.4" @@ -3204,7 +2780,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", "itoa", ] @@ -3244,7 +2820,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.8", + "hermit-abi", "libc", ] @@ -3277,91 +2853,26 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "pallet-asset-conversion" -version = "10.0.0" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 14.0.0", -] - -[[package]] -name = "pallet-asset-rate" -version = "7.0.0" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std 14.0.0", -] - -[[package]] -name = "pallet-asset-tx-payment" -version = "28.0.0" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-transaction-payment", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 14.0.0", -] +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "pallet-assets" -version = "29.0.0" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std 14.0.0", -] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] -name = "pallet-aura" -version = "27.0.0" +name = "pallet-asset-rate" +version = "7.0.0" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", - "log", - "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-application-crypto", - "sp-consensus-aura", + "sp-core", "sp-runtime", "sp-std 14.0.0", ] @@ -3432,82 +2943,6 @@ dependencies = [ "sp-std 14.0.0", ] -[[package]] -name = "pallet-bridge-grandpa" -version = "0.7.0" -dependencies = [ - "bp-header-chain", - "bp-runtime", - "bp-test-utils", - "finality-grandpa", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-consensus-grandpa", - "sp-runtime", - "sp-std 14.0.0", - "sp-trie", -] - -[[package]] -name = "pallet-bridge-messages" -version = "0.7.0" -dependencies = [ - "bp-messages", - "bp-runtime", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "num-traits", - "parity-scale-codec", - "scale-info", - "sp-runtime", - "sp-std 14.0.0", -] - -[[package]] -name = "pallet-bridge-parachains" -version = "0.7.0" -dependencies = [ - "bp-header-chain", - "bp-parachains", - "bp-polkadot-core", - "bp-runtime", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-bridge-grandpa", - "parity-scale-codec", - "scale-info", - "sp-runtime", - "sp-std 14.0.0", - "sp-trie", -] - -[[package]] -name = "pallet-bridge-relayers" -version = "0.7.0" -dependencies = [ - "bp-messages", - "bp-relayers", - "bp-runtime", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-bridge-messages", - "parity-scale-codec", - "scale-info", - "sp-arithmetic", - "sp-runtime", - "sp-std 14.0.0", -] - [[package]] name = "pallet-broker" version = "0.6.0" @@ -3516,8 +2951,10 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", + "sp-api", "sp-arithmetic", "sp-core", "sp-runtime", @@ -3533,6 +2970,7 @@ dependencies = [ "frame-system", "log", "pallet-authorship", + "pallet-balances", "pallet-session", "parity-scale-codec", "rand", @@ -3561,7 +2999,7 @@ dependencies = [ "sp-npos-elections", "sp-runtime", "sp-std 14.0.0", - "strum", + "strum 0.26.2", ] [[package]] @@ -3631,16 +3069,17 @@ dependencies = [ ] [[package]] -name = "pallet-multisig" -version = "28.0.0" +name = "pallet-migrations" +version = "1.0.0" dependencies = [ - "frame-benchmarking", + "docify", "frame-support", "frame-system", + "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", - "sp-io", + "sp-core", "sp-runtime", "sp-std 14.0.0", ] @@ -3678,7 +3117,7 @@ dependencies = [ "pallet-authorship", "pallet-session", "parity-scale-codec", - "rand_chacha 0.2.2", + "rand_chacha", "scale-info", "serde", "sp-application-crypto", @@ -3730,17 +3169,6 @@ dependencies = [ "sp-std 14.0.0", ] -[[package]] -name = "pallet-transaction-payment-rpc-runtime-api" -version = "28.0.0" -dependencies = [ - "pallet-transaction-payment", - "parity-scale-codec", - "sp-api", - "sp-runtime", - "sp-weights", -] - [[package]] name = "pallet-treasury" version = "27.0.0" @@ -3808,72 +3236,7 @@ dependencies = [ "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", -] - -[[package]] -name = "pallet-xcm-benchmarks" -version = "7.0.0" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-io", - "sp-runtime", - "sp-std 14.0.0", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", -] - -[[package]] -name = "pallet-xcm-bridge-hub-router" -version = "0.5.0" -dependencies = [ - "bp-xcm-bridge-hub-router", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std 14.0.0", - "staging-xcm", - "staging-xcm-builder", -] - -[[package]] -name = "parachains-common" -version = "7.0.0" -dependencies = [ - "cumulus-primitives-core", - "cumulus-primitives-utility", - "frame-support", - "frame-system", - "log", - "pallet-asset-tx-payment", - "pallet-assets", - "pallet-authorship", - "pallet-balances", - "pallet-collator-selection", - "pallet-message-queue", - "pallet-xcm", - "parity-scale-codec", - "polkadot-primitives", - "scale-info", - "sp-consensus-aura", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 14.0.0", - "staging-parachain-info", - "staging-xcm", - "staging-xcm-executor", - "substrate-wasm-builder", + "xcm-fee-payment-runtime-api", ] [[package]] @@ -3906,6 +3269,19 @@ dependencies = [ "substrate-wasm-builder", ] +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes", + "rand", + "rand_core", + "serde", + "unicode-normalization", +] + [[package]] name = "parity-bytes" version = "0.1.2" @@ -3914,11 +3290,11 @@ checksum = "16b56e3a2420138bdb970f84dfb9c774aea80fa0e7371549eedec0d80c209c67" [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", "bitvec", "byte-slice-cast", "bytes", @@ -3929,45 +3305,16 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", ] -[[package]] -name = "parity-util-mem" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d32c34f4f5ca7f9196001c0aba5a1f9a5a12382c8944b8b0f90233282d1e8f8" -dependencies = [ - "cfg-if", - "ethereum-types", - "hashbrown 0.12.3", - "impl-trait-for-tuples", - "lru", - "parity-util-mem-derive", - "parking_lot", - "primitive-types", - "smallvec", - "winapi", -] - -[[package]] -name = "parity-util-mem-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" -dependencies = [ - "proc-macro2", - "syn 1.0.109", - "synstructure", -] - [[package]] name = "parity-wasm" version = "0.45.0" @@ -3997,6 +3344,17 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" @@ -4005,11 +3363,12 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pbkdf2" -version = "0.8.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ - "crypto-mac 0.11.0", + "digest 0.10.7", + "password-hash", ] [[package]] @@ -4143,7 +3502,6 @@ dependencies = [ "pallet-transaction-payment", "pallet-treasury", "pallet-vesting", - "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-primitives", "polkadot-runtime-parachains", @@ -4207,7 +3565,7 @@ dependencies = [ "polkadot-primitives", "polkadot-runtime-metrics", "rand", - "rand_chacha 0.3.1", + "rand_chacha", "rustc-hex", "scale-info", "serde", @@ -4233,13 +3591,28 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92c99f7eee94e7be43ba37eef65ad0ee8cbaf89b7c00001c3f6d2be985cb1817" +[[package]] +name = "polkavm-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" + [[package]] name = "polkavm-derive" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79fa916f7962348bd1bb1a65a83401675e6fc86c51a0fdbcf92a3108e58e6125" dependencies = [ - "polkavm-derive-impl-macro", + "polkavm-derive-impl-macro 0.8.0", +] + +[[package]] +name = "polkavm-derive" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" +dependencies = [ + "polkavm-derive-impl-macro 0.9.0", ] [[package]] @@ -4248,10 +3621,22 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c10b2654a8a10a83c260bfb93e97b262cf0017494ab94a65d389e0eda6de6c9c" dependencies = [ - "polkavm-common", + "polkavm-common 0.8.0", + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" +dependencies = [ + "polkavm-common 0.9.0", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -4260,21 +3645,31 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" dependencies = [ - "polkavm-derive-impl", - "syn 2.0.50", + "polkavm-derive-impl 0.8.0", + "syn 2.0.58", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" +dependencies = [ + "polkavm-derive-impl 0.9.0", + "syn 2.0.58", ] [[package]] name = "polkavm-linker" -version = "0.8.2" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdec1451cb18261d5d01de82acc15305e417fb59588cdcb3127d3dcc9672b925" +checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" dependencies = [ "gimli 0.28.1", "hashbrown 0.14.3", "log", "object 0.32.2", - "polkavm-common", + "polkavm-common 0.9.0", "regalloc2", "rustc-demangle", ] @@ -4299,25 +3694,6 @@ dependencies = [ "uint", ] -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.7", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" @@ -4359,7 +3735,7 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -4383,7 +3759,7 @@ dependencies = [ "lazy_static", "num-traits", "rand", - "rand_chacha 0.3.1", + "rand_chacha", "rand_xorshift", "regex-syntax 0.8.2", "rusty-fork", @@ -4428,18 +3804,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", ] [[package]] @@ -4449,15 +3815,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", + "rand_core", ] -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" - [[package]] name = "rand_core" version = "0.6.4" @@ -4473,7 +3833,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -4528,7 +3888,7 @@ checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -4611,7 +3971,7 @@ dependencies = [ "blake2", "common", "fflonk", - "merlin 3.0.0", + "merlin", ] [[package]] @@ -4761,9 +4121,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.10.0" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "bitvec", "cfg-if", @@ -4775,11 +4135,11 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.10.0" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -4791,27 +4151,11 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.9", + "ahash", "cfg-if", "hashbrown 0.13.2", ] -[[package]] -name = "schnorrkel" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "curve25519-dalek 2.1.3", - "merlin 2.0.1", - "rand_core 0.5.1", - "sha2 0.8.2", - "subtle", - "zeroize", -] - [[package]] name = "schnorrkel" version = "0.11.4" @@ -4820,11 +4164,11 @@ checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" dependencies = [ "aead", "arrayref", - "arrayvec 0.7.4", - "curve25519-dalek 4.1.2", + "arrayvec", + "curve25519-dalek", "getrandom_or_panic", - "merlin 3.0.0", - "rand_core 0.6.4", + "merlin", + "rand_core", "serde_bytes", "sha2 0.10.8", "subtle", @@ -4857,8 +4201,9 @@ checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", - "generic-array 0.14.7", + "generic-array", "pkcs8", + "serdect", "subtle", "zeroize", ] @@ -4967,7 +4312,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -4991,15 +4336,13 @@ dependencies = [ ] [[package]] -name = "sha2" -version = "0.8.2" +name = "serdect" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", + "base16ct", + "serde", ] [[package]] @@ -5012,7 +4355,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug", ] [[package]] @@ -5052,7 +4395,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -5118,11 +4461,10 @@ dependencies = [ [[package]] name = "snowbridge-beacon-primitives" -version = "0.9.0" +version = "0.2.0" dependencies = [ "byte-slice-cast", "frame-support", - "frame-system", "hex", "hex-literal", "parity-scale-codec", @@ -5137,12 +4479,11 @@ dependencies = [ "sp-std 14.0.0", "ssz_rs", "ssz_rs_derive", - "static_assertions", ] [[package]] name = "snowbridge-core" -version = "0.9.0" +version = "0.2.0" dependencies = [ "ethabi-decode", "frame-support", @@ -5165,7 +4506,7 @@ dependencies = [ [[package]] name = "snowbridge-ethereum" -version = "0.9.0" +version = "0.3.0" dependencies = [ "ethabi-decode", "ethbloom", @@ -5175,12 +4516,10 @@ dependencies = [ "parity-scale-codec", "rand", "rlp", - "rustc-hex", "scale-info", "serde", "serde-big-array", "serde_json", - "sp-core", "sp-io", "sp-runtime", "sp-std 14.0.0", @@ -5204,9 +4543,9 @@ dependencies = [ [[package]] name = "snowbridge-outbound-queue-merkle-tree" -version = "0.9.0" +version = "0.3.0" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", "env_logger", "hex", "hex-literal", @@ -5219,33 +4558,28 @@ dependencies = [ [[package]] name = "snowbridge-outbound-queue-runtime-api" -version = "0.9.0" +version = "0.2.0" dependencies = [ "frame-support", "parity-scale-codec", "snowbridge-core", "snowbridge-outbound-queue-merkle-tree", "sp-api", - "sp-core", "sp-std 14.0.0", - "staging-xcm", ] [[package]] name = "snowbridge-pallet-ethereum-client" -version = "0.9.0" +version = "0.2.0" dependencies = [ - "bp-runtime", - "byte-slice-cast", "frame-benchmarking", "frame-support", "frame-system", "hex-literal", "log", - "pallet-timestamp", + "pallet-migrations", "parity-scale-codec", "rand", - "rlp", "scale-info", "serde", "serde_json", @@ -5258,8 +4592,6 @@ dependencies = [ "sp-keyring", "sp-runtime", "sp-std 14.0.0", - "ssz_rs", - "ssz_rs_derive", "static_assertions", ] @@ -5267,9 +4599,6 @@ dependencies = [ name = "snowbridge-pallet-ethereum-client-fixtures" version = "0.9.0" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", "hex-literal", "snowbridge-beacon-primitives", "snowbridge-core", @@ -5279,24 +4608,21 @@ dependencies = [ [[package]] name = "snowbridge-pallet-inbound-queue" -version = "0.9.0" +version = "0.2.0" dependencies = [ "alloy-primitives", - "alloy-rlp", "alloy-sol-types", "frame-benchmarking", "frame-support", "frame-system", "hex-literal", "log", - "num-traits", "pallet-balances", "parity-scale-codec", "scale-info", "serde", "snowbridge-beacon-primitives", "snowbridge-core", - "snowbridge-ethereum", "snowbridge-pallet-ethereum-client", "snowbridge-pallet-inbound-queue-fixtures", "snowbridge-router-primitives", @@ -5306,17 +4632,13 @@ dependencies = [ "sp-runtime", "sp-std 14.0.0", "staging-xcm", - "staging-xcm-builder", "staging-xcm-executor", ] [[package]] name = "snowbridge-pallet-inbound-queue-fixtures" -version = "0.9.0" +version = "0.10.0" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", "hex-literal", "snowbridge-beacon-primitives", "snowbridge-core", @@ -5326,14 +4648,13 @@ dependencies = [ [[package]] name = "snowbridge-pallet-outbound-queue" -version = "0.9.0" +version = "0.2.0" dependencies = [ "bridge-hub-common", "ethabi-decode", "frame-benchmarking", "frame-support", "frame-system", - "hex-literal", "pallet-message-queue", "parity-scale-codec", "scale-info", @@ -5346,14 +4667,12 @@ dependencies = [ "sp-keyring", "sp-runtime", "sp-std 14.0.0", - "staging-xcm", ] [[package]] name = "snowbridge-pallet-system" -version = "0.9.0" +version = "0.2.0" dependencies = [ - "ethabi-decode", "frame-benchmarking", "frame-support", "frame-system", @@ -5373,7 +4692,6 @@ dependencies = [ "sp-runtime", "sp-std 14.0.0", "staging-xcm", - "staging-xcm-builder", "staging-xcm-executor", ] @@ -5381,31 +4699,26 @@ dependencies = [ name = "snowbridge-router-primitives" version = "0.9.0" dependencies = [ - "ethabi-decode", "frame-support", - "frame-system", "hex-literal", "log", "parity-scale-codec", "rustc-hex", "scale-info", - "serde", "snowbridge-core", "sp-core", "sp-io", "sp-runtime", "sp-std 14.0.0", "staging-xcm", - "staging-xcm-builder", "staging-xcm-executor", ] [[package]] name = "snowbridge-runtime-common" -version = "0.9.0" +version = "0.2.0" dependencies = [ "frame-support", - "frame-system", "log", "parity-scale-codec", "snowbridge-core", @@ -5418,89 +4731,41 @@ dependencies = [ [[package]] name = "snowbridge-runtime-test-common" -version = "0.9.0" +version = "0.2.0" dependencies = [ - "assets-common", - "bridge-hub-test-utils", - "bridge-runtime-common", - "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", - "cumulus-pallet-session-benchmarking", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "cumulus-primitives-utility", - "frame-benchmarking", - "frame-executive", "frame-support", "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "hex-literal", - "log", - "pallet-aura", - "pallet-authorship", "pallet-balances", "pallet-collator-selection", "pallet-message-queue", - "pallet-multisig", "pallet-session", "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", "pallet-utility", "pallet-xcm", - "pallet-xcm-benchmarks", - "parachains-common", "parachains-runtimes-test-utils", "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain-primitives", - "polkadot-runtime-common", - "scale-info", - "serde", - "smallvec", - "snowbridge-beacon-primitives", "snowbridge-core", - "snowbridge-outbound-queue-runtime-api", "snowbridge-pallet-ethereum-client", "snowbridge-pallet-ethereum-client-fixtures", - "snowbridge-pallet-inbound-queue", "snowbridge-pallet-outbound-queue", "snowbridge-pallet-system", - "snowbridge-router-primitives", - "snowbridge-system-runtime-api", - "sp-api", - "sp-block-builder", - "sp-consensus-aura", "sp-core", - "sp-genesis-builder", - "sp-inherents", "sp-io", "sp-keyring", - "sp-offchain", "sp-runtime", - "sp-session", - "sp-std 14.0.0", - "sp-storage 19.0.0", - "sp-transaction-pool", - "sp-version", "staging-parachain-info", "staging-xcm", - "staging-xcm-builder", "staging-xcm-executor", - "static_assertions", ] [[package]] name = "snowbridge-system-runtime-api" -version = "0.9.0" +version = "0.2.0" dependencies = [ "parity-scale-codec", "snowbridge-core", "sp-api", - "sp-core", "sp-std 14.0.0", "staging-xcm", ] @@ -5533,10 +4798,10 @@ dependencies = [ "Inflector", "blake2", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -5555,6 +4820,7 @@ dependencies = [ name = "sp-arithmetic" version = "23.0.0" dependencies = [ + "docify", "integer-sqrt", "num-traits", "parity-scale-codec", @@ -5591,17 +4857,6 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-runtime", - "sp-std 14.0.0", -] - -[[package]] -name = "sp-block-builder" -version = "26.0.0" -dependencies = [ - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std 14.0.0", ] [[package]] @@ -5616,7 +4871,6 @@ dependencies = [ "sp-consensus-slots", "sp-inherents", "sp-runtime", - "sp-std 14.0.0", "sp-timestamp", ] @@ -5634,27 +4888,9 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-std 14.0.0", "sp-timestamp", ] -[[package]] -name = "sp-consensus-grandpa" -version = "13.0.0" -dependencies = [ - "finality-grandpa", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std 14.0.0", -] - [[package]] name = "sp-consensus-slots" version = "0.32.0" @@ -5662,7 +4898,6 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 14.0.0", "sp-timestamp", ] @@ -5670,9 +4905,8 @@ dependencies = [ name = "sp-core" version = "28.0.0" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "bandersnatch_vrfs", - "bip39", "bitflags 1.3.2", "blake2", "bounded-collections", @@ -5683,17 +4917,19 @@ dependencies = [ "hash-db", "hash256-std-hasher", "impl-serde", - "itertools", + "itertools 0.11.0", + "k256", "libsecp256k1", "log", - "merlin 3.0.0", + "merlin", + "parity-bip39", "parity-scale-codec", "parking_lot", "paste", "primitive-types", "rand", "scale-info", - "schnorrkel 0.11.4", + "schnorrkel", "secp256k1", "secrecy", "serde", @@ -5734,7 +4970,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" -version = "0.0.0" +version = "0.1.0" dependencies = [ "blake2b_simd", "byteorder", @@ -5746,11 +4982,11 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" -version = "0.0.0" +version = "0.1.0" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -5759,7 +4995,7 @@ version = "14.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -5769,7 +5005,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk#de6d02591b57d03f70ed8db dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -5778,7 +5014,6 @@ version = "0.25.0" dependencies = [ "environmental", "parity-scale-codec", - "sp-std 14.0.0", "sp-storage 19.0.0", ] @@ -5795,12 +5030,13 @@ dependencies = [ [[package]] name = "sp-genesis-builder" -version = "0.7.0" +version = "0.8.0" dependencies = [ + "parity-scale-codec", + "scale-info", "serde_json", "sp-api", "sp-runtime", - "sp-std 14.0.0", ] [[package]] @@ -5812,7 +5048,6 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std 14.0.0", "thiserror", ] @@ -5825,6 +5060,7 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", + "polkavm-derive 0.9.1", "rustversion", "secp256k1", "sp-core", @@ -5846,7 +5082,7 @@ version = "31.0.0" dependencies = [ "sp-core", "sp-runtime", - "strum", + "strum 0.26.2", ] [[package]] @@ -5874,7 +5110,6 @@ dependencies = [ "frame-metadata", "parity-scale-codec", "scale-info", - "sp-std 14.0.0", ] [[package]] @@ -5887,16 +5122,6 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std 14.0.0", -] - -[[package]] -name = "sp-offchain" -version = "26.0.0" -dependencies = [ - "sp-api", - "sp-core", - "sp-runtime", ] [[package]] @@ -5917,6 +5142,7 @@ dependencies = [ "hash256-std-hasher", "impl-trait-for-tuples", "log", + "num-traits", "parity-scale-codec", "paste", "rand", @@ -5938,7 +5164,7 @@ dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive", + "polkavm-derive 0.9.1", "primitive-types", "sp-externalities 0.25.0", "sp-runtime-interface-proc-macro 17.0.0", @@ -5957,7 +5183,7 @@ dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive", + "polkavm-derive 0.8.0", "primitive-types", "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk)", "sp-runtime-interface-proc-macro 17.0.0 (git+https://github.com/paritytech/polkadot-sdk)", @@ -5974,10 +5200,10 @@ version = "17.0.0" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -5987,10 +5213,10 @@ source = "git+https://github.com/paritytech/polkadot-sdk#de6d02591b57d03f70ed8db dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -6004,7 +5230,6 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", - "sp-std 14.0.0", ] [[package]] @@ -6017,7 +5242,6 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std 14.0.0", ] [[package]] @@ -6033,7 +5257,6 @@ dependencies = [ "sp-core", "sp-externalities 0.25.0", "sp-panic-handler", - "sp-std 14.0.0", "sp-trie", "thiserror", "tracing", @@ -6058,7 +5281,6 @@ dependencies = [ "ref-cast", "serde", "sp-debug-derive 14.0.0", - "sp-std 14.0.0", ] [[package]] @@ -6082,7 +5304,6 @@ dependencies = [ "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std 14.0.0", "thiserror", ] @@ -6091,10 +5312,9 @@ name = "sp-tracing" version = "16.0.0" dependencies = [ "parity-scale-codec", - "sp-std 14.0.0", "tracing", "tracing-core", - "tracing-subscriber", + "tracing-subscriber 0.3.18", ] [[package]] @@ -6106,22 +5326,14 @@ dependencies = [ "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", "tracing", "tracing-core", - "tracing-subscriber", -] - -[[package]] -name = "sp-transaction-pool" -version = "26.0.0" -dependencies = [ - "sp-api", - "sp-runtime", + "tracing-subscriber 0.2.25", ] [[package]] name = "sp-trie" version = "29.0.0" dependencies = [ - "ahash 0.8.9", + "ahash", "hash-db", "lazy_static", "memory-db", @@ -6133,7 +5345,6 @@ dependencies = [ "schnellru", "sp-core", "sp-externalities 0.25.0", - "sp-std 14.0.0", "thiserror", "tracing", "trie-db", @@ -6163,19 +5374,16 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] name = "sp-wasm-interface" version = "20.0.0" dependencies = [ - "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std 14.0.0", - "wasmtime", ] [[package]] @@ -6202,7 +5410,6 @@ dependencies = [ "smallvec", "sp-arithmetic", "sp-debug-derive 14.0.0", - "sp-std 14.0.0", ] [[package]] @@ -6276,7 +5483,7 @@ dependencies = [ name = "staging-xcm" version = "7.0.0" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "bounded-collections", "derivative", "environmental", @@ -6341,8 +5548,14 @@ name = "strum" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ - "strum_macros", + "strum_macros 0.26.3", ] [[package]] @@ -6351,7 +5564,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -6359,15 +5572,26 @@ dependencies = [ ] [[package]] -name = "substrate-bip39" -version = "0.4.5" +name = "strum_macros" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e620c7098893ba667438b47169c00aacdd9e7c10e042250ce2b60b087ec97328" +checksum = "f7993a8e3a9e88a00351486baae9522c91b123a088f76469e5bd5cc17198ea87" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.58", +] + +[[package]] +name = "substrate-bip39" +version = "0.4.7" dependencies = [ - "hmac 0.11.0", + "hmac 0.12.1", "pbkdf2", - "schnorrkel 0.9.1", - "sha2 0.9.9", + "schnorrkel", + "sha2 0.10.8", "zeroize", ] @@ -6382,7 +5606,7 @@ dependencies = [ "parity-wasm", "polkavm-linker", "sp-maybe-compressed-blob", - "strum", + "strum 0.26.2", "tempfile", "toml", "walkdir", @@ -6408,9 +5632,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.50" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -6426,19 +5650,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.50", -] - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", + "syn 2.0.58", ] [[package]] @@ -6491,7 +5703,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -6549,28 +5761,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.2.3", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.3", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -6614,7 +5804,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -6638,6 +5828,17 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + [[package]] name = "tracing-serde" version = "0.1.3" @@ -6657,7 +5858,7 @@ dependencies = [ "ansi_term", "chrono", "lazy_static", - "matchers", + "matchers 0.0.1", "regex", "serde", "serde_json", @@ -6666,18 +5867,35 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.1.4", "tracing-serde", ] +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers 0.1.0", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log 0.2.0", +] + [[package]] name = "trie-db" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" +checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f" dependencies = [ "hash-db", - "hashbrown 0.13.2", "log", "rustc-hex", "smallvec", @@ -6784,6 +6002,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "valuable" version = "0.1.0" @@ -6812,8 +6036,8 @@ dependencies = [ "constcat", "digest 0.10.7", "rand", - "rand_chacha 0.3.1", - "rand_core 0.6.4", + "rand_chacha", + "rand_core", "sha2 0.10.8", "sha3", "thiserror", @@ -6866,7 +6090,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", "wasm-bindgen-shared", ] @@ -6900,7 +6124,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6933,7 +6157,7 @@ checksum = "a5211b7550606857312bba1d978a8ec75692eae187becc5e680444fffc5e6f89" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -6944,8 +6168,8 @@ checksum = "fc942673e7684671f0c5708fc18993569d184265fd5223bb51fc8e5b9b6cfd52" dependencies = [ "anyhow", "libc", - "strum", - "strum_macros", + "strum 0.24.1", + "strum_macros 0.24.3", "tempfile", "thiserror", "wasm-opt-cxx-sys", @@ -7403,6 +6627,20 @@ dependencies = [ "tap", ] +[[package]] +name = "xcm-fee-payment-runtime-api" +version = "0.1.0" +dependencies = [ + "frame-support", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-runtime", + "sp-std 14.0.0", + "sp-weights", + "staging-xcm", +] + [[package]] name = "xcm-procedural" version = "7.0.0" @@ -7410,7 +6648,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -7430,7 +6668,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] @@ -7450,7 +6688,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.58", ] [[package]] diff --git a/bridges/snowbridge/pallets/ethereum-client/Cargo.toml b/bridges/snowbridge/pallets/ethereum-client/Cargo.toml index e60934e34740..3b5150a7a0c3 100644 --- a/bridges/snowbridge/pallets/ethereum-client/Cargo.toml +++ b/bridges/snowbridge/pallets/ethereum-client/Cargo.toml @@ -35,14 +35,13 @@ snowbridge-ethereum = { path = "../../primitives/ethereum", default-features = f snowbridge-pallet-ethereum-client-fixtures = { path = "fixtures", default-features = false, optional = true } primitives = { package = "snowbridge-beacon-primitives", path = "../../primitives/beacon", default-features = false } static_assertions = { version = "1.1.0", default-features = false } -pallet-timestamp = { path = "../../../../substrate/frame/timestamp", default-features = false, optional = true } +pallet-migrations = { path = "../../../../substrate/frame/migrations", default-features = false } [dev-dependencies] rand = "0.8.5" sp-keyring = { path = "../../../../substrate/primitives/keyring" } serde_json = { workspace = true, default-features = true } hex-literal = "0.4.1" -pallet-timestamp = { path = "../../../../substrate/frame/timestamp" } snowbridge-pallet-ethereum-client-fixtures = { path = "fixtures" } sp-io = { path = "../../../../substrate/primitives/io" } serde = { workspace = true, default-features = true } @@ -51,7 +50,6 @@ serde = { workspace = true, default-features = true } default = ["std"] fuzzing = [ "hex-literal", - "pallet-timestamp", "serde", "serde_json", "sp-io", @@ -61,7 +59,6 @@ std = [ "frame-support/std", "frame-system/std", "log/std", - "pallet-timestamp/std", "primitives/std", "scale-info/std", "serde", @@ -79,7 +76,6 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "hex-literal", - "pallet-timestamp?/runtime-benchmarks", "snowbridge-core/runtime-benchmarks", "snowbridge-pallet-ethereum-client-fixtures/runtime-benchmarks", "sp-runtime/runtime-benchmarks", @@ -87,6 +83,5 @@ runtime-benchmarks = [ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", - "pallet-timestamp?/try-runtime", "sp-runtime/try-runtime", ] diff --git a/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs b/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs index fbaa46290c6a..ec5c78f85bd0 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs @@ -2,113 +2,125 @@ // SPDX-FileCopyrightText: 2023 Snowfork use crate::pallet::Config; use frame_support::{ - migrations::{MigrationId, SteppedMigration, SteppedMigrationError}, - pallet_prelude::PhantomData, - weights::WeightMeter, + migrations::{MigrationId, SteppedMigration, SteppedMigrationError}, + pallet_prelude::PhantomData, + weights::WeightMeter, }; -use frame_support::migration::clear_storage_prefix; -use frame_support::storage::unhashed::clear_prefix; +use scale_info::TypeInfo; use sp_core::Get; -use sp_runtime::Saturating; -mod weights; +mod test; +pub mod weights; + pub const PALLET_MIGRATIONS_ID: &[u8; 26] = b"ethereum-execution-headers"; +pub const LOG_TARGET: &str = "ethereum-client-migration"; /// Module containing the old Ethereum execution headers that should be cleaned up. mod v0 { - use super::Config; - use crate::pallet::Pallet; - use frame_support::{storage_alias, Blake2_128Concat, Identity}; - use frame_support::pallet_prelude::{OptionQuery, ValueQuery}; - use sp_core::H256; + use super::Config; + use crate::pallet::Pallet; + use frame_support::{ + pallet_prelude::{Decode, Encode, MaxEncodedLen, OptionQuery, TypeInfo, ValueQuery}, + storage_alias, CloneNoBound, Identity, PartialEqNoBound, RuntimeDebugNoBound, + }; + use sp_core::H256; - #[storage_alias] - pub(super) type LatestExecutionState = - StorageValue, ExecutionHeaderState, ValueQuery>; + #[storage_alias] + pub(super) type LatestExecutionState = + StorageValue, ExecutionHeaderState, ValueQuery>; - #[storage_alias] - pub type ExecutionHeaders = - StorageMap, Identity, H256, CompactExecutionHeader, OptionQuery>; + #[storage_alias] + pub type ExecutionHeaders = + StorageMap, Identity, H256, CompactExecutionHeader, OptionQuery>; - #[storage_alias] - pub type ExecutionHeaderIndex = StorageValue, u32, ValueQuery>; + #[storage_alias] + pub type ExecutionHeaderIndex = StorageValue, u32, ValueQuery>; - #[storage_alias] - pub type ExecutionHeaderMapping = StorageMap, Identity, u32, H256, ValueQuery>; -} + #[storage_alias] + pub type ExecutionHeaderMapping = + StorageMap, Identity, u32, H256, ValueQuery>; -#[derive(Copy, Clone, Default, Encode, Decode, TypeInfo, MaxEncodedLen)] -pub struct ExecutionHeaderState { - pub beacon_block_root: H256, - pub beacon_slot: u64, - pub block_hash: H256, - pub block_number: u64, -} + #[derive(Copy, Clone, Default, Encode, Decode, TypeInfo, MaxEncodedLen)] + pub struct ExecutionHeaderState { + pub beacon_block_root: H256, + pub beacon_slot: u64, + pub block_hash: H256, + pub block_number: u64, + } -#[derive( -Default, -Encode, -Decode, -CloneNoBound, -PartialEqNoBound, -RuntimeDebugNoBound, -TypeInfo, -MaxEncodedLen, -)] -pub struct CompactExecutionHeader { - pub parent_hash: H256, - #[codec(compact)] - pub block_number: u64, - pub state_root: H256, - pub receipts_root: H256, + #[derive( + Default, + Encode, + Decode, + CloneNoBound, + PartialEqNoBound, + RuntimeDebugNoBound, + TypeInfo, + MaxEncodedLen, + )] + pub struct CompactExecutionHeader { + pub parent_hash: H256, + #[codec(compact)] + pub block_number: u64, + pub state_root: H256, + pub receipts_root: H256, + } } -pub struct EthereumExecutionHeaderCleanup>(PhantomData<(T, W)>); -impl> SteppedMigration for EthereumExecutionHeaderCleanup { - type Cursor = u32; - type Identifier = MigrationId<26>; // Length of the migration ID PALLET_MIGRATIONS_ID +pub struct EthereumExecutionHeaderCleanup>( + PhantomData<(T, W, M)>, +); +impl> SteppedMigration + for EthereumExecutionHeaderCleanup +{ + type Cursor = u32; + type Identifier = MigrationId<26>; // Length of the migration ID PALLET_MIGRATIONS_ID - fn id() -> Self::Identifier { - MigrationId { pallet_id: *PALLET_MIGRATIONS_ID, version_from: 0, version_to: 1 } - } + fn id() -> Self::Identifier { + MigrationId { pallet_id: *PALLET_MIGRATIONS_ID, version_from: 0, version_to: 1 } + } - fn step( - mut cursor: Option, - meter: &mut WeightMeter, - ) -> Result, SteppedMigrationError> { - let required = W::step(); - // If there is not enough weight for a single step, return an error. This case can be - // problematic if it is the first migration that ran in this block. But there is nothing - // that we can do about it here. - if meter.remaining().any_lt(required) { - return Err(SteppedMigrationError::InsufficientWeight { required }); - } + fn step( + mut cursor: Option, + meter: &mut WeightMeter, + ) -> Result, SteppedMigrationError> { + let required = W::step(); + // If there is not enough weight for a single step, return an error. This case can be + // problematic if it is the first migration that ran in this block. But there is nothing + // that we can do about it here. + if meter.remaining().any_lt(required) { + return Err(SteppedMigrationError::InsufficientWeight { required }); + } - // We loop here to do as much progress as possible per step. - loop { - if meter.try_consume(required).is_err() { - break; - } + // We loop here to do as much progress as possible per step. + loop { + if meter.try_consume(required).is_err() { + break; + } - let mut index = if let Some(last_key) = cursor { - last_key.saturating_add(1) - } else { - // If no cursor is provided, start iterating from the beginning. - 0 - }; + let index = if let Some(last_key) = cursor { + last_key.saturating_add(1) + } else { + log::info!(target: LOG_TARGET, "Starting migration"); + // If no cursor is provided, start iterating from the beginning. + 0 + }; - if index >= M::get() { - v0::LatestExecutionState::::kill(); - v0::ExecutionHeaderIndex::::kill(); - // We are at the end of the migration, signal complete. - cursor = None; - } else { - let execution_hash = v0::ExecutionHeaderMapping::::get(index); - v0::ExecutionHeaders::::delete(execution_hash); - v0::ExecutionHeaderMapping::::delete(index); - cursor = Some(index) - } - } - Ok(cursor) - } + if index >= M::get() { + v0::LatestExecutionState::::kill(); + v0::ExecutionHeaderIndex::::kill(); + // We are at the end of the migration, signal complete. + cursor = None; + log::info!(target: LOG_TARGET, "Ethereum execution header cleanup migration is complete. Index = {}.", index); + break + } else { + let execution_hash = v0::ExecutionHeaderMapping::::get(index); + v0::ExecutionHeaders::::remove(execution_hash); + v0::ExecutionHeaderMapping::::remove(index); + cursor = Some(index); + log::info!(target: LOG_TARGET, "Migration is in progress. Index = {}.", index); + } + } + Ok(cursor) + } } diff --git a/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs b/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs index 0bf81683eaa6..48e269d2bec6 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs @@ -2,26 +2,65 @@ // SPDX-FileCopyrightText: 2023 Snowfork #![cfg(all(test, not(feature = "runtime-benchmarks")))] +use crate::{ + migration::{ + v0::{ + CompactExecutionHeader, ExecutionHeaderIndex, ExecutionHeaderMapping, + ExecutionHeaderState, ExecutionHeaders, LatestExecutionState, + }, + weights::{SubstrateWeight, WeightInfo}, + }, + mock::new_tester, + tests::{ + run_to_block_with_migrator, AllPalletsWithSystem, MigratorServiceWeight, System, Test, + }, +}; use frame_support::traits::OnRuntimeUpgrade; use pallet_migrations::WeightInfo as _; -use crate::mock::new_test_ext; +use snowbridge_ethereum::H256; #[test] fn ethereum_execution_header_migration_works() { - new_test_ext().execute_with(|| { - frame_support::__private::sp_tracing::try_init_simple(); - // Insert some values into the old storage items. + new_tester().execute_with(|| { + frame_support::__private::sp_tracing::try_init_simple(); + // Insert some values into the old storage items. + LatestExecutionState::::set(ExecutionHeaderState { + beacon_block_root: H256::random(), + beacon_slot: 5353, + block_hash: H256::random(), + block_number: 5454, + }); + ExecutionHeaderIndex::::set(5500); + for index in 0..10 { + let block_root = H256::random(); + ExecutionHeaders::::insert( + block_root, + CompactExecutionHeader { + parent_hash: H256::random(), + block_number: index, + state_root: H256::random(), + receipts_root: H256::random(), + }, + ); + ExecutionHeaderMapping::::insert(index as u32, block_root); + println!("block: {}", block_root); + } - // Give it enough weight to do exactly 16 iterations: - let limit = ::WeightInfo::progress_mbms_none() + - pallet_migrations::Pallet::::exec_migration_max_weight() + - weights::SubstrateWeight::::step() * 16; - MigratorServiceWeight::set(&limit); + // Give it enough weight to do exactly 16 iterations: + let limit = ::WeightInfo::progress_mbms_none() + + pallet_migrations::Pallet::::exec_migration_max_weight() + + SubstrateWeight::::step() * 16; + MigratorServiceWeight::set(&limit); - System::set_block_number(1); - AllPalletsWithSystem::on_runtime_upgrade(); // onboard MBMs + System::set_block_number(1); + AllPalletsWithSystem::on_runtime_upgrade(); // onboard MBMs - // Check everything is empty - }); + // Check everything is empty + for index in 0..10 { + run_to_block_with_migrator(index + 2); + let value = ExecutionHeaderMapping::::get(index as u32); + assert_eq!(value, H256::zero()) + } + }); } diff --git a/bridges/snowbridge/pallets/ethereum-client/src/mock.rs b/bridges/snowbridge/pallets/ethereum-client/src/mock.rs index bd6144ebd8f9..58b5d5d08945 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/mock.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/mock.rs @@ -2,14 +2,19 @@ // SPDX-FileCopyrightText: 2023 Snowfork use crate as ethereum_beacon_client; use crate::config; -use frame_support::{derive_impl, dispatch::DispatchResult, parameter_types}; -use pallet_timestamp; +use frame_support::{ + derive_impl, dispatch::DispatchResult, pallet_prelude::Weight, parameter_types, +}; use primitives::{Fork, ForkVersions}; use snowbridge_core::inbound::{Log, Proof}; use sp_std::default::Default; use std::{fs::File, path::PathBuf}; type Block = frame_system::mocking::MockBlock; +use frame_support::{ + migrations::MultiStepMigrator, + traits::{OnFinalize, OnInitialize}, +}; use sp_runtime::BuildStorage; fn load_fixture(basename: String) -> Result @@ -57,22 +62,16 @@ pub fn get_message_verification_payload() -> (Log, Proof) { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Storage, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - EthereumBeaconClient: ethereum_beacon_client::{Pallet, Call, Storage, Event}, + System: frame_system, + EthereumBeaconClient: crate, + Migrator: pallet_migrations, } ); #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type Block = Block; -} - -impl pallet_timestamp::Config for Test { - type Moment = u64; - type OnTimestampSet = (); - type MinimumPeriod = (); - type WeightInfo = (); + type MultiBlockMigrator = Migrator; } parameter_types! { @@ -106,6 +105,26 @@ impl ethereum_beacon_client::Config for Test { type WeightInfo = (); } +parameter_types! { + pub const ExecutionHeaderCount: u32 = 10; + pub storage MigratorServiceWeight: Weight = Weight::from_parts(100, 100); +} + +#[derive_impl(pallet_migrations::config_preludes::TestDefaultConfig)] +impl pallet_migrations::Config for Test { + #[cfg(not(feature = "runtime-benchmarks"))] + type Migrations = ( + crate::migration::EthereumExecutionHeaderCleanup< + Test, + crate::migration::weights::SubstrateWeight, + ExecutionHeaderCount, + >, + ); + #[cfg(feature = "runtime-benchmarks")] + type Migrations = pallet_migrations::mock_helpers::MockedMigrations; + type MaxServiceWeight = MigratorServiceWeight; +} + // Build genesis storage according to the mock runtime. pub fn new_tester() -> sp_io::TestExternalities { let t = frame_system::GenesisConfig::::default().build_storage().unwrap(); @@ -120,3 +139,15 @@ pub fn initialize_storage() -> DispatchResult { inbound_fixture.block_roots_root, ) } + +pub fn run_to_block_with_migrator(n: u64) { + assert!(System::block_number() < n); + while System::block_number() < n { + let b = System::block_number(); + AllPalletsWithSystem::on_finalize(b); + // Done by Executive: + ::MultiBlockMigrator::step(); + System::set_block_number(b + 1); + AllPalletsWithSystem::on_initialize(b + 1); + } +} From f3e569b72549196a83c90fca0b07ae1bdb1c6df0 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Tue, 4 Jun 2024 17:08:14 +0200 Subject: [PATCH 05/16] more test refining --- .../ethereum-client/src/migration/mod.rs | 4 ++-- .../ethereum-client/src/migration/test.rs | 20 +++++++++++++------ .../pallets/ethereum-client/src/mock.rs | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs b/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs index ec5c78f85bd0..d2c5856fb565 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs @@ -6,7 +6,6 @@ use frame_support::{ pallet_prelude::PhantomData, weights::WeightMeter, }; -use scale_info::TypeInfo; use sp_core::Get; mod test; @@ -40,7 +39,7 @@ mod v0 { pub type ExecutionHeaderMapping = StorageMap, Identity, u32, H256, ValueQuery>; - #[derive(Copy, Clone, Default, Encode, Decode, TypeInfo, MaxEncodedLen)] + #[derive(Copy, Clone, Default, Encode, Decode, Debug, TypeInfo, MaxEncodedLen, PartialEq)] pub struct ExecutionHeaderState { pub beacon_block_root: H256, pub beacon_slot: u64, @@ -84,6 +83,7 @@ impl> SteppedMigration mut cursor: Option, meter: &mut WeightMeter, ) -> Result, SteppedMigrationError> { + log::info!(target: LOG_TARGET, "Starting stepped migration iteration."); let required = W::step(); // If there is not enough weight for a single step, return an error. This case can be // problematic if it is the first migration that ran in this block. But there is nothing diff --git a/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs b/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs index 48e269d2bec6..fe085faf1eba 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs @@ -12,7 +12,8 @@ use crate::{ }, mock::new_tester, tests::{ - run_to_block_with_migrator, AllPalletsWithSystem, MigratorServiceWeight, System, Test, + run_to_block_with_migrator, AllPalletsWithSystem, ExecutionHeaderCount, + MigratorServiceWeight, System, Test, }, }; use frame_support::traits::OnRuntimeUpgrade; @@ -32,7 +33,10 @@ fn ethereum_execution_header_migration_works() { }); ExecutionHeaderIndex::::set(5500); - for index in 0..10 { + let execution_header_count = 5500; + + let mut block_roots: Vec = vec![]; + for index in 0..execution_header_count { let block_root = H256::random(); ExecutionHeaders::::insert( block_root, @@ -44,7 +48,7 @@ fn ethereum_execution_header_migration_works() { }, ); ExecutionHeaderMapping::::insert(index as u32, block_root); - println!("block: {}", block_root); + block_roots.push(block_root); } // Give it enough weight to do exactly 16 iterations: @@ -52,15 +56,19 @@ fn ethereum_execution_header_migration_works() { pallet_migrations::Pallet::::exec_migration_max_weight() + SubstrateWeight::::step() * 16; MigratorServiceWeight::set(&limit); + ExecutionHeaderCount::set(&(execution_header_count as u32)); System::set_block_number(1); AllPalletsWithSystem::on_runtime_upgrade(); // onboard MBMs // Check everything is empty - for index in 0..10 { + for index in 0..execution_header_count { run_to_block_with_migrator(index + 2); - let value = ExecutionHeaderMapping::::get(index as u32); - assert_eq!(value, H256::zero()) + let block_root_hash = block_roots.get(index as usize).unwrap(); + assert_eq!(ExecutionHeaderMapping::::get(index as u32), H256::zero()); + assert!(ExecutionHeaders::::get(block_root_hash).is_none()); } + assert_eq!(LatestExecutionState::::get(), ExecutionHeaderState::default()); + assert_eq!(ExecutionHeaderIndex::::get(), 0); }); } diff --git a/bridges/snowbridge/pallets/ethereum-client/src/mock.rs b/bridges/snowbridge/pallets/ethereum-client/src/mock.rs index 58b5d5d08945..36ce1dda7bae 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/mock.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/mock.rs @@ -106,7 +106,7 @@ impl ethereum_beacon_client::Config for Test { } parameter_types! { - pub const ExecutionHeaderCount: u32 = 10; + pub storage ExecutionHeaderCount: u32 = 100; pub storage MigratorServiceWeight: Weight = Weight::from_parts(100, 100); } From 0ef0d5b0228ddb34151f5a0485a405cf5c5b8886 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 6 Jun 2024 10:53:29 +0200 Subject: [PATCH 06/16] finish off feature --- Cargo.lock | 2 +- .../ethereum-client/src/benchmarking/mod.rs | 68 +++++++- .../ethereum-client/src/migration/mod.rs | 18 +- .../ethereum-client/src/migration/test.rs | 20 +-- .../ethereum-client/src/migration/weights.rs | 53 ------ .../pallets/ethereum-client/src/mock.rs | 9 +- .../pallets/ethereum-client/src/weights.rs | 8 + .../bridge-hub-rococo/src/tests/snowbridge.rs | 3 +- .../src/bridge_to_ethereum_config.rs | 29 ++-- .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 8 +- .../snowbridge_pallet_ethereum_client.rs | 155 +++++++++--------- 11 files changed, 189 insertions(+), 184 deletions(-) delete mode 100644 bridges/snowbridge/pallets/ethereum-client/src/migration/weights.rs diff --git a/Cargo.lock b/Cargo.lock index 7cc50ab53d12..4df619131383 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19117,7 +19117,7 @@ dependencies = [ "frame-system", "hex-literal", "log", - "pallet-timestamp", + "pallet-migrations", "parity-scale-codec", "rand 0.8.5", "scale-info", diff --git a/bridges/snowbridge/pallets/ethereum-client/src/benchmarking/mod.rs b/bridges/snowbridge/pallets/ethereum-client/src/benchmarking/mod.rs index 4b8796b628d7..36073b560e64 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/benchmarking/mod.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/benchmarking/mod.rs @@ -3,9 +3,20 @@ use super::*; mod util; -use crate::Pallet as EthereumBeaconClient; +use crate::{ + migration::{ + v0::{ + CompactExecutionHeader, ExecutionHeaderIndex, ExecutionHeaderMapping, + ExecutionHeaderState, ExecutionHeaders, LatestExecutionState, + }, + EthereumExecutionHeaderCleanup, + }, + Pallet as EthereumBeaconClient, +}; use frame_benchmarking::v2::*; +use frame_support::{migrations::SteppedMigration, weights::WeightMeter}; use frame_system::RawOrigin; +use hex_literal::hex; use snowbridge_pallet_ethereum_client_fixtures::*; @@ -125,5 +136,60 @@ mod benchmarks { Ok(()) } + use frame_support::parameter_types; + + parameter_types! { + pub ExecutionHeaderCount: u32 = 1; + } + + #[benchmark] + fn step() { + let block_root: H256 = + hex!("4e4ed8c829bf771f94c60caa052dc3b703b24165a2e6459350e3a43a80ab7a8f").into(); + ExecutionHeaders::::insert( + block_root, + CompactExecutionHeader { + parent_hash: hex!( + "e0a5ca63886dfa16d53347ba347289e0187f7c38320768d094fc48d331ac7a23" + ) + .into(), + block_number: 48242, + state_root: hex!( + "b3f33b6950fd047b634dcea0d09f002f07431d3e6648213604e54caa822055a6" + ) + .into(), + receipts_root: hex!( + "f744e1ebe846b2961a7daa3c0d9023d8b109cf9e425b9e9973f039180e487b67" + ) + .into(), + }, + ); + ExecutionHeaderMapping::::insert(0u32, block_root); + LatestExecutionState::::set(ExecutionHeaderState { + beacon_block_root: hex!( + "b3f33b6950fd047b634dcea0d09f002f07431d3e6648213604e54caa822055a6" + ) + .into(), + beacon_slot: 5353, + block_hash: hex!("e0a5ca63886dfa16d53347ba347289e0187f7c38320768d094fc48d331ac7a23") + .into(), + block_number: 5454, + }); + ExecutionHeaderIndex::::set(0); + let mut meter = WeightMeter::new(); + + #[block] + { + EthereumExecutionHeaderCleanup::::step(None, &mut meter) + .unwrap(); + } + + // Check that the header is removed + assert_eq!(ExecutionHeaderMapping::::get(0u32), H256::zero()); + assert!(ExecutionHeaders::::get(block_root).is_none()); + assert!(LatestExecutionState::::get().beacon_block_root == H256::zero()); + assert!(ExecutionHeaderIndex::::get() == 0); + } + impl_benchmark_test_suite!(EthereumBeaconClient, crate::mock::new_tester(), crate::mock::Test); } diff --git a/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs b/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs index d2c5856fb565..63b8e9a005b5 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2023 Snowfork -use crate::pallet::Config; +use crate::{pallet::Config, WeightInfo}; use frame_support::{ migrations::{MigrationId, SteppedMigration, SteppedMigrationError}, pallet_prelude::PhantomData, @@ -9,15 +9,13 @@ use frame_support::{ use sp_core::Get; mod test; -pub mod weights; pub const PALLET_MIGRATIONS_ID: &[u8; 26] = b"ethereum-execution-headers"; pub const LOG_TARGET: &str = "ethereum-client-migration"; /// Module containing the old Ethereum execution headers that should be cleaned up. -mod v0 { - use super::Config; - use crate::pallet::Pallet; +pub mod v0 { + use crate::pallet::{Config, Pallet}; use frame_support::{ pallet_prelude::{Decode, Encode, MaxEncodedLen, OptionQuery, TypeInfo, ValueQuery}, storage_alias, CloneNoBound, Identity, PartialEqNoBound, RuntimeDebugNoBound, @@ -25,7 +23,7 @@ mod v0 { use sp_core::H256; #[storage_alias] - pub(super) type LatestExecutionState = + pub type LatestExecutionState = StorageValue, ExecutionHeaderState, ValueQuery>; #[storage_alias] @@ -66,10 +64,10 @@ mod v0 { } } -pub struct EthereumExecutionHeaderCleanup>( +pub struct EthereumExecutionHeaderCleanup>( PhantomData<(T, W, M)>, ); -impl> SteppedMigration +impl> SteppedMigration for EthereumExecutionHeaderCleanup { type Cursor = u32; @@ -83,7 +81,7 @@ impl> SteppedMigration mut cursor: Option, meter: &mut WeightMeter, ) -> Result, SteppedMigrationError> { - log::info!(target: LOG_TARGET, "Starting stepped migration iteration."); + log::info!(target: LOG_TARGET, "Starting step iteration for Ethereum execution header cleanup."); let required = W::step(); // If there is not enough weight for a single step, return an error. This case can be // problematic if it is the first migration that ran in this block. But there is nothing @@ -101,7 +99,7 @@ impl> SteppedMigration let index = if let Some(last_key) = cursor { last_key.saturating_add(1) } else { - log::info!(target: LOG_TARGET, "Starting migration"); + log::info!(target: LOG_TARGET, "Cursor is 0, starting migration."); // If no cursor is provided, start iterating from the beginning. 0 }; diff --git a/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs b/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs index fe085faf1eba..b5975caa3d47 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/migration/test.rs @@ -3,18 +3,16 @@ #![cfg(all(test, not(feature = "runtime-benchmarks")))] use crate::{ - migration::{ - v0::{ - CompactExecutionHeader, ExecutionHeaderIndex, ExecutionHeaderMapping, - ExecutionHeaderState, ExecutionHeaders, LatestExecutionState, - }, - weights::{SubstrateWeight, WeightInfo}, + migration::v0::{ + CompactExecutionHeader, ExecutionHeaderIndex, ExecutionHeaderMapping, ExecutionHeaderState, + ExecutionHeaders, LatestExecutionState, }, - mock::new_tester, - tests::{ - run_to_block_with_migrator, AllPalletsWithSystem, ExecutionHeaderCount, + mock::{ + new_tester, run_to_block_with_migrator, AllPalletsWithSystem, ExecutionHeaderCount, MigratorServiceWeight, System, Test, }, + pallet, + weights::WeightInfo as _, }; use frame_support::traits::OnRuntimeUpgrade; use pallet_migrations::WeightInfo as _; @@ -51,10 +49,10 @@ fn ethereum_execution_header_migration_works() { block_roots.push(block_root); } - // Give it enough weight to do exactly 16 iterations: + // Give it enough weight to do 16 iterations: let limit = ::WeightInfo::progress_mbms_none() + pallet_migrations::Pallet::::exec_migration_max_weight() + - SubstrateWeight::::step() * 16; + ::WeightInfo::step() * 16; MigratorServiceWeight::set(&limit); ExecutionHeaderCount::set(&(execution_header_count as u32)); diff --git a/bridges/snowbridge/pallets/ethereum-client/src/migration/weights.rs b/bridges/snowbridge/pallets/ethereum-client/src/migration/weights.rs deleted file mode 100644 index 2fb3aeb27077..000000000000 --- a/bridges/snowbridge/pallets/ethereum-client/src/migration/weights.rs +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Autogenerated weights for `pallet_example_mbm` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-03-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `Olivers-MBP`, CPU: `` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; - -/// Weight functions needed for `pallet_example_mbm`. -pub trait WeightInfo { - fn step() -> Weight; -} - -/// Weights for `pallet_example_mbm` using the Substrate node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl WeightInfo for SubstrateWeight { - /// Storage: `PalletExampleMbms::MyMap` (r:2 w:1) - /// Proof: `PalletExampleMbms::MyMap` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - fn step() -> Weight { - // Proof Size summary in bytes: - // Measured: `28` - // Estimated: `5996` - // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(8_000_000, 5996) // TODO update - add weights in rococo runtime - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } -} - -// For backwards compatibility and tests. -impl WeightInfo for () { - /// Storage: `PalletExampleMbms::MyMap` (r:2 w:1) - /// Proof: `PalletExampleMbms::MyMap` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - fn step() -> Weight { - // Proof Size summary in bytes: - // Measured: `28` - // Estimated: `5996` - // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(8_000_000, 5996) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } -} diff --git a/bridges/snowbridge/pallets/ethereum-client/src/mock.rs b/bridges/snowbridge/pallets/ethereum-client/src/mock.rs index 36ce1dda7bae..b29584a0da77 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/mock.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/mock.rs @@ -113,13 +113,8 @@ parameter_types! { #[derive_impl(pallet_migrations::config_preludes::TestDefaultConfig)] impl pallet_migrations::Config for Test { #[cfg(not(feature = "runtime-benchmarks"))] - type Migrations = ( - crate::migration::EthereumExecutionHeaderCleanup< - Test, - crate::migration::weights::SubstrateWeight, - ExecutionHeaderCount, - >, - ); + type Migrations = + (crate::migration::EthereumExecutionHeaderCleanup,); #[cfg(feature = "runtime-benchmarks")] type Migrations = pallet_migrations::mock_helpers::MockedMigrations; type MaxServiceWeight = MigratorServiceWeight; diff --git a/bridges/snowbridge/pallets/ethereum-client/src/weights.rs b/bridges/snowbridge/pallets/ethereum-client/src/weights.rs index e4629746aa2d..783539b0ae97 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/weights.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/weights.rs @@ -36,6 +36,7 @@ pub trait WeightInfo { fn force_checkpoint() -> Weight; fn submit() -> Weight; fn submit_with_sync_committee() -> Weight; + fn step() -> Weight; } // For backwards compatibility and tests @@ -58,4 +59,11 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(6)) .saturating_add(RocksDbWeight::get().writes(1)) } + + fn step() -> Weight { + Weight::from_parts(10_000_000, 0) + .saturating_add(Weight::from_parts(0, 3680)) + .saturating_add(RocksDbWeight::get().reads(1)) + .saturating_add(RocksDbWeight::get().writes(2)) + } } diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs index 8dda50ffe181..85634fd378da 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs @@ -27,7 +27,8 @@ use snowbridge_pallet_inbound_queue_fixtures::{ }; use snowbridge_pallet_system; use snowbridge_router_primitives::inbound::{ - Command, ConvertMessage, Destination, GlobalConsensusEthereumConvertsFor, MessageV1, VersionedMessage, + Command, ConvertMessage, Destination, GlobalConsensusEthereumConvertsFor, MessageV1, + VersionedMessage, }; use sp_core::H256; use sp_runtime::{DispatchError::Token, TokenError::FundsUnavailable}; diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs index dd62f21ebf24..c4e0d436b578 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs @@ -14,27 +14,30 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -use crate::{xcm_config::UniversalLocation, Runtime, RuntimeEvent, Balances, EthereumSystem, - EthereumOutboundQueue, TreasuryAccount, EthereumInboundQueue, MessageQueue, TransactionByteFee, xcm_config, XcmRouter}; -use snowbridge_router_primitives::outbound::EthereumBlobExporter; -use testnet_parachains_constants::rococo::snowbridge::EthereumNetwork; -use snowbridge_beacon_primitives::{Fork, ForkVersions}; -use snowbridge_core::{ - gwei, meth, AllowSiblingsOnly, PricingParameters, Rewards, -}; -use snowbridge_router_primitives::inbound::MessageToXcm; -use testnet_parachains_constants::rococo::snowbridge::INBOUND_QUEUE_PALLET_INDEX; -use testnet_parachains_constants::rococo::{ - currency::*, fee::WeightToFee, +use crate::{ + xcm_config, xcm_config::UniversalLocation, Balances, EthereumInboundQueue, + EthereumOutboundQueue, EthereumSystem, MessageQueue, Runtime, RuntimeEvent, TransactionByteFee, + TreasuryAccount, }; use parachains_common::{AccountId, Balance}; +use snowbridge_beacon_primitives::{Fork, ForkVersions}; +use snowbridge_core::{gwei, meth, AllowSiblingsOnly, PricingParameters, Rewards}; +use snowbridge_router_primitives::{inbound::MessageToXcm, outbound::EthereumBlobExporter}; use sp_core::H160; +use testnet_parachains_constants::rococo::{ + currency::*, + fee::WeightToFee, + snowbridge::{EthereumNetwork, INBOUND_QUEUE_PALLET_INDEX}, +}; -use sp_runtime::{traits::{ConstU32, ConstU8, Keccak256}, FixedU128}; #[cfg(feature = "runtime-benchmarks")] use benchmark_helpers::DoNothingRouter; use frame_support::{parameter_types, weights::ConstantMultiplier}; use pallet_xcm::EnsureXcm; +use sp_runtime::{ + traits::{ConstU32, ConstU8, Keccak256}, + FixedU128, +}; /// Exports message to the Ethereum Gateway contract. pub type SnowbridgeExporter = EthereumBlobExporter< diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 5f35c92e43fa..79a4bc61f2b3 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -46,7 +46,7 @@ use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, - traits::{Block as BlockT}, + traits::Block as BlockT, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; @@ -70,9 +70,7 @@ use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; -use testnet_parachains_constants::rococo::{ - consensus::*, currency::*, fee::WeightToFee, time::*, -}; +use testnet_parachains_constants::rococo::{consensus::*, currency::*, fee::WeightToFee, time::*}; use bp_runtime::HeaderId; use bridge_hub_common::{ @@ -89,11 +87,11 @@ pub use sp_runtime::BuildStorage; use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use rococo_runtime_constants::system_parachain::{ASSET_HUB_ID, BRIDGE_HUB_ID}; -use xcm::latest::prelude::*; use snowbridge_core::{ outbound::{Command, Fee}, AgentId, PricingParameters, }; +use xcm::latest::prelude::*; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs index c8017939b627..2eb1c07c8bdb 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs @@ -1,43 +1,27 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //! Autogenerated weights for `snowbridge_pallet_ethereum_client` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-06-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ip-172-31-8-124`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 +//! HOSTNAME: `Claras-MacBook-Pro-2.local`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024 // Executed Command: // target/release/polkadot-parachain // benchmark // pallet -// --base-path -// /mnt/scratch/benchmark // --chain=bridge-hub-rococo-dev -// --pallet=snowbridge_ethereum_beacon_client -// --extrinsic=* -// --execution=wasm +// --pallet=snowbridge_pallet_ethereum_client +// --extrinsic +// * // --wasm-execution=compiled // --steps // 50 // --repeat // 20 // --output -// ./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs +// cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -50,80 +34,87 @@ use core::marker::PhantomData; /// Weight functions for `snowbridge_pallet_ethereum_client`. pub struct WeightInfo(PhantomData); impl snowbridge_pallet_ethereum_client::WeightInfo for WeightInfo { - /// Storage: EthereumBeaconClient FinalizedBeaconStateIndex (r:1 w:1) - /// Proof: EthereumBeaconClient FinalizedBeaconStateIndex (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient FinalizedBeaconStateMapping (r:1 w:1) - /// Proof: EthereumBeaconClient FinalizedBeaconStateMapping (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient NextSyncCommittee (r:0 w:1) - /// Proof: EthereumBeaconClient NextSyncCommittee (max_values: Some(1), max_size: Some(92372), added: 92867, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient InitialCheckpointRoot (r:0 w:1) - /// Proof: EthereumBeaconClient InitialCheckpointRoot (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient ValidatorsRoot (r:0 w:1) - /// Proof: EthereumBeaconClient ValidatorsRoot (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient LatestFinalizedBlockRoot (r:0 w:1) - /// Proof: EthereumBeaconClient LatestFinalizedBlockRoot (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient CurrentSyncCommittee (r:0 w:1) - /// Proof: EthereumBeaconClient CurrentSyncCommittee (max_values: Some(1), max_size: Some(92372), added: 92867, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient LatestExecutionState (r:0 w:1) - /// Proof: EthereumBeaconClient LatestExecutionState (max_values: Some(1), max_size: Some(80), added: 575, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient FinalizedBeaconState (r:0 w:1) - /// Proof: EthereumBeaconClient FinalizedBeaconState (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) + /// Storage: `EthereumBeaconClient::FinalizedBeaconStateIndex` (r:1 w:1) + /// Proof: `EthereumBeaconClient::FinalizedBeaconStateIndex` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::FinalizedBeaconStateMapping` (r:1 w:1) + /// Proof: `EthereumBeaconClient::FinalizedBeaconStateMapping` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::NextSyncCommittee` (r:0 w:1) + /// Proof: `EthereumBeaconClient::NextSyncCommittee` (`max_values`: Some(1), `max_size`: Some(92372), added: 92867, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::InitialCheckpointRoot` (r:0 w:1) + /// Proof: `EthereumBeaconClient::InitialCheckpointRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::ValidatorsRoot` (r:0 w:1) + /// Proof: `EthereumBeaconClient::ValidatorsRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::LatestFinalizedBlockRoot` (r:0 w:1) + /// Proof: `EthereumBeaconClient::LatestFinalizedBlockRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::CurrentSyncCommittee` (r:0 w:1) + /// Proof: `EthereumBeaconClient::CurrentSyncCommittee` (`max_values`: Some(1), `max_size`: Some(92372), added: 92867, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::FinalizedBeaconState` (r:0 w:1) + /// Proof: `EthereumBeaconClient::FinalizedBeaconState` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) fn force_checkpoint() -> Weight { // Proof Size summary in bytes: - // Measured: `42` + // Measured: `76` // Estimated: `3501` - // Minimum execution time: 97_185_781_000 picoseconds. - Weight::from_parts(97_263_571_000, 0) + // Minimum execution time: 72_635_000_000 picoseconds. + Weight::from_parts(74_575_000_000, 0) .saturating_add(Weight::from_parts(0, 3501)) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(9)) + .saturating_add(T::DbWeight::get().writes(8)) } - /// Storage: EthereumBeaconClient LatestFinalizedBlockRoot (r:1 w:1) - /// Proof: EthereumBeaconClient LatestFinalizedBlockRoot (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient FinalizedBeaconState (r:1 w:1) - /// Proof: EthereumBeaconClient FinalizedBeaconState (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient LatestExecutionState (r:1 w:0) - /// Proof: EthereumBeaconClient LatestExecutionState (max_values: Some(1), max_size: Some(80), added: 575, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient NextSyncCommittee (r:1 w:0) - /// Proof: EthereumBeaconClient NextSyncCommittee (max_values: Some(1), max_size: Some(92372), added: 92867, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient CurrentSyncCommittee (r:1 w:0) - /// Proof: EthereumBeaconClient CurrentSyncCommittee (max_values: Some(1), max_size: Some(92372), added: 92867, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient ValidatorsRoot (r:1 w:0) - /// Proof: EthereumBeaconClient ValidatorsRoot (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient FinalizedBeaconStateIndex (r:1 w:1) - /// Proof: EthereumBeaconClient FinalizedBeaconStateIndex (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient FinalizedBeaconStateMapping (r:1 w:1) - /// Proof: EthereumBeaconClient FinalizedBeaconStateMapping (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) + /// Storage: `EthereumBeaconClient::OperatingMode` (r:1 w:0) + /// Proof: `EthereumBeaconClient::OperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::LatestFinalizedBlockRoot` (r:1 w:0) + /// Proof: `EthereumBeaconClient::LatestFinalizedBlockRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::FinalizedBeaconState` (r:1 w:0) + /// Proof: `EthereumBeaconClient::FinalizedBeaconState` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::NextSyncCommittee` (r:1 w:0) + /// Proof: `EthereumBeaconClient::NextSyncCommittee` (`max_values`: Some(1), `max_size`: Some(92372), added: 92867, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::CurrentSyncCommittee` (r:1 w:0) + /// Proof: `EthereumBeaconClient::CurrentSyncCommittee` (`max_values`: Some(1), `max_size`: Some(92372), added: 92867, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::ValidatorsRoot` (r:1 w:0) + /// Proof: `EthereumBeaconClient::ValidatorsRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) fn submit() -> Weight { // Proof Size summary in bytes: - // Measured: `92753` + // Measured: `92749` // Estimated: `93857` - // Minimum execution time: 25_999_968_000 picoseconds. - Weight::from_parts(26_051_019_000, 0) + // Minimum execution time: 18_487_000_000 picoseconds. + Weight::from_parts(26_424_000_000, 0) .saturating_add(Weight::from_parts(0, 93857)) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().reads(6)) } - /// Storage: EthereumBeaconClient LatestFinalizedBlockRoot (r:1 w:0) - /// Proof: EthereumBeaconClient LatestFinalizedBlockRoot (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient FinalizedBeaconState (r:1 w:0) - /// Proof: EthereumBeaconClient FinalizedBeaconState (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient LatestExecutionState (r:1 w:0) - /// Proof: EthereumBeaconClient LatestExecutionState (max_values: Some(1), max_size: Some(80), added: 575, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient NextSyncCommittee (r:1 w:1) - /// Proof: EthereumBeaconClient NextSyncCommittee (max_values: Some(1), max_size: Some(92372), added: 92867, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient CurrentSyncCommittee (r:1 w:0) - /// Proof: EthereumBeaconClient CurrentSyncCommittee (max_values: Some(1), max_size: Some(92372), added: 92867, mode: MaxEncodedLen) - /// Storage: EthereumBeaconClient ValidatorsRoot (r:1 w:0) - /// Proof: EthereumBeaconClient ValidatorsRoot (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: `EthereumBeaconClient::OperatingMode` (r:1 w:0) + /// Proof: `EthereumBeaconClient::OperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::LatestFinalizedBlockRoot` (r:1 w:0) + /// Proof: `EthereumBeaconClient::LatestFinalizedBlockRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::FinalizedBeaconState` (r:1 w:0) + /// Proof: `EthereumBeaconClient::FinalizedBeaconState` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::NextSyncCommittee` (r:1 w:1) + /// Proof: `EthereumBeaconClient::NextSyncCommittee` (`max_values`: Some(1), `max_size`: Some(92372), added: 92867, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::CurrentSyncCommittee` (r:1 w:0) + /// Proof: `EthereumBeaconClient::CurrentSyncCommittee` (`max_values`: Some(1), `max_size`: Some(92372), added: 92867, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::ValidatorsRoot` (r:1 w:0) + /// Proof: `EthereumBeaconClient::ValidatorsRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) fn submit_with_sync_committee() -> Weight { // Proof Size summary in bytes: - // Measured: `92717` + // Measured: `92749` // Estimated: `93857` - // Minimum execution time: 122_354_917_000 picoseconds. - Weight::from_parts(122_461_312_000, 0) + // Minimum execution time: 91_539_000_000 picoseconds. + Weight::from_parts(96_048_000_000, 0) .saturating_add(Weight::from_parts(0, 93857)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: UNKNOWN KEY `0xada12a87b9ccce83f328569cf9934e83e6d574e897864a327c716c553f277037` (r:1 w:1) + /// Proof: UNKNOWN KEY `0xada12a87b9ccce83f328569cf9934e83e6d574e897864a327c716c553f277037` (r:1 w:1) + /// Storage: UNKNOWN KEY `0xada12a87b9ccce83f328569cf9934e83964405908d330d65518e9e60960ba9f1` (r:0 w:1) + /// Proof: UNKNOWN KEY `0xada12a87b9ccce83f328569cf9934e83964405908d330d65518e9e60960ba9f1` (r:0 w:1) + fn step() -> Weight { + // Proof Size summary in bytes: + // Measured: `215` + // Estimated: `3680` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 0) + .saturating_add(Weight::from_parts(0, 3680)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } } From 4bdd2c629d70bed30875e0820d08ae4a5d33131c Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 6 Jun 2024 13:59:10 +0200 Subject: [PATCH 07/16] fixes --- bridges/snowbridge/pallets/ethereum-client/Cargo.toml | 3 +++ bridges/snowbridge/pallets/ethereum-client/src/lib.rs | 2 +- .../runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bridges/snowbridge/pallets/ethereum-client/Cargo.toml b/bridges/snowbridge/pallets/ethereum-client/Cargo.toml index 3b5150a7a0c3..8a5ae18e1c21 100644 --- a/bridges/snowbridge/pallets/ethereum-client/Cargo.toml +++ b/bridges/snowbridge/pallets/ethereum-client/Cargo.toml @@ -59,6 +59,7 @@ std = [ "frame-support/std", "frame-system/std", "log/std", + "pallet-migrations/std", "primitives/std", "scale-info/std", "serde", @@ -76,6 +77,7 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "hex-literal", + "pallet-migrations/runtime-benchmarks", "snowbridge-core/runtime-benchmarks", "snowbridge-pallet-ethereum-client-fixtures/runtime-benchmarks", "sp-runtime/runtime-benchmarks", @@ -83,5 +85,6 @@ runtime-benchmarks = [ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", + "pallet-migrations/try-runtime", "sp-runtime/try-runtime", ] diff --git a/bridges/snowbridge/pallets/ethereum-client/src/lib.rs b/bridges/snowbridge/pallets/ethereum-client/src/lib.rs index 02109558e283..259b2e87ac40 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/lib.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/lib.rs @@ -22,6 +22,7 @@ pub mod functions; pub mod impls; pub mod types; pub mod weights; +pub mod migration; #[cfg(any(test, feature = "fuzzing"))] pub mod mock; @@ -31,7 +32,6 @@ mod tests; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; -mod migration; use frame_support::{ dispatch::DispatchResult, pallet_prelude::OptionQuery, traits::Get, transactional, diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 79a4bc61f2b3..8e695cddcd0b 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -504,11 +504,16 @@ impl pallet_utility::Config for Runtime { parameter_types! { pub MbmServiceWeight: Weight = Perbill::from_percent(80) * RuntimeBlockWeights::get().max_block; + pub const ExecutionHeaderCount: u32 = 8192 * 20; } impl pallet_migrations::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type Migrations = (); + #[cfg(not(feature = "runtime-benchmarks"))] + type Migrations = + snowbridge_pallet_ethereum_client::migration::EthereumExecutionHeaderCleanup, ExecutionHeaderCount>; + #[cfg(feature = "runtime-benchmarks")] + type Migrations = pallet_migrations::mock_helpers::MockedMigrations; type CursorMaxLen = ConstU32<65_536>; type IdentifierMaxLen = ConstU32<256>; type MigrationStatusHandler = (); From eb020051f305aed6c1d32499a06cf29493b85e19 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 6 Jun 2024 14:36:18 +0200 Subject: [PATCH 08/16] fmt --- bridges/snowbridge/pallets/ethereum-client/src/lib.rs | 2 +- .../runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bridges/snowbridge/pallets/ethereum-client/src/lib.rs b/bridges/snowbridge/pallets/ethereum-client/src/lib.rs index 259b2e87ac40..367eadc50aaa 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/lib.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/lib.rs @@ -20,9 +20,9 @@ pub mod config; pub mod functions; pub mod impls; +pub mod migration; pub mod types; pub mod weights; -pub mod migration; #[cfg(any(test, feature = "fuzzing"))] pub mod mock; diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 8e695cddcd0b..ad3055f026a7 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -510,8 +510,11 @@ parameter_types! { impl pallet_migrations::Config for Runtime { type RuntimeEvent = RuntimeEvent; #[cfg(not(feature = "runtime-benchmarks"))] - type Migrations = - snowbridge_pallet_ethereum_client::migration::EthereumExecutionHeaderCleanup, ExecutionHeaderCount>; + type Migrations = snowbridge_pallet_ethereum_client::migration::EthereumExecutionHeaderCleanup< + Runtime, + crate::weights::snowbridge_pallet_ethereum_client::WeightInfo, + ExecutionHeaderCount, + >; #[cfg(feature = "runtime-benchmarks")] type Migrations = pallet_migrations::mock_helpers::MockedMigrations; type CursorMaxLen = ConstU32<65_536>; From 30c6b5a2a1caa4061aded64ce46c77e52c33dd0b Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 6 Jun 2024 14:41:57 +0200 Subject: [PATCH 09/16] fix missing feature --- .../bridge-hub-rococo/src/bridge_to_ethereum_config.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs index c4e0d436b578..53a536655408 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . +#[cfg(not(feature = "runtime-benchmarks"))] +use crate::XcmRouter; use crate::{ xcm_config, xcm_config::UniversalLocation, Balances, EthereumInboundQueue, EthereumOutboundQueue, EthereumSystem, MessageQueue, Runtime, RuntimeEvent, TransactionByteFee, From 07db5baf48cef69e49a0b5dc60cd0a889fa79596 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 6 Jun 2024 15:03:53 +0200 Subject: [PATCH 10/16] zepter --- .../runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index 4cc57af3d112..e072c36c1d12 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -222,6 +222,7 @@ std = [ "xcm-builder/std", "xcm-executor/std", "xcm/std", + "pallet-migrations/std" ] runtime-benchmarks = [ @@ -263,6 +264,7 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", + "pallet-migrations/runtime-benchmarks" ] try-runtime = [ @@ -297,6 +299,7 @@ try-runtime = [ "snowbridge-pallet-outbound-queue/try-runtime", "snowbridge-pallet-system/try-runtime", "sp-runtime/try-runtime", + "pallet-migrations/try-runtime" ] fast-runtime = [] From a76f6e0b32d72d2af34bd0916556bd3c926ea80d Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 6 Jun 2024 15:28:09 +0200 Subject: [PATCH 11/16] taplo --- .../runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index e072c36c1d12..436f3ca0228e 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -176,6 +176,7 @@ std = [ "pallet-bridge-relayers/std", "pallet-collator-selection/std", "pallet-message-queue/std", + "pallet-migrations/std", "pallet-multisig/std", "pallet-session/std", "pallet-timestamp/std", @@ -222,7 +223,6 @@ std = [ "xcm-builder/std", "xcm-executor/std", "xcm/std", - "pallet-migrations/std" ] runtime-benchmarks = [ @@ -244,6 +244,7 @@ runtime-benchmarks = [ "pallet-bridge-relayers/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", "pallet-message-queue/runtime-benchmarks", + "pallet-migrations/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-utility/runtime-benchmarks", @@ -264,7 +265,6 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", - "pallet-migrations/runtime-benchmarks" ] try-runtime = [ @@ -285,6 +285,7 @@ try-runtime = [ "pallet-bridge-relayers/try-runtime", "pallet-collator-selection/try-runtime", "pallet-message-queue/try-runtime", + "pallet-migrations/try-runtime", "pallet-multisig/try-runtime", "pallet-session/try-runtime", "pallet-timestamp/try-runtime", @@ -299,7 +300,6 @@ try-runtime = [ "snowbridge-pallet-outbound-queue/try-runtime", "snowbridge-pallet-system/try-runtime", "sp-runtime/try-runtime", - "pallet-migrations/try-runtime" ] fast-runtime = [] From a8af2e5f1d14367c231f24d6e3af305ebf3a0e79 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 6 Jun 2024 15:59:54 +0200 Subject: [PATCH 12/16] remove workflow files --- .github/workflows/check-changed-files.yml | 57 ----- .github/workflows/check-runtime-migration.yml | 122 ----------- .github/workflows/check-semver.yml | 56 ----- .github/workflows/checks-quick.yml | 150 ------------- .../workflows/issues-auto-add-parachain.yml | 30 --- .github/workflows/misc-sync-templates.yml | 167 -------------- .../release-30_publish_release_draft.yml | 206 ------------------ .github/workflows/tests-linux-stable.yml | 81 ------- .github/workflows/tests.yml | 98 --------- 9 files changed, 967 deletions(-) delete mode 100644 .github/workflows/check-changed-files.yml delete mode 100644 .github/workflows/check-runtime-migration.yml delete mode 100644 .github/workflows/check-semver.yml delete mode 100644 .github/workflows/checks-quick.yml delete mode 100644 .github/workflows/issues-auto-add-parachain.yml delete mode 100644 .github/workflows/misc-sync-templates.yml delete mode 100644 .github/workflows/release-30_publish_release_draft.yml delete mode 100644 .github/workflows/tests-linux-stable.yml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/check-changed-files.yml b/.github/workflows/check-changed-files.yml deleted file mode 100644 index 657c05cd047d..000000000000 --- a/.github/workflows/check-changed-files.yml +++ /dev/null @@ -1,57 +0,0 @@ -# Reusable workflow to perform checks and generate conditions for other workflows. -# Currently it checks if any Rust (build-related) file is changed -# and if the current (caller) workflow file is changed. -# Example: -# -# jobs: -# changes: -# permissions: -# pull-requests: read -# uses: ./.github/workflows/check-changed-files.yml -# some-job: -# needs: changes -# if: ${{ needs.changes.outputs.rust }} -# ....... - -name: Check changes files - -on: - workflow_call: - # Map the workflow outputs to job outputs - outputs: - rust: - value: ${{ jobs.changes.outputs.rust }} - description: 'true if any of the build-related OR current (caller) workflow files have changed' - current-workflow: - value: ${{ jobs.changes.outputs.current-workflow }} - description: 'true if current (caller) workflow file has changed' - -jobs: - changes: - runs-on: ubuntu-latest - permissions: - pull-requests: read - outputs: - # true if current workflow (caller) file is changed - rust: ${{ steps.filter.outputs.rust == 'true' || steps.filter.outputs.current-workflow == 'true' }} - current-workflow: ${{ steps.filter.outputs.current-workflow }} - steps: - - id: current-file - run: echo "current-workflow-file=$(echo ${{ github.workflow_ref }} | sed -nE "s/.*(\.github\/workflows\/[a-zA-Z0-9_-]*\.y[a]?ml)@refs.*/\1/p")" >> $GITHUB_OUTPUT - - run: echo "${{ steps.current-file.outputs.current-workflow-file }}" - # For pull requests it's not necessary to checkout the code - - id: filter - uses: dorny/paths-filter@v3 - with: - predicate-quantifier: 'every' - # current-workflow - check if the current (caller) workflow file is changed - # rust - check if any Rust (build-related) file is changed - filters: | - current-workflow: - - '${{ steps.current-file.outputs.current-workflow-file }}' - rust: - - '**/*' - - '!.github/**/*' - - '!prdoc/**/*' - - '!docs/**/*' - # \ No newline at end of file diff --git a/.github/workflows/check-runtime-migration.yml b/.github/workflows/check-runtime-migration.yml deleted file mode 100644 index 984e264d0d1d..000000000000 --- a/.github/workflows/check-runtime-migration.yml +++ /dev/null @@ -1,122 +0,0 @@ -name: check-runtime-migration - -on: - push: - branches: - - master - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - merge_group: -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - FORKLIFT_storage_s3_bucketName: ${{ secrets.FORKLIFT_storage_s3_bucketName }} - FORKLIFT_storage_s3_accessKeyId: ${{ secrets.FORKLIFT_storage_s3_accessKeyId }} - FORKLIFT_storage_s3_secretAccessKey: ${{ secrets.FORKLIFT_storage_s3_secretAccessKey }} - FORKLIFT_storage_s3_endpointUrl: ${{ secrets.FORKLIFT_storage_s3_endpointUrl }} - FORKLIFT_metrics_pushEndpoint: ${{ secrets.FORKLIFT_metrics_pushEndpoint }} - -jobs: - set-image: - # GitHub Actions allows using 'env' in a container context. - # However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322 - # This workaround sets the container image for each job using 'set-image' job output. - runs-on: ubuntu-latest - outputs: - IMAGE: ${{ steps.set_image.outputs.IMAGE }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - id: set_image - run: cat .github/env >> $GITHUB_OUTPUT - # rococo and westend are disabled for now (no access to parity-chains.parity.io) - check-runtime-migration: - runs-on: arc-runners-polkadot-sdk-beefy - timeout-minutes: 30 - needs: [set-image] - container: - image: ${{ needs.set-image.outputs.IMAGE }} - strategy: - fail-fast: false - matrix: - network: [ - # westend, - # rococo, - asset-hub-westend, - asset-hub-rococo, - bridge-hub-westend, - bridge-hub-rococo, - contracts-rococo, - collectives-westend, - coretime-rococo, - ] - include: - # - network: westend - # package: westend-runtime - # wasm: westend_runtime.compact.compressed.wasm - # uri: "wss://westend-try-runtime-node.parity-chains.parity.io:443" - # subcommand_extra_args: "--no-weight-warnings" - # command_extra_args: "" - # - network: rococo - # package: rococo-runtime - # wasm: rococo_runtime.compact.compressed.wasm - # uri: "wss://rococo-try-runtime-node.parity-chains.parity.io:443" - # subcommand_extra_args: "--no-weight-warnings" - # command_extra_args: "" - - network: asset-hub-westend - package: asset-hub-westend-runtime - wasm: asset_hub_westend_runtime.compact.compressed.wasm - uri: "wss://westend-asset-hub-rpc.polkadot.io:443" - subcommand_extra_args: "" - command_extra_args: "" - - network: "asset-hub-rococo" - package: "asset-hub-rococo-runtime" - wasm: "asset_hub_rococo_runtime.compact.compressed.wasm" - uri: "wss://rococo-asset-hub-rpc.polkadot.io:443" - subcommand_extra_args: "" - command_extra_args: "" - - network: "bridge-hub-westend" - package: "bridge-hub-westend-runtime" - wasm: "bridge_hub_westend_runtime.compact.compressed.wasm" - uri: "wss://westend-bridge-hub-rpc.polkadot.io:443" - - network: "bridge-hub-rococo" - package: "bridge-hub-rococo-runtime" - wasm: "bridge_hub_rococo_runtime.compact.compressed.wasm" - uri: "wss://rococo-bridge-hub-rpc.polkadot.io:443" - - network: "contracts-rococo" - package: "contracts-rococo-runtime" - wasm: "contracts_rococo_runtime.compact.compressed.wasm" - uri: "wss://rococo-contracts-rpc.polkadot.io:443" - - network: "collectives-westend" - package: "collectives-westend-runtime" - wasm: "collectives_westend_runtime.compact.compressed.wasm" - uri: "wss://westend-collectives-rpc.polkadot.io:443" - command_extra_args: "--disable-spec-name-check" - - network: "coretime-rococo" - package: "coretime-rococo-runtime" - wasm: "coretime_rococo_runtime.compact.compressed.wasm" - uri: "wss://rococo-coretime-rpc.polkadot.io:443" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: script - run: | - echo "Running ${{ matrix.network }} runtime migration check" - export RUST_LOG=remote-ext=debug,runtime=debug - - echo "---------- Downloading try-runtime CLI ----------" - curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.5.4/try-runtime-x86_64-unknown-linux-musl -o try-runtime - chmod +x ./try-runtime - echo "Using try-runtime-cli version:" - ./try-runtime --version - - echo "---------- Building ${{ matrix.package }} runtime ----------" - time forklift cargo build --release --locked -p ${{ matrix.package }} --features try-runtime - - echo "---------- Executing on-runtime-upgrade for ${{ matrix.network }} ----------" - time ./try-runtime ${{ matrix.command_extra_args }} \ - --runtime ./target/release/wbuild/${{ matrix.package }}/${{ matrix.wasm }} \ - on-runtime-upgrade --disable-spec-version-check --checks=all ${{ matrix.subcommand_extra_args }} live --uri ${{ matrix.uri }} - sleep 5 diff --git a/.github/workflows/check-semver.yml b/.github/workflows/check-semver.yml deleted file mode 100644 index 04c63f4192b2..000000000000 --- a/.github/workflows/check-semver.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Check semver - -on: - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - paths: - - prdoc/*.prdoc - -jobs: - check-semver: - runs-on: ubuntu-latest - container: - image: docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v20240408 - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Rust Cache - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - with: - cache-on-failure: true - - - name: Rust compilation prerequisites - run: | - rustup default nightly-2024-03-01 - rustup target add wasm32-unknown-unknown --toolchain nightly-2024-03-01 - rustup component add rust-src --toolchain nightly-2024-03-01 - - - name: install parity-publish - run: cargo install parity-publish@0.5.1 - - - name: extra git setup - run: | - git config --global --add safe.directory '*' - git fetch --no-tags --no-recurse-submodules --depth=1 origin master - git branch old origin/master - - - name: check semver - run: | - export CARGO_TARGET_DIR=target - export RUSTFLAGS='-A warnings -A missing_docs' - export SKIP_WASM_BUILD=1 - if ! parity-publish --color always prdoc --since old --validate prdoc/pr_$PR.prdoc --toolchain nightly-2024-03-01 -v; then - cat <> $GITHUB_OUTPUT - fmt: - runs-on: ubuntu-latest - timeout-minutes: 10 - needs: [set-image] - container: - image: ${{ needs.set-image.outputs.IMAGE }} - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Cargo fmt - run: cargo +nightly fmt --all -- --check - check-dependency-rules: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: check dependency rules - run: | - cd substrate/ - ../.gitlab/ensure-deps.sh - check-rust-feature-propagation: - runs-on: ubuntu-latest - timeout-minutes: 10 - needs: [set-image] - container: - image: ${{ needs.set-image.outputs.IMAGE }} - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: run zepter - run: zepter run check - test-rust-features: - runs-on: ubuntu-latest - timeout-minutes: 10 - needs: [set-image] - container: - image: ${{ needs.set-image.outputs.IMAGE }} - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: run rust features - run: bash .gitlab/rust-features.sh . - check-toml-format: - runs-on: ubuntu-latest - timeout-minutes: 10 - needs: [set-image] - container: - image: ${{ needs.set-image.outputs.IMAGE }} - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: check toml format - run: | - taplo format --check --config .config/taplo.toml - echo "Please run `taplo format --config .config/taplo.toml` to fix any toml formatting issues" - check-workspace: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.0 (22. Sep 2023) - - name: install python deps - run: | - sudo apt-get update && sudo apt-get install -y python3-pip python3 - pip3 install toml "cargo-workspace>=1.2.6" - - name: check integrity - run: > - python3 .github/scripts/check-workspace.py . - --exclude - "substrate/frame/contracts/fixtures/build" - "substrate/frame/contracts/fixtures/contracts/common" - - name: deny git deps - run: python3 .github/scripts/deny-git-deps.py . - check-markdown: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Setup Node.js - uses: actions/setup-node@v4.0.1 - with: - node-version: "18.x" - registry-url: "https://npm.pkg.github.com" - scope: "@paritytech" - - name: Install tooling - run: | - npm install -g markdownlint-cli - markdownlint --version - - name: Check Markdown - env: - CONFIG: .github/.markdownlint.yaml - run: | - echo "Checking markdown formatting. More info: docs/contributor/markdown_linting.md" - markdownlint --config "$CONFIG" --ignore target . - check-umbrella: - runs-on: arc-runners-polkadot-sdk - timeout-minutes: 10 - needs: [set-image] - container: - image: ${{ needs.set-image.outputs.IMAGE }} - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.0 (22. Sep 2023) - - name: install python deps - run: | - sudo apt-get update && sudo apt-get install -y python3-pip python3 - pip3 install "cargo-workspace>=1.2.4" toml - - name: check umbrella correctness - run: | - python3 scripts/generate-umbrella.py --sdk . --version 0.1.0 - cargo +nightly fmt --all - if [ -n "$(git status --porcelain)" ]; then - cat < Cargo.toml - [workspace.package] - license = "MIT-0" - authors = ["Parity Technologies "] - homepage = "https://substrate.io" - - [workspace] - members = [ - "node", - "pallets/template", - "runtime", - ] - resolver = "2" - EOF - shell: bash - working-directory: polkadot-sdk/templates/${{ matrix.template }}/ - - name: Update workspace configuration - run: | - set -euo pipefail - # toml-cli has no overwrite functionality yet, so we use temporary files. - # We cannot pipe the output straight to the same file while the CLI still reads and processes it. - - toml set templates/${{ matrix.template }}/Cargo.toml 'workspace.package.repository' "https://github.com/paritytech/polkadot-sdk-${{ matrix.template }}-template.git" > Cargo.temp - mv Cargo.temp ./templates/${{ matrix.template }}/Cargo.toml - - toml set templates/${{ matrix.template }}/Cargo.toml 'workspace.package.edition' "$(toml get --raw Cargo.toml 'workspace.package.edition')" > Cargo.temp - mv Cargo.temp ./templates/${{ matrix.template }}/Cargo.toml - working-directory: polkadot-sdk - - name: Print the result Cargo.tomls for debugging - if: runner.debug == '1' - run: find . -type f -name 'Cargo.toml' -exec cat {} \; - working-directory: polkadot-sdk/templates/${{ matrix.template }}/ - - - name: Clean the destination repository - run: rm -rf ./* - working-directory: "${{ env.template-path }}" - - name: Copy over the new changes - run: | - cp -r polkadot-sdk/templates/${{ matrix.template }}/* "${{ env.template-path }}/" - - name: Copy over required workspace dependencies - run: | - echo -e "\n[workspace.dependencies]" >> Cargo.toml - set +e - # If a workspace dependency is required.. - while cargo tree --depth 1 --prefix none --no-dedupe 2>&1 | grep 'was not found in `workspace.dependencies`'; do - # Get its name.. - missing_dep=$(cargo tree --depth 1 --prefix none --no-dedupe 2>&1 | grep 'was not found in `workspace.dependencies`' | sed -E 's/(.*)`dependency.(.*)` was not found in `workspace.dependencies`/\2/') - # And copy the dependency from the monorepo. - toml get ../polkadot-sdk/Cargo.toml 'workspace.dependencies' --output-toml | grep "^${missing_dep} = " >> Cargo.toml - done; - working-directory: "${{ env.template-path }}" - - # 3. Verify the build. Push the changes or create a PR. - - # We've run into out-of-disk error when compiling in the next step, so we free up some space this way. - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # 1.3.1 - with: - android: true # This alone is a 12 GB save. - # We disable the rest because it caused some problems. (they're enabled by default) - # The Android removal is enough. - dotnet: false - haskell: false - large-packages: false - swap-storage: false - - - name: Check if it compiles - id: check-compilation - run: cargo check && cargo test - working-directory: "${{ env.template-path }}" - timeout-minutes: 90 - - name: Create PR on failure - if: failure() && steps.check-compilation.outcome == 'failure' - uses: peter-evans/create-pull-request@5b4a9f6a9e2af26e5f02351490b90d01eb8ec1e5 # v5 - with: - path: "${{ env.template-path }}" - token: ${{ steps.app_token.outputs.token }} - add-paths: | - ./* - title: "[Don't merge] Update the ${{ matrix.template }} template to ${{ github.event.inputs.crate_release_version }}" - body: "The template has NOT been successfully built and needs to be inspected." - branch: "update-template/${{ github.event.inputs.crate_release_version }}" - - name: Push changes - run: | - git add -A . - git commit --allow-empty -m "Update to ${{ github.event.inputs.crate_release_version }} triggered by ${{ github.event_name }}" - git push - working-directory: "${{ env.template-path }}" diff --git a/.github/workflows/release-30_publish_release_draft.yml b/.github/workflows/release-30_publish_release_draft.yml deleted file mode 100644 index f39eb4c1716e..000000000000 --- a/.github/workflows/release-30_publish_release_draft.yml +++ /dev/null @@ -1,206 +0,0 @@ -name: Release - Publish draft - -on: - push: - tags: - # Catches v1.2.3 and v1.2.3-rc1 - - v[0-9]+.[0-9]+.[0-9]+* - - workflow_dispatch: - inputs: - version: - description: Current release/rc version - -jobs: - get-rust-versions: - runs-on: ubuntu-latest - outputs: - rustc-stable: ${{ steps.get-rust-versions.outputs.stable }} - steps: - - id: get-rust-versions - run: | - RUST_STABLE_VERSION=$(curl -sS https://raw.githubusercontent.com/paritytech/scripts/master/dockerfiles/ci-unified/Dockerfile | grep -oP 'ARG RUST_STABLE_VERSION=\K[^ ]+') - echo "stable=$RUST_STABLE_VERSION" >> $GITHUB_OUTPUT - - build-runtimes: - uses: "./.github/workflows/release-srtool.yml" - with: - excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template" - - build-binaries: - runs-on: ubuntu-latest - strategy: - matrix: - binary: [ frame-omni-bencher, chain-spec-builder ] - steps: - - name: Checkout sources - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - - name: Install protobuf-compiler - run: | - sudo apt update - sudo apt install -y protobuf-compiler - - - name: Build ${{ matrix.binary }} binary - run: | - if [[ ${{ matrix.binary }} =~ chain-spec-builder ]]; then - cargo build --locked --profile=production -p staging-${{ matrix.binary }} --bin ${{ matrix.binary }} - target/production/${{ matrix.binary }} -h - else - cargo build --locked --profile=production -p ${{ matrix.binary }} - target/production/${{ matrix.binary }} --version - fi - - - name: Upload ${{ matrix.binary }} binary - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - name: ${{ matrix.binary }} - path: target/production/${{ matrix.binary }} - - - publish-release-draft: - runs-on: ubuntu-latest - needs: [ get-rust-versions, build-runtimes ] - outputs: - release_url: ${{ steps.create-release.outputs.html_url }} - asset_upload_url: ${{ steps.create-release.outputs.upload_url }} - steps: - - name: Checkout - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - - name: Download artifacts - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - - - name: Prepare tooling - run: | - URL=https://github.com/chevdor/tera-cli/releases/download/v0.2.4/tera-cli_linux_amd64.deb - wget $URL -O tera.deb - sudo dpkg -i tera.deb - - - name: Prepare draft - id: draft - env: - RUSTC_STABLE: ${{ needs.get-rust-versions.outputs.rustc-stable }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ASSET_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/asset-hub-rococo-runtime/asset-hub-rococo-srtool-digest.json - ASSET_HUB_WESTEND_DIGEST: ${{ github.workspace}}/asset-hub-westend-runtime/asset-hub-westend-srtool-digest.json - BRIDGE_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/bridge-hub-rococo-runtime/bridge-hub-rococo-srtool-digest.json - BRIDGE_HUB_WESTEND_DIGEST: ${{ github.workspace}}/bridge-hub-westend-runtime/bridge-hub-westend-srtool-digest.json - COLLECTIVES_WESTEND_DIGEST: ${{ github.workspace}}/collectives-westend-runtime/collectives-westend-srtool-digest.json - CONTRACTS_ROCOCO_DIGEST: ${{ github.workspace}}/contracts-rococo-runtime/contracts-rococo-srtool-digest.json - CORETIME_ROCOCO_DIGEST: ${{ github.workspace}}/coretime-rococo-runtime/coretime-rococo-srtool-digest.json - CORETIME_WESTEND_DIGEST: ${{ github.workspace}}/coretime-westend-runtime/coretime-westend-srtool-digest.json - GLUTTON_WESTEND_DIGEST: ${{ github.workspace}}/glutton-westend-runtime/glutton-westend-srtool-digest.json - PEOPLE_ROCOCO_DIGEST: ${{ github.workspace}}/people-rococo-runtime/people-rococo-srtool-digest.json - PEOPLE_WESTEND_DIGEST: ${{ github.workspace}}/people-westend-runtime/people-westend-srtool-digest.json - ROCOCO_DIGEST: ${{ github.workspace}}/rococo-runtime/rococo-srtool-digest.json - WESTEND_DIGEST: ${{ github.workspace}}/westend-runtime/westend-srtool-digest.json - run: | - . ./.github/scripts/common/lib.sh - - export REF1=$(get_latest_release_tag) - if [[ -z "${{ inputs.version }}" ]]; then - export REF2="${{ github.ref_name }}" - else - export REF2="${{ inputs.version }}" - fi - echo "REL_TAG=$REF2" >> $GITHUB_ENV - export VERSION=$(echo "$REF2" | sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+).*$/\1/') - - ./scripts/release/build-changelogs.sh - - - name: Archive artifact context.json - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - name: release-notes-context - path: | - scripts/release/context.json - **/*-srtool-digest.json - - - name: Create draft release - id: create-release - uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.REL_TAG }} - release_name: Polkadot ${{ env.REL_TAG }} - body_path: ${{ github.workspace}}/scripts/release/RELEASE_DRAFT.md - draft: true - - publish-runtimes: - needs: [ build-runtimes, publish-release-draft ] - continue-on-error: true - runs-on: ubuntu-latest - strategy: - matrix: ${{ fromJSON(needs.build-runtimes.outputs.published_runtimes) }} - - steps: - - name: Checkout sources - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - - name: Download artifacts - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - - - name: Get runtime info - env: - JSON: release-notes-context/${{ matrix.chain }}-runtime/${{ matrix.chain }}-srtool-digest.json - run: | - >>$GITHUB_ENV echo ASSET=$(find ${{ matrix.chain }}-runtime -name '*.compact.compressed.wasm') - >>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion) - - - name: Upload compressed ${{ matrix.chain }} v${{ env.SPEC }} wasm - if: ${{ matrix.chain != 'rococo-parachain' }} - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 #v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.publish-release-draft.outputs.asset_upload_url }} - asset_path: ${{ env.ASSET }} - asset_name: ${{ matrix.chain }}_runtime-v${{ env.SPEC }}.compact.compressed.wasm - asset_content_type: application/wasm - - publish-binaries: - needs: [ publish-release-draft, build-binaries ] - continue-on-error: true - runs-on: ubuntu-latest - strategy: - matrix: - binary: [frame-omni-bencher, chain-spec-builder] - - steps: - - name: Download artifacts - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - with: - name: ${{ matrix.binary }} - - - name: Upload ${{ matrix.binary }} binary - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 #v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.publish-release-draft.outputs.asset_upload_url }} - asset_path: ${{ github.workspace}}/${{ matrix.binary }} - asset_name: ${{ matrix.binary }} - asset_content_type: application/octet-stream - - post_to_matrix: - runs-on: ubuntu-latest - needs: publish-release-draft - environment: release - strategy: - matrix: - channel: - - name: "Team: RelEng Internal" - room: '!GvAyzgCDgaVrvibaAF:parity.io' - - steps: - - name: Send Matrix message to ${{ matrix.channel.name }} - uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3 - with: - room_id: ${{ matrix.channel.room }} - access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }} - server: m.parity.io - message: | - **New version of polkadot tagged**: ${{ github.ref_name }}
- Draft release created: ${{ needs.publish-release-draft.outputs.release_url }} diff --git a/.github/workflows/tests-linux-stable.yml b/.github/workflows/tests-linux-stable.yml deleted file mode 100644 index 5fdfabc437fe..000000000000 --- a/.github/workflows/tests-linux-stable.yml +++ /dev/null @@ -1,81 +0,0 @@ -# GHA for test-linux-stable-int, test-linux-stable, test-linux-stable-oldkernel -name: tests linux stable - -on: - push: - branches: - - master - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - merge_group: -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - FORKLIFT_storage_s3_bucketName: ${{ secrets.FORKLIFT_storage_s3_bucketName }} - FORKLIFT_storage_s3_accessKeyId: ${{ secrets.FORKLIFT_storage_s3_accessKeyId }} - FORKLIFT_storage_s3_secretAccessKey: ${{ secrets.FORKLIFT_storage_s3_secretAccessKey }} - FORKLIFT_storage_s3_endpointUrl: ${{ secrets.FORKLIFT_storage_s3_endpointUrl }} - FORKLIFT_metrics_pushEndpoint: ${{ secrets.FORKLIFT_metrics_pushEndpoint }} - -jobs: - - changes: - permissions: - pull-requests: read - uses: ./.github/workflows/check-changed-files.yml - - set-image: - # GitHub Actions allows using 'env' in a container context. - # However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322 - # This workaround sets the container image for each job using 'set-image' job output. - needs: changes - if: ${{ needs.changes.outputs.rust }} - runs-on: ubuntu-latest - outputs: - IMAGE: ${{ steps.set_image.outputs.IMAGE }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - id: set_image - run: cat .github/env >> $GITHUB_OUTPUT - - test-linux-stable-int: - needs: [set-image, changes] - if: ${{ needs.changes.outputs.rust }} - runs-on: arc-runners-polkadot-sdk-beefy - timeout-minutes: 30 - container: - image: ${{ needs.set-image.outputs.IMAGE }} - env: - RUSTFLAGS: "-C debug-assertions -D warnings" - RUST_BACKTRACE: 1 - WASM_BUILD_NO_COLOR: 1 - WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings" - # Ensure we run the UI tests. - RUN_UI_TESTS: 1 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: script - run: WASM_BUILD_NO_COLOR=1 time forklift cargo test -p staging-node-cli --release --locked -- --ignored - - # https://github.com/paritytech/ci_cd/issues/864 - test-linux-stable-runtime-benchmarks: - needs: [set-image, changes] - if: ${{ needs.changes.outputs.rust }} - runs-on: arc-runners-polkadot-sdk-beefy - timeout-minutes: 30 - container: - image: ${{ needs.set-image.outputs.IMAGE }} - env: - RUST_TOOLCHAIN: stable - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: script - run: time forklift cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 293acadc4e6a..000000000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: tests - -on: - push: - branches: - - master - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - merge_group: -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - FORKLIFT_storage_s3_bucketName: ${{ secrets.FORKLIFT_storage_s3_bucketName }} - FORKLIFT_storage_s3_accessKeyId: ${{ secrets.FORKLIFT_storage_s3_accessKeyId }} - FORKLIFT_storage_s3_secretAccessKey: ${{ secrets.FORKLIFT_storage_s3_secretAccessKey }} - FORKLIFT_storage_s3_endpointUrl: ${{ secrets.FORKLIFT_storage_s3_endpointUrl }} - FORKLIFT_metrics_pushEndpoint: ${{ secrets.FORKLIFT_metrics_pushEndpoint }} - -jobs: - - changes: - permissions: - pull-requests: read - uses: ./.github/workflows/check-changed-files.yml - - set-image: - # GitHub Actions allows using 'env' in a container context. - # However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322 - # This workaround sets the container image for each job using 'set-image' job output. - runs-on: ubuntu-latest - outputs: - IMAGE: ${{ steps.set_image.outputs.IMAGE }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - id: set_image - run: cat .github/env >> $GITHUB_OUTPUT - - quick-benchmarks: - needs: [set-image, changes] - if: ${{ needs.changes.outputs.rust }} - runs-on: arc-runners-polkadot-sdk-beefy - timeout-minutes: 30 - container: - image: ${{ needs.set-image.outputs.IMAGE }} - env: - RUSTFLAGS: "-C debug-assertions -D warnings" - RUST_BACKTRACE: "full" - WASM_BUILD_NO_COLOR: 1 - WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: script - run: time forklift cargo run --locked --release -p staging-node-cli --bin substrate-node --features runtime-benchmarks -- benchmark pallet --chain dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 --quiet - - # cf https://github.com/paritytech/polkadot-sdk/issues/1652 - test-syscalls: - needs: [set-image, changes] - if: ${{ needs.changes.outputs.rust }} - runs-on: arc-runners-polkadot-sdk-beefy - timeout-minutes: 30 - container: - image: ${{ needs.set-image.outputs.IMAGE }} - continue-on-error: true # this rarely triggers in practice - env: - SKIP_WASM_BUILD: 1 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: script - run: | - forklift cargo build --locked --profile production --target x86_64-unknown-linux-musl --bin polkadot-execute-worker --bin polkadot-prepare-worker - cd polkadot/scripts/list-syscalls - ./list-syscalls.rb ../../../target/x86_64-unknown-linux-musl/production/polkadot-execute-worker --only-used-syscalls | diff -u execute-worker-syscalls - - ./list-syscalls.rb ../../../target/x86_64-unknown-linux-musl/production/polkadot-prepare-worker --only-used-syscalls | diff -u prepare-worker-syscalls - - # todo: - # after_script: - # - if [[ "$CI_JOB_STATUS" == "failed" ]]; then - # printf "The x86_64 syscalls used by the worker binaries have changed. Please review if this is expected and update polkadot/scripts/list-syscalls/*-worker-syscalls as needed.\n"; - # fi - - cargo-check-all-benches: - needs: [set-image, changes] - if: ${{ needs.changes.outputs.rust }} - runs-on: arc-runners-polkadot-sdk-beefy - timeout-minutes: 30 - container: - image: ${{ needs.set-image.outputs.IMAGE }} - env: - SKIP_WASM_BUILD: 1 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: script - run: time forklift cargo check --all --benches From 01bd495892c37b85d59fa6a935fb7a5232777eb9 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 6 Jun 2024 20:07:18 +0200 Subject: [PATCH 13/16] Updates weights --- .../snowbridge_pallet_ethereum_client.rs | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs index 2eb1c07c8bdb..7c726f2f099d 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs @@ -54,8 +54,8 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for // Proof Size summary in bytes: // Measured: `76` // Estimated: `3501` - // Minimum execution time: 72_635_000_000 picoseconds. - Weight::from_parts(74_575_000_000, 0) + // Minimum execution time: 67_553_000_000 picoseconds. + Weight::from_parts(68_677_000_000, 0) .saturating_add(Weight::from_parts(0, 3501)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(8)) @@ -76,8 +76,8 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for // Proof Size summary in bytes: // Measured: `92749` // Estimated: `93857` - // Minimum execution time: 18_487_000_000 picoseconds. - Weight::from_parts(26_424_000_000, 0) + // Minimum execution time: 16_988_000_000 picoseconds. + Weight::from_parts(17_125_000_000, 0) .saturating_add(Weight::from_parts(0, 93857)) .saturating_add(T::DbWeight::get().reads(6)) } @@ -97,24 +97,28 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for // Proof Size summary in bytes: // Measured: `92749` // Estimated: `93857` - // Minimum execution time: 91_539_000_000 picoseconds. - Weight::from_parts(96_048_000_000, 0) + // Minimum execution time: 84_553_000_000 picoseconds. + Weight::from_parts(87_459_000_000, 0) .saturating_add(Weight::from_parts(0, 93857)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: UNKNOWN KEY `0xada12a87b9ccce83f328569cf9934e83e6d574e897864a327c716c553f277037` (r:1 w:1) /// Proof: UNKNOWN KEY `0xada12a87b9ccce83f328569cf9934e83e6d574e897864a327c716c553f277037` (r:1 w:1) + /// Storage: UNKNOWN KEY `0xada12a87b9ccce83f328569cf9934e834209354bdd86a5d7050a9b80004c2d6d` (r:0 w:1) + /// Proof: UNKNOWN KEY `0xada12a87b9ccce83f328569cf9934e834209354bdd86a5d7050a9b80004c2d6d` (r:0 w:1) /// Storage: UNKNOWN KEY `0xada12a87b9ccce83f328569cf9934e83964405908d330d65518e9e60960ba9f1` (r:0 w:1) /// Proof: UNKNOWN KEY `0xada12a87b9ccce83f328569cf9934e83964405908d330d65518e9e60960ba9f1` (r:0 w:1) + /// Storage: UNKNOWN KEY `0xada12a87b9ccce83f328569cf9934e83d98b4ec57d38fb2970ffc6289380767d` (r:0 w:1) + /// Proof: UNKNOWN KEY `0xada12a87b9ccce83f328569cf9934e83d98b4ec57d38fb2970ffc6289380767d` (r:0 w:1) fn step() -> Weight { // Proof Size summary in bytes: // Measured: `215` // Estimated: `3680` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3680)) .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(4)) } } From 070427aa54cc3fd70aa07e71e64af0e57814f9ea Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 6 Jun 2024 20:21:06 +0200 Subject: [PATCH 14/16] remove comment --- .../snowbridge/pallets/ethereum-client/src/migration/mod.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs b/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs index 63b8e9a005b5..da06a7c976b7 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/migration/mod.rs @@ -83,9 +83,6 @@ impl> SteppedMigration ) -> Result, SteppedMigrationError> { log::info!(target: LOG_TARGET, "Starting step iteration for Ethereum execution header cleanup."); let required = W::step(); - // If there is not enough weight for a single step, return an error. This case can be - // problematic if it is the first migration that ran in this block. But there is nothing - // that we can do about it here. if meter.remaining().any_lt(required) { return Err(SteppedMigrationError::InsufficientWeight { required }); } From 303f6a0b0e322966a709994433d4dee7fe10947e Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Fri, 7 Jun 2024 09:44:21 +0200 Subject: [PATCH 15/16] updates weight --- bridges/snowbridge/pallets/ethereum-client/src/weights.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bridges/snowbridge/pallets/ethereum-client/src/weights.rs b/bridges/snowbridge/pallets/ethereum-client/src/weights.rs index 783539b0ae97..75d4f3b48da6 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/weights.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/weights.rs @@ -61,9 +61,9 @@ impl WeightInfo for () { } fn step() -> Weight { - Weight::from_parts(10_000_000, 0) + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3680)) - .saturating_add(RocksDbWeight::get().reads(1)) - .saturating_add(RocksDbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(4)) } } From 5a211928e75a0915910611ca8add691f6f21b61c Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Fri, 7 Jun 2024 10:38:29 +0200 Subject: [PATCH 16/16] fix weights --- bridges/snowbridge/pallets/ethereum-client/src/weights.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bridges/snowbridge/pallets/ethereum-client/src/weights.rs b/bridges/snowbridge/pallets/ethereum-client/src/weights.rs index 75d4f3b48da6..6f0894fda67c 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/weights.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/weights.rs @@ -63,7 +63,7 @@ impl WeightInfo for () { fn step() -> Weight { Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3680)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(RocksDbWeight::get().reads(1)) + .saturating_add(RocksDbWeight::get().writes(4)) } }