Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use 16-bit random value to compute validator indices #7301

Closed
wants to merge 1 commit into from

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Dec 14, 2024

In the latest Electra spec, the likelihood vs effective balance graph represents a step function instead of linear for calculating proposer validator index and sync committee indices. eg. Two validators with one having 33ETH and the other having 40ETH will have the same probability of being elected as proposer because 33 and 40ETH are in the same "bucket" due to existed 8-bit random byte is not granular enough.

Changes random byte from 8-bit to 16-bit with restore the graph to linear.

Relevant spec: ethereum/consensus-specs#4039

@ensi321 ensi321 requested a review from a team as a code owner December 14, 2024 01:09
Copy link

codecov bot commented Dec 14, 2024

Codecov Report

Attention: Patch coverage is 23.52941% with 26 lines in your changes missing coverage. Please review.

Project coverage is 48.63%. Comparing base (031214e) to head (169844e).
Report is 1 commits behind head on devnet-5.

Additional details and impacted files
@@             Coverage Diff              @@
##           devnet-5    #7301      +/-   ##
============================================
- Coverage     48.65%   48.63%   -0.02%     
============================================
  Files           603      603              
  Lines         40427    40436       +9     
  Branches       2065     2067       +2     
============================================
- Hits          19670    19667       -3     
- Misses        20719    20731      +12     
  Partials         38       38              

Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like branch needs to be rebased

@ensi321 ensi321 force-pushed the nc/straighten-proposer-likelihood branch from 86ca960 to aff569d Compare December 16, 2024 18:15
@twoeths
Copy link
Contributor

twoeths commented Dec 17, 2024

@ensi321 could you separate into 2 PRs: 1 for the main change and 1 for refactoring?

@ensi321
Copy link
Contributor Author

ensi321 commented Dec 18, 2024

Closing in favour of #7311

@ensi321 ensi321 closed this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants