Skip to content

EVM: zero codehash for non-existing account

Hantang Sun requested to merge hantang@evm@fix_stExtCodeHash2 into master

Context

Discovered this bug when trying to fix stExtCodeHash.

For EXTCODEHASH, as specified on https://www.evm.codes/#3f?fork=shanghai, the opcode returns "hash of the chosen account's code, the empty hash (0xc5d24601...) if the account has no code, or 0 if the account does not exist or has been destroyed."(Reference can also be found in section 4.1 of the Ethereum yellow paper) We didn't consider the case where the account does not exist or has been destroyed. This MR fixes the problem

Manually testing the MR

Run the evaluation test. Number of successful test increase from to 16073 to 16111

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 Hantang Sun

Merge request reports