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

Fix active validator indices for next shuffling epoch #2955

Merged
merged 1 commit into from
Aug 13, 2021

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Aug 13, 2021

Motivation

  • Sync gets stuck on all networks
  • Root cause is we precompute active validator indices of next epoch, we should compute for nextEpoch + 1
  • @dapplion For spec tests, we always calculate active validator indices when we create EpochContext while this happens in EpochProcess, that's why we didn't see it in spec tests

Description

  • Precompute active validator indices for nextEpoch + 1 since active indices for nextEpochShuffling is always available

Closes #2949

Test Result

  • Works fine with altair-devnet-3
  • Sync mainnet to slot ~1_000_000

@codeclimate
Copy link

codeclimate bot commented Aug 13, 2021

Code Climate has analyzed commit cd89cc7 and detected 0 issues on this pull request.

View more on Code Climate.

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 38e5cc6 Previous: 7f4f950 Ratio
getCommitteeAssignments - req 1000 vs - 250000 vc 8.8910 ms/op 7.9528 ms/op 1.12
processBlock altair 250000 vs - 7PWei - maxed ops 571.99 ms/op 393.77 ms/op 1.45
processBlock altair 250000 vs - 7PWei - average 216.24 ms/op 138.70 ms/op 1.56
epoch altair - 250000 vs - 7PWei - processInactivityUpdates 2.6245 s/op 2.1928 s/op 1.20
epoch altair - 250000 vs - 7PWei - processRewardsAndPenalties 1.1865 s/op 923.61 ms/op 1.28
epoch altair - 250000 vs - 7PWei - processParticipationFlagUpdates 498.33 ms/op 421.15 ms/op 1.18
processBlock phase0 250000 vs - 7PWei - maxed ops 245.41 ms/op 164.27 ms/op 1.49
processBlock phase0 250000 vs - 7PWei - average 33.075 ms/op 26.546 ms/op 1.25
epoch phase0 - 250000 vs - 7PWei - beforeProcessEpoch 1.8953 s/op 1.5224 s/op 1.24
epoch phase0 - 250000 vs - 7PWei - processRewardsAndPenalties 967.11 ms/op 595.18 ms/op 1.62
epoch phase0 - 250000 vs - 7PWei - processEffectiveBalanceUpdates 157.49 ms/op 92.626 ms/op 1.70
getAttestationDeltas - 250000 vs - 7PWei 126.54 ms/op 113.76 ms/op 1.11
processSlots - 250000 vs - 7PWei - 32 empty slots 3.5395 s/op 3.0137 s/op 1.17
shuffle list - 16384 els 17.554 ms/op 26.145 ms/op 0.67
shuffle list - 250000 els 247.63 ms/op 252.98 ms/op 0.98
getPubkeys - persistent - req 1000 vs - 250000 vc 19.987 us/op 17.315 us/op 1.15
BLS verify - blst-native 2.2993 ms/op 1.8592 ms/op 1.24
BLS verifyMultipleSignatures 3 - blst-native 4.6006 ms/op 3.8092 ms/op 1.21
BLS verifyMultipleSignatures 8 - blst-native 10.185 ms/op 8.2066 ms/op 1.24
BLS verifyMultipleSignatures 32 - blst-native 40.196 ms/op 32.535 ms/op 1.24
BLS aggregatePubkeys 32 - blst-native 50.213 us/op 40.318 us/op 1.25
BLS aggregatePubkeys 128 - blst-native 193.82 us/op 155.65 us/op 1.25
getAttestationsForBlock 223.59 ms/op 173.69 ms/op 1.29
validate gossip signedAggregateAndProof - struct 5.7018 ms/op 4.5049 ms/op 1.27
validate gossip signedAggregateAndProof - treeBacked 5.5845 ms/op 4.4803 ms/op 1.25
validate gossip attestation - struct 5.3435 ms/op 4.2890 ms/op 1.25
validate gossip attestation - treeBacked 2.7614 ms/op 2.2194 ms/op 1.24

by benchmarkbot/action

Copy link
Contributor

@dapplion dapplion left a comment

Choose a reason for hiding this comment

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

Awesome find! Thanks for taking a look

@dapplion dapplion merged commit 5e8b0bc into master Aug 13, 2021
@dapplion dapplion deleted the tuyen/fix-next-shuffling-active-indices branch August 13, 2021 13:51
@q9f q9f added prio-critical Drop everything to resolve this immediately. Examples: consensus bug, un-usable CLI status5-mergeready labels Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio-critical Drop everything to resolve this immediately. Examples: consensus bug, un-usable CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

beaconchain sync stuck on mainnet, pyrmont, and prater
3 participants