From 0ef0d5b0228ddb34151f5a0485a405cf5c5b8886 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Thu, 6 Jun 2024 10:53:29 +0200 Subject: [PATCH] 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)) + } }