Skip to content
Merged
Changes from all 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
2 changes: 2 additions & 0 deletions EIPS/eip-7702.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ The delegation designation uses the banned opcode `0xef` from [EIP-3541](./eip-3

For example, `EXTCODESIZE` would return `23` (the size of `0xef0100 || address`), `EXTCODEHASH` would return `keccak256(0xef0100 || address)`, and `CALL` would load the code from `address` and execute it in the context of `authority`.

`CODESIZE` and `CODECOPY` instructions operate on executable code, as before. *Note that in a delegated execution `CODESIZE` and `CODECOPY` produce different result comparing to `EXTCODESIZE` and `EXTCODECOPY` of execution target.*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not realize this before, but this is the first time we have a case where CODECOPY/CODESIZE vs EXTCODECOPY/EXTCODESIZE on itself (ADDRESS) returns something different, right? (Except in the context of a contract creation frame)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it also answers the question "Am I being run as a delegate" - which is a useful security feature.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is true. CODECOPY copies the code that is dynamically running whereas EXTCODECOPY on ADDRESS copies the account code, these can already differ prior to EIP-7702 due to DELEGATECALL or CALLCODE.


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.

In case a delegation designator points to another designator, creating a potential chain or loop of designators, clients must retrieve only the first code and then stop following the designator chain.
Expand Down
Loading