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

refactor epoch state transition to facilitate individual validator balance change calculations #5910

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

tersec
Copy link
Contributor

@tersec tersec commented Feb 18, 2024

  • useful immediately for being able to calculate expected withdrawals across epoch boundary in efficient/incremental way, which is also required for the payload attributes SSE API
  • allow making the heuristic in
    if participation_flags.has_flag(TIMELY_SOURCE_FLAG_INDEX) and
    participation_flags.has_flag(TIMELY_TARGET_FLAG_INDEX) and
    effective_balance == MAX_EFFECTIVE_BALANCE and
    forkyState.data.slot.epoch != GENESIS_EPOCH and
    forkyState.data.inactivity_scores.item(
    nextEpochFirstProposer) == 0 and
    not effective_balance_might_update(
    forkyState.data.balances.item(nextEpochFirstProposer),
    effective_balance):
    node.consensusManager[].actionTracker.updateActions(
    shufflingRef, nextEpochProposers)
    else:
    epochRefFallback()
    precise and remove participation_flags.has_flag(TIMELY_SOURCE_FLAG_INDEX), participation_flags.has_flag(TIMELY_TARGET_FLAG_INDEX), and forkyState.data.inactivity_scores.item(nextEpochFirstProposer) == 0` checks because they will be able to be efficiently calculated exactly, on a per-proposer basis and therefore reduce unnecessary epoch transitions during normal operation
  • progress towards factoring out inner loop bodies and potentially allow combining more loops across all validators or all active validators in the epoch transition into a single loop which does multiple steps per validator for significant performance improvement, while retaining testability

Copy link

Unit Test Results

         9 files  ±0    1 107 suites  ±0   27m 26s ⏱️ -24s
  4 232 tests ±0    3 885 ✔️ ±0  347 💤 ±0  0 ±0 
16 891 runs  ±0  16 493 ✔️ ±0  398 💤 ±0  0 ±0 

Results for commit eb9eb7d. ± Comparison against base commit 4fc1550.

@tersec tersec merged commit ffbc8d1 into unstable Feb 20, 2024
13 checks passed
@tersec tersec deleted the JjK branch February 20, 2024 05:14
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.

1 participant