feat: implement forkchoice is_head_weak() and is_parent_strong() - #9654
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the fork choice implementation to support the Gloas fork's modified is_head_weak specification. It splits the tracking of node weights into two separate components: attestationScore (representing attester votes only) and weight (which includes proposer boost). The isHeadWeak logic is extracted into a private helper method in ForkChoice that handles both pre-Gloas and post-Gloas specifications, including adding back the weight of equivocating validators for post-Gloas blocks. Additionally, deltas has been renamed to attestationDeltas across the codebase for clarity, and comprehensive unit tests have been added to verify the new behavior. I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Performance Report🚀🚀 Significant benchmark improvement detected
Full benchmark results
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #9654 +/- ##
============================================
- Coverage 52.49% 52.48% -0.02%
============================================
Files 848 848
Lines 60485 60458 -27
Branches 4466 4459 -7
============================================
- Hits 31754 31732 -22
+ Misses 28670 28665 -5
Partials 61 61 🚀 New features to boost your workflow:
|
…ProposerBoost is_head_weak() landed via #9654 with the exact gloas semantics (boost-excluded attestation score + committee-scoped equivocator balance add-back), so the weak-parent check can call it directly instead of approximating with raw node.weight against the reorg threshold. Also adapt findEquivocatingBlocks to the current VariantIndices layout via getDefaultNodeIndex, and add the new ProtoBlock fields to test fixtures that were added on unstable since the last merge. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
🎉 This PR is included in v1.46.0 🎉 |
Motivation
getProposerHead()Description
getProposerHead()AI Assistance Disclosure