Skip to content

Commit

Permalink
fix benchmarks and cleanup config
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden committed May 28, 2024
1 parent a76335d commit 42c164f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,6 @@ parameter_types! {
};
}

parameter_types! {
// On Ethereum, a sync committee period spans 8192 slots, approximately 27 hours (or 256 epochs).
// We retain headers for 20 sync committee periods, equating to about 3 weeks. Headers older
// than this period are pruned.
pub const MaxExecutionHeadersToKeep: u32 = 8192 * 20;
}

impl snowbridge_pallet_ethereum_client::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type ForkVersions = ChainForkVersions;
Expand Down Expand Up @@ -173,14 +166,14 @@ pub mod benchmark_helpers {
use codec::Encode;
use frame_support::traits::fungible;
use hex_literal::hex;
use snowbridge_beacon_primitives::CompactExecutionHeader;
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<T: snowbridge_pallet_ethereum_client::Config> BenchmarkHelper<T> for Runtime {
fn initialize_storage(block_hash: H256, header: CompactExecutionHeader) {
EthereumBeaconClient::store_execution_header(block_hash, header, 0, H256::default());
fn initialize_storage(beacon_header: BeaconHeader, block_roots_root: H256) {
EthereumBeaconClient::store_finalized_header(beacon_header, block_roots_root).unwrap();
EthereumGatewayAddress::set(&hex!["EDa338E4dC46038493b885327842fD3E301CaB39"].into());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,6 @@ parameter_types! {
};
}

parameter_types! {
// On Ethereum, a sync committee period spans 8192 slots, approximately 27 hours (or 256 epochs).
// We retain headers for 20 sync committee periods, equating to about 3 weeks. Headers older
// than this period are pruned.
pub const MaxExecutionHeadersToKeep: u32 = 8192 * 20;
}

impl snowbridge_pallet_ethereum_client::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type ForkVersions = ChainForkVersions;
Expand Down Expand Up @@ -173,14 +166,14 @@ pub mod benchmark_helpers {
use codec::Encode;
use frame_support::traits::fungible;
use hex_literal::hex;
use snowbridge_beacon_primitives::CompactExecutionHeader;
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<T: snowbridge_pallet_ethereum_client::Config> BenchmarkHelper<T> for Runtime {
fn initialize_storage(block_hash: H256, header: CompactExecutionHeader) {
EthereumBeaconClient::store_execution_header(block_hash, header, 0, H256::default());
fn initialize_storage(beacon_header: BeaconHeader, block_roots_root: H256) {
EthereumBeaconClient::store_finalized_header(beacon_header, block_roots_root).unwrap();
EthereumGatewayAddress::set(&hex!["EDa338E4dC46038493b885327842fD3E301CaB39"].into());
}
}
Expand Down

0 comments on commit 42c164f

Please sign in to comment.