-
Notifications
You must be signed in to change notification settings - Fork 2
Description
If a storage slot of a contract has not been written to, eth_getStorageAt returns an empty byte array instead of 32 zero-bytes.
This is incorrect semantics for EVM smart contracts where a storage slot always has logically 256 bits and a slot that is not represented in the trie is interpreted to have all zero bits.
Discussion
It is not clear whether we should use the same semantics for PVM contracts. If a PVM contract is written in Solidity, then this is indeed right. If it is written in Rust, then a slot is not necessarily 32 bytes and would still represent a zero value when not in the trie yet – just of an unknown byte length.
Interacting with a PVM contract that does not use Ethereum standards via the Ethereum RPC is not meaningful in my opinion and therefore it is safe to fall back to Ethereum semantics and also interpret an empty slot as a 32 byte zero value.