EIPs icon indicating copy to clipboard operation
EIPs copied to clipboard

Update EIP-7702: selfdestruct opcode behaviour change in eip-7702

Open sudeepdino008 opened this issue 1 year ago • 5 comments

corresponds to this discord comment

sudeepdino008 avatar Aug 28 '24 06:08 sudeepdino008

File EIPS/eip-7702.md

Requires 1 more reviewers from @adietrichs, @lightclient, @samwilsn, @vbuterin

eth-bot avatar Aug 28 '24 06:08 eth-bot

This clarification makes sense and is in general how I anticipated the EIP to be implemented. Currently the EIP doesn't specify that the auth list accounts should be considered "created in this tx" as defined by EIP-6780:

A contract is considered created at the beginning of a create transaction or when a CREATE series operation begins execution (CREATE, CREATE2, and other operations that deploy contracts in the future). If a balance exists at the contract’s new address it is still considered to be a contract creation.

So given that definition, 7702 delegation designations are not "created" during the tx and therefore cannot be selfdestructed.

lightclient avatar Aug 28 '24 16:08 lightclient

  1. SELFDESTRUCT indeed need to be specified explicitly for 7702 - namely, remove the delegate at the end of the transaction, so that the EOA is left as EOA for future transactions.
  2. to prevent replay, it should NOT revert the nonce-bump

drortirosh avatar Sep 03 '24 13:09 drortirosh

I don't think SELFDESTRUCT should revert the deployment of a delegation designation. It isn't added to the list of "deployed contracts" during the tx for a reason.

lightclient avatar Sep 03 '24 13:09 lightclient

Suggestion for two cases that the tests should cover:

  1. Set code transaction creates delegation (originally to empty account), same transaction creates contract at delegate address, then calls the delegated account, the code executes SELFDESTRUCT.
  2. Delegation exists in prestate, regular transaction creates contract at delegate address, then calls the delegated account, the code executes SELFDESTRUCT.

gumb0 avatar Sep 10 '24 10:09 gumb0

I've been out of loop on this for a while. I suppose we should merge this PR? There's been no change on this behavior.

sudeepdino008 avatar Apr 15 '25 05:04 sudeepdino008