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:
The specs currently
charge_gasonly 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:
eips/amsterdam/eip-7928(includes gas accounting changes) intoforks/amsterdamethereum/forks/amsterdamas the "template" (closed by fix(specs): backportcheck_gasbefore state access boundaries from Amsterdam #2903)