fix(fork-choice): preserve exact Gwei weights - #9821
Draft
GrapeBaBa wants to merge 1 commit into
Draft
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #9821 +/- ##
============================================
- Coverage 52.60% 52.59% -0.01%
============================================
Files 848 848
Lines 59969 59959 -10
Branches 4414 4414
============================================
- Hits 31545 31535 -10
Misses 28365 28365
Partials 59 59 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Fork choice stores validator balances in effective-balance increments, while the consensus specification computes proposer boost and reorg thresholds in Gwei. Flooring these values in whole increments can change fork-choice weights near the decision boundary.
Issue #9694 identifies Gwei
bigintProtoArray weights as the option that fully closes this precision gap and asks for its performance cost to be measured.Closes #9694.
Description
computeDeltas()innumbereffective-balance increments.bigintat the lower-cardinality ProtoArray update boundary.bigintvalues.getCommitteeFraction().ssz.Gwei. This intentionally changes the TypeScript API weight type fromnumbertobigint.Benchmark
Node.js 24.15.0, 897,032 validators, active proposer boost, and 1,200 or 7,200 ProtoArray nodes. Fixture construction and GC run outside the timed
updateHead()call. Each value is the median of three independent process-level averages with five samples per process.The validator count and total balance are mainnet-derived, but vote distribution and per-validator balances are synthetic rather than a replay of live mainnet traces.