EIPs icon indicating copy to clipboard operation
EIPs copied to clipboard

Add EIP: Double speed for hash_tree_root

Open etan-status opened this issue 1 year ago • 2 comments

etan-status avatar Oct 23 '24 15:10 etan-status

✅ All reviewers have approved.

eth-bot avatar Oct 23 '24 15:10 eth-bot

The commit dc941835155b531c76dafa419c22393890963572 (as a parent of 76bcc8338588b882c745fd62e0e55309d2875046) contains errors. Please inspect the Run Summary for details.

github-actions[bot] avatar Oct 23 '24 16:10 github-actions[bot]

@twoeths could you help review this new EIP PR having work considerably on ssz sha256 internals

g11tech avatar Oct 30 '24 18:10 g11tech

the change makes a lot of sense to me. For lodestar on holesky, it takes ~530ms for hash_tree_root on epoch transition with wasm sha256 and going to be 130ms - 150ms with hashtree so this helps a lot. I'm curious to know the hash_tree_root time at epoch transition for other clients, do you have this statistic for Nimbus @etan-status ?

twoeths avatar Oct 31 '24 04:10 twoeths

Per block, the main effort is for the epoch participation flags. On epoch transition, the balance changes increase the load. Both of these scale with number of validators. I don't have exact timings for Nimbus, but if necessary we should create a reference state with 2 epochs worth of blocks for proper measurement. I have added this as an open item to the Ethereum Magicians thread.

etan-status avatar Oct 31 '24 12:10 etan-status

I think we need to evaluate this in a post-MaxEB world. I suspect, it is not going to be a significant improvement when less hashes change in the merkle tree. It is quite an invasive change and benefit is not super obvious imo. we could also make use of different hash functions such as blake3 which is also consistently faster than sha256 (14x)

Giulio2002 avatar Oct 31 '24 20:10 Giulio2002