trie/bintrie: fix endianness in code chunk key computation

This commit is contained in:
Guillaume Ballet 2026-02-26 14:58:58 +01:00
parent 8a4345611d
commit 340286acf4

View file

@ -384,7 +384,7 @@ func (t *BinaryTrie) UpdateContractCode(addr common.Address, codeHash common.Has
if groupOffset == 0 /* start of new group */ || chunknr == 0 /* first chunk in header group */ {
values = make([][]byte, StemNodeWidth)
var offset [HashSize]byte
binary.LittleEndian.PutUint64(offset[24:], chunknr+128)
binary.BigEndian.PutUint64(offset[24:], chunknr+128)
key = GetBinaryTreeKey(addr, offset[:])
}
values[groupOffset] = chunks[i : i+HashSize]