Deprecate some reorg-related CLI flags and read from spec (#9177)

- #9123


  


Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>

Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>
This commit is contained in:
chonghe
2026-05-25 10:11:27 +08:00
committed by GitHub
parent b5d44bff36
commit 9b961960c4
16 changed files with 141 additions and 253 deletions

View File

@@ -2,7 +2,7 @@
use beacon_chain::custody_context::NodeCustodyType;
use beacon_chain::{
ChainConfig,
chain_config::{DisallowedReOrgOffsets, ReOrgThreshold},
chain_config::DisallowedReOrgOffsets,
test_utils::{
AttestationStrategy, BlockStrategy, LightClientStrategy, SyncCommitteeStrategy, test_spec,
},
@@ -23,7 +23,7 @@ use std::sync::Arc;
use std::time::Duration;
use types::{
Address, Epoch, EthSpec, ExecPayload, ExecutionBlockHash, ForkName, Hash256, MainnetEthSpec,
MinimalEthSpec, ProposerPreparationData, Slot, Uint256,
MinimalEthSpec, ProposerPreparationData, Slot,
};
type E = MainnetEthSpec;
@@ -181,8 +181,6 @@ pub struct ReOrgTest {
parent_distance: u64,
/// Number of slots between head block and block proposal slot.
head_distance: u64,
re_org_threshold: u64,
max_epochs_since_finalization: u64,
percent_parent_votes: usize,
percent_empty_votes: usize,
percent_head_votes: usize,
@@ -201,8 +199,6 @@ impl Default for ReOrgTest {
head_slot: Slot::new(E::slots_per_epoch() - 2),
parent_distance: 1,
head_distance: 1,
re_org_threshold: 20,
max_epochs_since_finalization: 2,
percent_parent_votes: 100,
percent_empty_votes: 100,
percent_head_votes: 0,
@@ -388,8 +384,6 @@ pub async fn proposer_boost_re_org_test(
head_slot,
parent_distance,
head_distance,
re_org_threshold,
max_epochs_since_finalization,
percent_parent_votes,
percent_empty_votes,
percent_head_votes,
@@ -403,8 +397,7 @@ pub async fn proposer_boost_re_org_test(
// TODO(EIP-7732): extend test for Gloas — `get_validator_blocks_v3` is missing the
// `Eth-Execution-Payload-Blinded` header for Gloas block production responses.
let mut spec = ForkName::Fulu.make_genesis_spec(E::default_spec());
spec.terminal_total_difficulty = Uint256::from(1);
let spec = ForkName::Fulu.make_genesis_spec(E::default_spec());
// Ensure there are enough validators to have `attesters_per_slot`.
let attesters_per_slot = 10;
@@ -427,14 +420,9 @@ pub async fn proposer_boost_re_org_test(
validator_count,
None,
Some(Box::new(move |builder| {
builder
.proposer_re_org_head_threshold(Some(ReOrgThreshold(re_org_threshold)))
.proposer_re_org_max_epochs_since_finalization(Epoch::new(
max_epochs_since_finalization,
))
.proposer_re_org_disallowed_offsets(
DisallowedReOrgOffsets::new::<E>(disallowed_offsets).unwrap(),
)
builder.proposer_re_org_disallowed_offsets(
DisallowedReOrgOffsets::new::<E>(disallowed_offsets).unwrap(),
)
})),
Default::default(),
false,