Skip to content

Etherlink: followup 11658

Pierre-Emmanuel CORNILLEAU requested to merge pec@evm@double_selfdestruct into master

What

Allow a contract marked to be deleted to still be called before final deletion.

Why

!11658 (merged) made sure SELFDESTRUCT only delete contract at the end of the execution. However, a check is done in execute_call to check for deletion. This check was important when contract were deleted immediatly, but is not relevant anymore.

Furthermore, a check from the test suite precisely target this behavior, by calling SELFDESTRUCT two time, and expect the cost of SELFDESTRUCT to be paid twice. cf refund_multimpleSuicideFiller.json

How

Just don't test if a contract is marked for deletion.

Manually testing the MR

One ore success in the test suite

stRefundTest_refund_multimpleSuicide_data_index_0_gas_index_0_value_index_0: Failure -> Success

A test was added to evm_execution. It checks that the contract was called twice by looking at the gas used.

cargo test -p evm-execution test::contract_that_selfdestruct_can_be_called_again_in_same_transaction

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 Pierre-Emmanuel CORNILLEAU

Merge request reports