Skip to content

Draft: EVM: add accessed_storage_keys to handler

Context

Add accessed_storage_keys to the transaction layer data in the handler. This is "the easy part" of EIP-2929. I work on this in relation to failing regression test named sstoreGas, but this fix, gave some 38 succeeding tests in total. Also, I think it gives a hint on what we can do to make SSTORE and SLOAD go faster - use A BTreeMap in AccessedStorage (instead of a BTreeSet) and store relevant data for each location there (such as original value + optionally a new value if any transaction wrote to said location). At the end of the toplevel transaction we can write all changes to durable storage in one go.

For now this fix only changes how we calculate gas.

Manually testing the MR

Use the evm-evaluation-assessor and test sstoreGas. It succeeds now.

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Thomas Pecseli

Merge request reports