EVM/Exec: clear contract storage before execution on contract creation
Context
In a situation where a smart contract was deleted (SELFDESTRUCT), its code, balance and nonce are set to zero, but its storage remains unchanged. When a contract is created at the same address the storage must be cleared before its execution, a small scenario with anvil should showcase this behaviour. There's a test in the suite that covers this issue as well, see ethereum/tests/GeneralStateTests/Shanghai/stSStoreTest/InitCollision.json.
Manually testing the MR
Play with the evm-evaluation-assessor:
stSStoreTest_InitCollision_data_index_3_gas_index_0_value_index_0: Failure -> Success
stSStoreTest_InitCollision_data_index_1_gas_index_0_value_index_0: Failure -> Success
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.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Rodi-Can Bozman