lodestar icon indicating copy to clipboard operation
lodestar copied to clipboard

feat: improve prepareNextEpoch

Open twoeths opened this issue 1 year ago • 0 comments

Motivation

Reduce prepareNextEpoch time for lodestar

Description

  • use hashtree for batch hash implemented in ssz
    • copy the implementation of ListValidatorTreeViewDU from the ssz branch, the main thing is to compute validators' roots in batch during commit() phase
    • batch hash validators, execute HashComputation[] in batch
  • avoid memory allocation:
    • no tree creation when we modify/add validator
    • reuse balances tree

twoeths avatar Oct 17 '24 02:10 twoeths