Skip to content

Missing test: SELFDESTRUCT-to-self no-op should not emit EIP-7708 log #2497

@benaadams

Description

@benaadams

Summary

Post-EIP-6780, SELFDESTRUCT to self when the contract was not created in the same transaction is a no-op — no destruction, no ETH movement. With EIP-7708 (transfer/burn logs) enabled, this no-op case should not emit any log since no value moves.

Coverage gap

There doesn't appear to be a spec test covering this scenario. We discovered this while working on Nethermind's Amsterdam (EIP-8037) support — we accidentally moved the EIP-7708 log emission from before to after the SELFDESTRUCT no-op guard, and no EEST test failed. Only a local unit test caught the regression.

Suggested test

  1. Deploy a contract with non-zero balance in block N
  2. In block N+1, call the contract which executes SELFDESTRUCT(self)
  3. Post-EIP-6780: selfdestruct_only_on_same_transaction = True, contract not created in same tx → no-op
  4. Assert: no EIP-7708 log is emitted in the receipt (no self-destruct log, no transfer log)
  5. Assert: contract balance is unchanged

This should be tested for any fork where both EIP-6780 and EIP-7708 are active.

Context

Nethermind PR: NethermindEth/nethermind#10697

Metadata

Metadata

Assignees

Labels

staleThe Issue/PR has not had any activity for 60 days. PRs will be automatically closed.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions