Skip to content

Commit

Permalink
Update benchmark for beacon client (#31)
Browse files Browse the repository at this point in the history
* Update benchmark for beacon client

* Increase MaxExecutionHeadersToKeep
  • Loading branch information
yrong authored Jun 9, 2023
1 parent 2b07b7d commit a49b1a2
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ parameter_types! {
epoch: 162304,
},
};
pub const MaxExecutionHeadersToKeep:u32 = 1000;
pub const MaxExecutionHeadersToKeep:u32 = 8192 * 2;
}

impl snowbridge_ethereum_beacon_client::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! Autogenerated weights for `snowbridge_ethereum_beacon_client`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-06-08, 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
Expand All @@ -28,99 +28,110 @@
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]

use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;

/// Weight functions for `snowbridge_ethereum_beacon_client`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> snowbridge_ethereum_beacon_client::WeightInfo for WeightInfo<T> {
/// 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)
fn force_checkpoint() -> Weight {
// Proof Size summary in bytes:
// Measured: `92678`
// Estimated: `207645`
// Minimum execution time: 134_980_480_000 picoseconds.
Weight::from_parts(135_073_514_000, 0)
.saturating_add(Weight::from_parts(0, 207645))
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(6))
// Measured: `42`
// Estimated: `3501`
// Minimum execution time: 97_185_781_000 picoseconds.
Weight::from_parts(97_263_571_000, 0)
.saturating_add(Weight::from_parts(0, 3501))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(9))
}
/// Storage: EthereumBeaconClient Blocked (r:1 w:0)
/// Proof: EthereumBeaconClient Blocked (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient LatestSyncCommitteePeriod (r:1 w:1)
/// Proof: EthereumBeaconClient LatestSyncCommitteePeriod (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient SyncCommittees (r:2 w:1)
/// Proof: EthereumBeaconClient SyncCommittees (max_values: None, max_size: Some(92348), added: 94823, mode: MaxEncodedLen)
/// 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 FinalizedBeaconHeaderSlots (r:1 w:1)
/// Proof: EthereumBeaconClient FinalizedBeaconHeaderSlots (max_values: Some(1), max_size: Some(8002), added: 8497, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient LatestFinalizedHeaderState (r:1 w:1)
/// Proof: EthereumBeaconClient LatestFinalizedHeaderState (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen)
/// Storage: Timestamp Now (r:1 w:0)
/// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient FinalizedBeaconHeaders (r:0 w:1)
/// Proof: EthereumBeaconClient FinalizedBeaconHeaders (max_values: None, max_size: Some(144), added: 2619, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient FinalizedBeaconHeadersBlockRoot (r:0 w:1)
/// Proof: EthereumBeaconClient FinalizedBeaconHeadersBlockRoot (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen)
fn submit_with_sync_committee() -> Weight {
/// 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)
fn submit() -> Weight {
// Proof Size summary in bytes:
// Measured: `92678`
// Estimated: `207645`
// Minimum execution time: 134_980_480_000 picoseconds.
Weight::from_parts(135_073_514_000, 0)
.saturating_add(Weight::from_parts(0, 207645))
// Measured: `92753`
// Estimated: `93857`
// Minimum execution time: 25_999_968_000 picoseconds.
Weight::from_parts(26_051_019_000, 0)
.saturating_add(Weight::from_parts(0, 93857))
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(6))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: EthereumBeaconClient Blocked (r:1 w:0)
/// Proof: EthereumBeaconClient Blocked (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient LatestFinalizedHeaderState (r:1 w:1)
/// Proof: EthereumBeaconClient LatestFinalizedHeaderState (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen)
/// Storage: Timestamp Now (r:1 w:0)
/// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, 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 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 SyncCommittees (r:1 w:0)
/// Proof: EthereumBeaconClient SyncCommittees (max_values: None, max_size: Some(92348), added: 94823, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient FinalizedBeaconHeaderSlots (r:1 w:1)
/// Proof: EthereumBeaconClient FinalizedBeaconHeaderSlots (max_values: Some(1), max_size: Some(8002), added: 8497, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient FinalizedBeaconHeaders (r:0 w:1)
/// Proof: EthereumBeaconClient FinalizedBeaconHeaders (max_values: None, max_size: Some(144), added: 2619, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient FinalizedBeaconHeadersBlockRoot (r:0 w:1)
/// Proof: EthereumBeaconClient FinalizedBeaconHeadersBlockRoot (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen)
fn submit() -> Weight {
fn submit_with_sync_committee() -> Weight {
// Proof Size summary in bytes:
// Measured: `92678`
// Estimated: `111329`
// Minimum execution time: 29_360_502_000 picoseconds.
Weight::from_parts(29_376_008_000, 0)
.saturating_add(Weight::from_parts(0, 111329))
// Measured: `92717`
// Estimated: `93857`
// Minimum execution time: 122_354_917_000 picoseconds.
Weight::from_parts(122_461_312_000, 0)
.saturating_add(Weight::from_parts(0, 93857))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: EthereumBeaconClient Blocked (r:1 w:0)
/// Proof: EthereumBeaconClient Blocked (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient LatestFinalizedHeaderState (r:1 w:0)
/// Proof: EthereumBeaconClient LatestFinalizedHeaderState (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient LatestExecutionHeaderState (r:1 w:1)
/// Proof: EthereumBeaconClient LatestExecutionHeaderState (max_values: Some(1), max_size: Some(80), added: 575, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient FinalizedBeaconHeadersBlockRoot (r:1 w:0)
/// Proof: EthereumBeaconClient FinalizedBeaconHeadersBlockRoot (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient SyncCommittees (r:1 w:0)
/// Proof: EthereumBeaconClient SyncCommittees (max_values: None, max_size: Some(92348), added: 94823, 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 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:1)
/// Proof: EthereumBeaconClient LatestExecutionState (max_values: Some(1), max_size: Some(80), added: 575, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient ExecutionHeaderIndex (r:1 w:1)
/// Proof: EthereumBeaconClient ExecutionHeaderIndex (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient ExecutionHeaderMapping (r:1 w:1)
/// Proof: EthereumBeaconClient ExecutionHeaderMapping (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen)
/// Storage: EthereumBeaconClient ExecutionHeaders (r:0 w:1)
/// Proof: EthereumBeaconClient ExecutionHeaders (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen)
fn submit_execution_header() -> Weight {
// Proof Size summary in bytes:
// Measured: `92722`
// Estimated: `105443`
// Minimum execution time: 29_353_288_000 picoseconds.
Weight::from_parts(29_372_047_000, 0)
.saturating_add(Weight::from_parts(0, 105443))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `386`
// Estimated: `3537`
// Minimum execution time: 108_761_000 picoseconds.
Weight::from_parts(113_158_000, 0)
.saturating_add(Weight::from_parts(0, 3537))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
}

0 comments on commit a49b1a2

Please sign in to comment.