nim-eth
nim-eth copied to clipboard
Implement direct RLP hashing
Hashing of RLP is critical for execution client performance and will become even more important when we start using more efficient encodings than RLP in the client.
Currently, to compute the hash of an RLP-encoded item we first serialize the data to a seq[byte] then perform the hashing. This creates a short-lived memory allocation for every hash we compute which is unfortunate and unnecessary.
Instead, we should create a new RlpHashWriter type that keeps a hashing context open and constructs the hash on the fly without writing the bytes to a seq first.