From 16925ebb7da32854f855306b80a0983d66f16ca9 Mon Sep 17 00:00:00 2001 From: ron Date: Fri, 5 May 2023 19:34:38 +0800 Subject: [PATCH 1/2] Const value for pruning --- .../runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index dbff27150d9..efb843d1824 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -602,6 +602,9 @@ parameter_types! { epoch: 0, }, }; + pub const FinalizedHeaderPruneThreshold:u32 = 200; + pub const ExecutionHeadersPruneThreshold:u32 = 1000; + pub const SyncCommitteePruneThreshold:u32 = 4; } #[cfg(not(feature = "minimal"))] @@ -627,6 +630,9 @@ parameter_types! { epoch: 162304, }, }; + pub const FinalizedHeaderPruneThreshold:u32 = 200; + pub const ExecutionHeadersPruneThreshold:u32 = 1000; + pub const SyncCommitteePruneThreshold:u32 = 4; } impl snowbridge_ethereum_beacon_client::Config for Runtime { @@ -634,6 +640,9 @@ impl snowbridge_ethereum_beacon_client::Config for Runtime { type TimeProvider = pallet_timestamp::Pallet; type ForkVersions = ChainForkVersions; type WeakSubjectivityPeriodSeconds = WeakSubjectivityPeriodSeconds; + type FinalizedHeaderPruneThreshold = FinalizedHeaderPruneThreshold; + type ExecutionHeadersPruneThreshold = ExecutionHeadersPruneThreshold; + type SyncCommitteePruneThreshold = SyncCommitteePruneThreshold; type WeightInfo = weights::snowbridge_ethereum_beacon_client::WeightInfo; } From 1749739ef0ecbd9a68aa0a3655bbff61f6d899fa Mon Sep 17 00:00:00 2001 From: ron Date: Wed, 10 May 2023 11:40:58 +0800 Subject: [PATCH 2/2] Some polish --- .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index efb843d1824..50e05aa3af4 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -602,9 +602,9 @@ parameter_types! { epoch: 0, }, }; - pub const FinalizedHeaderPruneThreshold:u32 = 200; - pub const ExecutionHeadersPruneThreshold:u32 = 1000; - pub const SyncCommitteePruneThreshold:u32 = 4; + pub const MaxFinalizedHeadersToKeep:u32 = 200; + pub const MaxExecutionHeadersToKeep:u32 = 1000; + pub const MaxSyncCommitteesToKeep:u32 = 4; } #[cfg(not(feature = "minimal"))] @@ -630,9 +630,9 @@ parameter_types! { epoch: 162304, }, }; - pub const FinalizedHeaderPruneThreshold:u32 = 200; - pub const ExecutionHeadersPruneThreshold:u32 = 1000; - pub const SyncCommitteePruneThreshold:u32 = 4; + pub const MaxFinalizedHeadersToKeep:u32 = 200; + pub const MaxExecutionHeadersToKeep:u32 = 1000; + pub const MaxSyncCommitteesToKeep:u32 = 4; } impl snowbridge_ethereum_beacon_client::Config for Runtime { @@ -640,9 +640,9 @@ impl snowbridge_ethereum_beacon_client::Config for Runtime { type TimeProvider = pallet_timestamp::Pallet; type ForkVersions = ChainForkVersions; type WeakSubjectivityPeriodSeconds = WeakSubjectivityPeriodSeconds; - type FinalizedHeaderPruneThreshold = FinalizedHeaderPruneThreshold; - type ExecutionHeadersPruneThreshold = ExecutionHeadersPruneThreshold; - type SyncCommitteePruneThreshold = SyncCommitteePruneThreshold; + type MaxFinalizedHeadersToKeep = MaxFinalizedHeadersToKeep; + type MaxExecutionHeadersToKeep = MaxExecutionHeadersToKeep; + type MaxSyncCommitteesToKeep = MaxSyncCommitteesToKeep; type WeightInfo = weights::snowbridge_ethereum_beacon_client::WeightInfo; }