From c18c9dc36408d2998b5d2a9ac3c1f65a8b7d8a3d Mon Sep 17 00:00:00 2001 From: Gonza Montiel Date: Thu, 6 Nov 2025 10:31:00 +0100 Subject: [PATCH] feat: add FreeHeadersInterval parameter to Ethereum client config (#279) ## Add FreeHeadersInterval parameter to Ethereum client config Configure parameter `FreeHeadersInterval` set to `32` (1 epoch = 6.4 minutes) across `mainnet`, `stagenet`, and `testnet` configurations. ### Rationale 1. Aligns with Ethereum's epoch change, so it's easier to identify in which epoch we are in 2. It's the value used in Snowbridge's test configuration The value can be changed via pallet parameters. --------- Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com> --- operator/runtime/mainnet/src/configs/mod.rs | 6 +++++- operator/runtime/stagenet/src/configs/mod.rs | 6 +++++- operator/runtime/testnet/src/configs/mod.rs | 6 +++++- test/.papi/metadata/datahaven.scale | Bin 622477 -> 622477 bytes 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/operator/runtime/mainnet/src/configs/mod.rs b/operator/runtime/mainnet/src/configs/mod.rs index c5975427..805552a1 100644 --- a/operator/runtime/mainnet/src/configs/mod.rs +++ b/operator/runtime/mainnet/src/configs/mod.rs @@ -1190,10 +1190,14 @@ parameter_types! { }; } +parameter_types! { + pub const FreeHeadersInterval: u32 = 32; // 1 epoch = 6.4 minutes +} + impl snowbridge_pallet_ethereum_client::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ForkVersions = ChainForkVersions; - type FreeHeadersInterval = (); + type FreeHeadersInterval = FreeHeadersInterval; type WeightInfo = mainnet_weights::snowbridge_pallet_ethereum_client::WeightInfo; } diff --git a/operator/runtime/stagenet/src/configs/mod.rs b/operator/runtime/stagenet/src/configs/mod.rs index 8ae2c091..d1d37a88 100644 --- a/operator/runtime/stagenet/src/configs/mod.rs +++ b/operator/runtime/stagenet/src/configs/mod.rs @@ -1189,10 +1189,14 @@ parameter_types! { }; } +parameter_types! { + pub const FreeHeadersInterval: u32 = 32; // 1 epoch = 6.4 minutes +} + impl snowbridge_pallet_ethereum_client::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ForkVersions = ChainForkVersions; - type FreeHeadersInterval = (); + type FreeHeadersInterval = FreeHeadersInterval; type WeightInfo = stagenet_weights::snowbridge_pallet_ethereum_client::WeightInfo; } diff --git a/operator/runtime/testnet/src/configs/mod.rs b/operator/runtime/testnet/src/configs/mod.rs index af392689..67df3642 100644 --- a/operator/runtime/testnet/src/configs/mod.rs +++ b/operator/runtime/testnet/src/configs/mod.rs @@ -1190,10 +1190,14 @@ parameter_types! { }; } +parameter_types! { + pub const FreeHeadersInterval: u32 = 32; // 1 epoch = 6.4 minutes +} + impl snowbridge_pallet_ethereum_client::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ForkVersions = ChainForkVersions; - type FreeHeadersInterval = (); + type FreeHeadersInterval = FreeHeadersInterval; type WeightInfo = testnet_weights::snowbridge_pallet_ethereum_client::WeightInfo; } diff --git a/test/.papi/metadata/datahaven.scale b/test/.papi/metadata/datahaven.scale index 6b9fb94b6f44d20efee2ee7e7504ce244cf9d177..08f0c18cfe5dc50c601114dc6dd541539102d428 100644 GIT binary patch delta 37 scmeDEuiE=xwV{Qvg{g(Pg{6hHg{_5s3x`}0qe8oU5yy7