Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions EIPS/eip-7702.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ The [EIP-2718](./eip-2718.md) `ReceiptPayload` for this transaction is `rlp([sta

At the start of executing the transaction, after incrementing the sender's nonce, for each `[chain_id, address, nonce, y_parity, r, s]` tuple do the following:

1. `authority = ecrecover(keccak(MAGIC || rlp([chain_id, address, nonce])), y_parity, r, s]`
2. Verify the chain id is either 0 or the chain's current ID.
1. Verify the chain id is either 0 or the chain's current ID.
2. `authority = ecrecover(keccak(MAGIC || rlp([chain_id, address, nonce])), y_parity, r, s]`
sudeepdino008 marked this conversation as resolved.
Show resolved Hide resolved
3. Add `authority` to `accessed_addresses` (as defined in [EIP-2929](./eip-2929.md).)
4. Verify the code of `authority` is either empty or already delegated.
5. Verify the nonce of `authority` is equal to `nonce`.
Expand Down Expand Up @@ -120,6 +120,12 @@ The main families of instructions where a ban was considered were storage relate

Creation instructions were considered for a ban on other similar EIPs, however because this EIP allows EOAs to spend value intra-transaction, the concern with bumping the nonce intra-transaction and invalidating pending transactions is not significant. A neat byproduct of this is that by combining EIP-7702 and CREATE2 it will be possible to commit to deploy specific bytecode to an address without committing to any fee market parameters. This solves the long standing issue of universal cross-chain contract deployment.

### behaviour of SELFDESTRUCT opcode
sudeepdino008 marked this conversation as resolved.
Show resolved Hide resolved

[EIP-6780](./eip-6780.md) restricted SELFDESTRUCT opcode behaviour, allowing account data deletion only if the account was created in the same transaction. A 7702 transaction essentially allows code to be assigned to an EOA. The subsequent execution of such code in the same transaction can cause the EOA to selfdestruct, causing account data deletion, leading to issues like transaction replay.

To prevent problems arising from EOAs selfdestructing, this EIP updates the opcode behaviour, by not deleting account data for EOAs with delegated designation.

### Signature structure

The signature scheme in this EIP supports flexible design patterns, allowing for both full delegation to `address` and more protected delegations to `address`.
Expand Down
Loading