-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Update EIP-7702: Clarify CODE* operations behavior #9250
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
Conversation
✅ All reviewers have approved. |
fc19724
to
817f1e6
Compare
@@ -90,6 +90,8 @@ The delegation designation uses the banned opcode `0xef` from [EIP-3541](./eip-3 | |||
|
|||
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`. | |||
|
|||
`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.* |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm
@lightclient Not sure what's the CI failure about |
Can we retrigger? (Maybe this comment does it?) |
817f1e6
to
8454802
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All Reviewers Have Approved; Performing Automatic Merge...
Clarify that
CODE*
operate on the code being executed, and not on the delegation designator.(Tests' expectations agree with this.)
This clarification is motivated by confusion observed in this document: https://hackmd.io/5kcrdKgaQHSjrQ9MtAlBfg?comment=37baf7a2-fd97-4e3a-9972-e4a86c92ce8b