You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The type used for the storage trie is Trie[Bytes, U256]. However the yellow paper specifies that
storageRoot: A 256-bit hash of the root node of a
Merkle Patricia tree that encodes the storage contents of the account (a mapping between 256-bit
integer values), encoded into the trie as a mapping
from the Keccak 256-bit hash of the 256-bit integer
keys to the RLP-encoded 256-bit integer values.
The hash is formally denoted σ[a]s.
The storage content is implemented as "(a mapping between 256-bit integer values)" - which means the proper key type should be Bytes32, and not Bytes, as the bit-length of the keys is always 256.
When popping the key from the stack in sload, we convert it to a byte32.
Metadata
What was wrong?
The type used for the storage trie is Trie[Bytes, U256]. However the yellow paper specifies that
The storage content is implemented as "(a mapping between 256-bit integer values)" - which means the proper key type should be Bytes32, and not Bytes, as the bit-length of the keys is always 256.
When popping the key from the stack in
sload
, we convert it to a byte32.execution-specs/src/ethereum/cancun/vm/instructions/storage.py
Line 49 in 4c7eaa8
Sources
Yellow Paper, page 4
The text was updated successfully, but these errors were encountered: