HomeSource World

core/types, rlp: optimize derivesha (#21728)

Description

core/types, rlp: optimize derivesha (#21728)

This PR contains a minor optimization in derivesha, by exposing the RLP
int-encoding and making use of it to write integers directly to a
buffer (an RLP integer is known to never require more than 9 bytes
total). rlp.AppendUint64 might be useful in other places too.

The code assumes, just as before, that the hasher (a trie) will copy the
key internally, which it does when doing keybytesToHex(key).

Co-authored-by: Felix Lange <fjl@twurst.com>

Details

Provenance
Martin Holst Swende <martin@swende.se>Authored on Wed, Nov 4, 6:29 PM
GitHub <noreply@github.com>Committed on Wed, Nov 4, 6:29 PM
Parents
rGETH36bb7ac083c3: cmd/devp2p/internal/ethtest: add correct chain files and improve test output…
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGETH175506e7fd96: core/types, rlp: optimize derivesha (#21728) (authored by Martin Holst Swende <martin@swende.se>).Wed, Nov 4, 6:29 PM