EIP-7709: Read BLOCKHASH opcode from storage and adjust gas cost

Abstract

Adjust the BLOCKHASH opcode to read from storage, and increase its gas cost.

Motivation

The BLOCKHASH (0x40) opcode currently assumes that the client has stateful knowledge of the previous blocks, which is a blocker for stateless execution (e.g. in the context of Verkle). This EIP assumes that EIP-2935 has been implemented, and that blockhashes can be retrieved from the systems contract storage. By updating the behavior of BLOCKHASH (0x40) to directly read and serve from state through the system contract storage, we allow Verkle blocks to include a storage access witness, which will allow stateless execution.

The motivation behind the updated gas cost is to match the real cost of the operation, which is equivalent to an SLOAD.

Open Questions

  • When providing access witnesses. Should only the storage witness be provided, or also the account witness?
  • Related to the above, it has been mentioned that the storage slot that has been updated at the beginning of the block processing (i.e. the blockhash of the parent block) should be considered warm. Should it actually be considered warm? And should the corresponding account also be considered warm, or only the storage slot?
1 Like