Skip to content

Commit

Permalink
make delegation designator opaque
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Oct 24, 2024
1 parent 1ec6ed7 commit 3dda4c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions EIPS/eip-7702.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ requires: 2, 161, 1052, 2718, 2929, 2930, 3541, 3607

## Abstract

Add a new transaction type that adds a list of `[chain_id, address, nonce, y_parity, r, s]` authorization tuples. For each tuple, write a delegation designator `(0xef0100 ++ address)` to the signing account's code. All code reading operations must load the code pointed to by the designator.
Add a new transaction type that adds a list of `[chain_id, address, nonce, y_parity, r, s]` authorization tuples. For each tuple, write a delegation designator `(0xef0100 ++ address)` to the signing account's code. All code executing operations must load the code pointed to by the designator.

## Motivation

Expand Down Expand Up @@ -86,9 +86,9 @@ If transaction execution results in failure (any exceptional condition or code r

##### Delegation Designation

The delegation designation uses the banned opcode `0xef` from [EIP-3541](./eip-3541.md) to designate the code has a special purpose. This designator requires all code executing operations to follow the address pointer to get the account's executable code. The following instructions are impacted: `CALL`, `CALLCODE`, `STATICCALL`, `DELEGATECALL`, as well as transactions with `destination` targeting the code with delegation designation.
The delegation designation uses the banned opcode `0xef` from [EIP-3541](./eip-3541.md) to designate the code has a special purpose. This designator requires all code executing operations to follow the address pointer to get the account's executable code, and requires all other code reading operations to act only on the first 2 bytes of the designator (`0xef01`). The following instructions are impacted: `EXTCODESIZE`, `EXTCODECOPY`, `EXTCODEHASH`, `CALL`, `CALLCODE`, `STATICCALL`, `DELEGATECALL`, as well as transactions with `destination` targeting the code with delegation designation.

For example, a `CALL` to an `authority` with a delegation designation to `address` would load the code from `address` and execute it in the context of `authority`.
For example, `EXTCODESIZE` would return `2` (the size of `0xef01`) instead of `23` which would represent the delegation designation, `EXTCODEHASH` would return `0xeadcdba66a79ab5dce91622d1d75c8cff5cff0b96944c3bf1072cd08ce018329` (`keccak256(0xef01)`), and `CALL` would load the code from `address` and execute it in the context of `authority`.

In case a delegation designator points to a precompile address, retrieved code is considered empty and `CALL`, `CALLCODE`, `STATICCALL`, `DELEGATECALL` instructions targeting this account will execute empty code, i.e. succeed with no execution given enough gas.

Expand Down

0 comments on commit 3dda4c9

Please sign in to comment.