7c0b4d28d2
Calculating rewards/penalties is slow due to how we compute sets of attestations validators then use the sets for inclusion checks, to see who attested. The dominant function during validated block processing / epoch processing is hash set building and lookup. This PR inverts the flow by removing the sets and creating a single large validator status list, then applying all relevant state attestations, then updating rewards and penalties. This provides a 10x speedup to epoch processing which in turn speeds up both empty slot and block processing - for example, on startup, we replay all non-finalized blocks to prime fork choice - the same when validating attestations or replaying states on reorg. |
||
---|---|---|
.. | ||
README.md | ||
epoch_utils.nim | ||
eth2-finalization.png | ||
justification_finalization_helpers.nim | ||
test_process_justification_and_finalization.nim |