Skip to content

Track gas more appropriately prior to state access in specs #1867

@fselmo

Description

@fselmo

The specs currently charge_gas only after accounting for state access gas costs while accessing state at the same time, without knowing whether or not we have enough gas for the state access (e.g. we calculate access cost here, then proceed to read the account within access_delegation and is_account_alive, before charging gas here and making sure we had enough to access the account in the first place).

With the implementation for block-level access lists in eips/amsterdam/eip-7928, this revealed inconsistencies with how clients behave and what is read at what point across certain gas boundaries. This has been addressed, for the most part, within the logic in the EIP-7928 implementation branch (e.g., we check_gas here before to make sure we have enough gas for all "static" checks that don't require state access first, before accessing state). The need for these changes revealed a necessity for the specs to be correct across all forks when it comes to static checks / gas accounting prior to any state access.

These changes should separated from the EIP-7928 logic and PR'd to the development branch (likely forks/amsterdam) in an effort to agree on the design for this and apply it to all forks. Once the design is agreed upon for the active development banch, we should apply them across all forks and rebase them into EIP-7928, effectively replacing this patching of the logic that is currently there.


Updated TODO:

Metadata

Metadata

Assignees

Labels

A-spec-specsArea: Specification—The Ethereum specification itself (eg. `src/ethereum/*`)C-bugCategory: this is a bug, deviation, or other problem

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions