go-verkle icon indicating copy to clipboard operation
go-verkle copied to clipboard

Measure performance with only 2 account header leaves instead of 5

Open gballet opened this issue 3 years ago • 1 comments

In verkle trees, the account header consists of 5 leaves (version, balance, nonce, code keccak and code size), each of which takes 32 bytes. This means that calculating the commitment of a value costs at least 10 exponentiations (each value is split in 2 16-bytes value). Most of these values do not require 32 bytes (version, nonce, code size, let alone balance), and it would therefore be possible to pack some of them into a single 32-byte value in order to save on exponentiation costs.

gballet avatar Sep 14 '22 12:09 gballet

Haven't done it yet, but it is unlikely to improve anything: given the structure of a LEafNode, most values end up being 0s. Grouping everything together will save space, but it will not save computation time as data is simply flushed around.

gballet avatar Sep 26 '22 19:09 gballet

This is done as part of the Nyota update to the spec.

gballet avatar Aug 28 '24 14:08 gballet