-
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
eip-2315: updated spec and examples #2576
Conversation
|-------|-------------|------|-----------|-----------| | ||
| 0 | PUSH1 | 3 | [] | [] | | ||
| 2 | JUMPSUB | 8 | [4] | [] | | ||
| 4 | BEGINSUB | 1 | [] | [ 2] | |
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.
Should it not be [3]
on RStack here?
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.
Ah, right. So the geth-implementation currently pushes the pc
, and then jumps to +1
from there. Which is not what the spec says.
|-------|-------------|------|-----------|-----------| | ||
| 0 | PUSH9 | 3 | [] | [] | | ||
| 10 | JUMPSUB | 8 | [12] | [] | | ||
| 12 | BEGINSUB | 1 | [] | [10] | |
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.
and [11]
here?
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. These were all generated by the actual geth evm, so I'll regenerate them when I update the code
6 7 RETURNSUB [] [1] | ||
7 5 BEGINSUB [] [1] | ||
8 6 RETURNSUB [] [1] | ||
Error: at pc=0, op=RETURNSUB: evm: invalid retsub |
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 know there is no firm convention around EVM errors yet (even though that would be nice!), but I would probably call this a stack underflow instead of invalid retsub
.
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.
We already have a stack underflow, so I wanted a different message. However, it's an implementation detail in geth
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.
okok, if the intention is to make a new error msg, then that seems appropriate.
Co-Authored-By: Andrei Maiboroda <[email protected]>
Co-Authored-By: MrChico <[email protected]>
* eip-2315: updated spec and examples * eip-2315: formatting nits * Update EIPS/eip-2315.md * Update EIPS/eip-2315.md Co-Authored-By: Andrei Maiboroda <[email protected]> * Update EIPS/eip-2315.md Co-Authored-By: MrChico <[email protected]> Co-authored-by: Andrei Maiboroda <[email protected]> Co-authored-by: MrChico <[email protected]>
* eip-2315: updated spec and examples * eip-2315: formatting nits * Update EIPS/eip-2315.md * Update EIPS/eip-2315.md Co-Authored-By: Andrei Maiboroda <[email protected]> * Update EIPS/eip-2315.md Co-Authored-By: MrChico <[email protected]> Co-authored-by: Andrei Maiboroda <[email protected]> Co-authored-by: MrChico <[email protected]>
* eip-2315: updated spec and examples * eip-2315: formatting nits * Update EIPS/eip-2315.md * Update EIPS/eip-2315.md Co-Authored-By: Andrei Maiboroda <[email protected]> * Update EIPS/eip-2315.md Co-Authored-By: MrChico <[email protected]> Co-authored-by: Andrei Maiboroda <[email protected]> Co-authored-by: MrChico <[email protected]>
This PR changes 2315. I've had some discussions with @gcolvin about this, and he asked me to take co-authorship over 2315 and try to get the spec in order.
This PR changes a couple of things:
return_stack
,end-of-stack
prefilled item on thereturn_stack