Use sync_tolerance_epochs flag to control the proposer prep routines (#7044)

Replace the `2 + 2 == 5` hacks from `holesky-rescue` and use the existing `sync_tolerance_epochs` flag to control the proposer prep routines.
This commit is contained in:
Jimmy Chen
2025-03-06 14:50:42 +11:00
committed by GitHub
parent 066f28770f
commit 09849e841b
5 changed files with 35 additions and 29 deletions

View File

@@ -1,7 +1,7 @@
use crate::exec::{CommandLineTestExec, CompletedTest};
use beacon_node::beacon_chain::chain_config::{
DisallowedReOrgOffsets, DEFAULT_RE_ORG_CUTOFF_DENOMINATOR, DEFAULT_RE_ORG_HEAD_THRESHOLD,
DEFAULT_RE_ORG_MAX_EPOCHS_SINCE_FINALIZATION,
DEFAULT_RE_ORG_MAX_EPOCHS_SINCE_FINALIZATION, DEFAULT_SYNC_TOLERANCE_EPOCHS,
};
use beacon_node::{
beacon_chain::graffiti_calculator::GraffitiOrigin,
@@ -2586,7 +2586,20 @@ fn sync_tolerance_epochs() {
.flag("sync-tolerance-epochs", Some("0"))
.run_with_zero_port()
.with_config(|config| {
assert_eq!(config.http_api.sync_tolerance_epochs, Some(0));
assert_eq!(config.chain.sync_tolerance_epochs, 0);
});
}
#[test]
fn sync_tolerance_epochs_default() {
CommandLineTest::new()
.flag("http", None)
.run_with_zero_port()
.with_config(|config| {
assert_eq!(
config.chain.sync_tolerance_epochs,
DEFAULT_SYNC_TOLERANCE_EPOCHS
);
});
}