-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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-3540: Move to Review #8152
Conversation
✅ All reviewers have approved. |
For an EOF contract: | ||
- Execution starts at the first byte of code section 0, and `pc` is set to 0. | ||
- `pc` is scoped to the executing code section | ||
- `CODESIZE`, `CODECOPY`, `EXTCODESIZE`, `EXTCODECOPY`, `EXTCODEHASH`, `GAS` are rejected by validation in EOF contracts, with no replacements |
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 think we should either remove this, or have a full list of deprecated instructions. But it should be in EIP-3670, so maybe remove.
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.
After some deliberation, I decided to have the deprecations accompany the replacement definitions wherever possible, and here list all the deprecations without replacements. The EIPs also kinda followed this model so far, so retaining this should give a smaller diff. But mostly, I think it reads easier, if the legacy and EOF logical counterparts are nearby.
But that's not a strong opinion, I spent quite a lot of time juggling these alternatives, all have pros and cons
369b094
to
4298488
Compare
Co-authored-by: Andrei Maiboroda <[email protected]>
4298488
to
73d5d13
Compare
EIPS/eip-3540.md
Outdated
|
||
(*Remark:* Due to [EIP-4750](./eip-4750.md), `JUMP` and `JUMPI` are disabled and therefore are not discussed in relation to EOF.) | ||
- Execution starts at the first byte of code section 0, and PC is set to 0. | ||
- `PC` is scoped to the executing code section |
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.
Probably this also can be removed.
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.
right, but isn't it a remark on how the context variable PC works, rather than opcode? I never was really sure. If you think opcode - let's remove. Actually, I think EIP-4750 elaborates enough on how PC works as a context variable, so I guess we can remove anyway.
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 thought so too at first, but it's next to the list of what happens to other opcodes, so very much looks like about opcode too.
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.
088f5e2 a final check on this pls. I think this leaves PC out completely as irrelevant, making 3540 define how EOF would have worked without CALLF/RETF (only 0th code section executes), which I think is coherent.
When you mark a draft ready, it often doesn't fully trigger the EIP bot. |
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...
First step to update to be in sync with Megaspec.
Opening as draft first to get a round of reviews on these changes, then update at least the EIP-7480 and add the CREATE3/CREATE4 EIP to keep references working. (EDIT: both done, CREATE3/4 EIP is EIP-7620)
Let's focus the first round of reviews on overall structure and scope of this doc, and also any potential issues with the spec itself, which may come to mind when looking through these changes -- if anything looks suspicious here please report.
Note that many of the removed portions concern contract creation which
will be described from ground up in a new EIP (current specification is inside the Megaspecis EIP-7620).