Enable late re-org and re-org interactive tests (#9405)

https://github.com/sigp/lighthouse/issues/8959

WIP still working on adding more re-org tests and refactoring existing.


  


Co-Authored-By: hopinheimer <knmanas6@gmail.com>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
hopinheimer
2026-06-18 04:57:13 -04:00
committed by GitHub
parent 446f5b5c16
commit ddfc265123
9 changed files with 1480 additions and 60 deletions

View File

@@ -174,6 +174,10 @@ pub struct ProtoNode {
}
impl ProtoNode {
pub fn is_gloas(&self) -> bool {
self.as_v29().is_ok()
}
/// Generic version of spec's `parent_payload_status` that works for pre-Gloas nodes by
/// considering their parents Empty.
pub fn get_parent_payload_status(&self) -> PayloadStatus {

View File

@@ -723,15 +723,14 @@ impl ProtoArrayForkChoice {
.into());
}
// Spec: `is_parent_strong`. Use payload-aware weight matching the
// payload path the head node is on from its parent.
let parent_payload_status = info.head_node.get_parent_payload_status();
let parent_weight = info.parent_node.attestation_score(parent_payload_status);
// Spec: `is_parent_strong`. Use `PayloadStatus::Pending` to avoid weight split
// between payload statuses. https://github.com/ethereum/consensus-specs/issues/5305
let parent_pending_weight = info.parent_node.attestation_score(PayloadStatus::Pending);
let re_org_parent_weight_threshold = info.re_org_parent_weight_threshold;
let parent_strong = parent_weight > re_org_parent_weight_threshold;
let parent_strong = parent_pending_weight > re_org_parent_weight_threshold;
if !parent_strong {
return Err(DoNotReOrg::ParentNotStrong {
parent_weight,
parent_weight: parent_pending_weight,
re_org_parent_weight_threshold,
}
.into());