-
Notifications
You must be signed in to change notification settings - Fork 6k
Update EIP-7069: Rename and update semantics #8287
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. |
EIPS/eip-7069.md
Outdated
| 7. Calculate the gas available to callee as caller's remaining gas reduced by `max(floor(gas/64), MIN_RETAINED_GAS)`. | ||
| 8. Fail with error if the gas available to callee at this point is less than `MIN_CALLEE_GAS`. | ||
| 9. If `value` is non-zero, fail lightly if the balance of the current account is less than `value`. | ||
| 10. Fail lightly if call stack depth equals `1024`. |
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.
What does "fail Lightly" mean? dose "Fail with error" mean revert and take all available gas and "fail lightly" mean fail consuming only already charged gas?
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 (except "Fail with error" is not a revert but an exceptional abort, I presume this was the original intention), I'll specify these.
But you've uncovered an interesting issue - what should be pushed to stack in this case (i.e. light failure)? For a light failure in EOFCREATE/TXCREATE we return 0 (with a different meaning), same for CREATE/CREATE2, but for revamped calls that would mean success.
I also see that evmone would return 0, so making a self note to amend this (I'm working on that now in parallel).
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.
Errata: there's many ways to name the "hard failure", this EIP has "halt with exceptional failure", I think consuming all gas is understood (EOF megaspec and other EIPs don't repeat this), so I'll leave it out.
For light failure I'll be specific.
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.
Proposing a resolution (3 on stack for light failure) 54f6dcd to push the discussion forward. WDYT?
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.
477e269 adheres to what we spoke about on the EOF implementers call - 1 as status code for light failure
EIPS/eip-7069.md
Outdated
| 7. Calculate the gas available to callee as caller's remaining gas reduced by `max(floor(gas/64), MIN_RETAINED_GAS)`. | ||
| 8. Halt with exceptional failure if the gas available to callee at this point is less than `MIN_CALLEE_GAS`. | ||
| 9. If `value` is non-zero, fail lightly if the balance of the current account is less than `value` (push `3` on the stack, only consume gas charged until this point). | ||
| 10. Fail lightly if call stack depth equals `1024` (push `3` on the stack, only consume gas charged until this point). |
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.
Call depth check is actually superseded by 63/64 rule, see Rationale.
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 you questioned the correctness of that initial removal of call depth check.
Isn't it a compatibility problem, that call-stack-depth-checking calls can alternate with non-checking ones in the call stack?
Why wasn't the call depth check removed already in legacy calls, if superseded by the 63/64 rule?
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.
for future reference - decided on the EOF Implementers call to keep it
- least change to legacy
- being cautious about the air-tightness of the (complex) gas-based 63/64 rule, and providing a simpler hard cap
- being open to gas limits which are huge for various use cases beyond mainnet
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.
(also I've updated the Rationale section to cover this)
c.f. ipsilon/eof#64 and ipsilon/eof#68
af154c7 to
a26d3a4
Compare
EIPS/eip-7069.md
Outdated
| 11c. `2` if the call has failed. | ||
| 11. Gas not used by the callee is returned to the caller. | ||
| 7. Calculate the gas available to callee as caller's remaining gas reduced by `max(floor(gas/64), MIN_RETAINED_GAS)`. | ||
| 8. Halt with exceptional failure if the gas available to callee at this point is less than `MIN_CALLEE_GAS`. |
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.
Why is this exceptional failure? Seems could be light failure
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.
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.
Changed as suggested here: 743a3fb
| 3a. Fail with error if the current frame is in `static-mode`. | ||
| 3b. Fail with error if the balance of the current account is less than `value`. | ||
| 3c. Charge `CALL_VALUE_COST` gas. | ||
| 2. Pop required arguments from stack, halt with exceptional failure on stack underflow. |
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.
It seems at this point EIP tries to maintain compatibility with both legacy and EOF, so maybe
| 2. Pop required arguments from stack, halt with exceptional failure on stack underflow. | |
| 2. Pop required arguments from stack, halt with exceptional failure on stack underflow. | |
| - *Note: When implemented in EOF, stack underflow check is done during stack validation, and runtime check is omitted.* |
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.
The idea is for this EIP to be fully legacy-complete and EOF-independent. EOF (Megaspec) lists the differences required it to be EOF-complete (which is lack of runtime stack underflow check and banning new opcodes in legacy).
Is there any other piece which is EOF-only in this EIP?
(this is just a question to your comment, I have no objections towards adding this note for completeness, and I'll add it)
Co-authored-by: Andrei Maiboroda <[email protected]>
40ee42a to
de40636
Compare
eth-bot
left a comment
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...
evmoneimplementation and most recent EOF conversations