Conversation
spec/eof.md
Outdated
| - Stack validation of `JUMPF` depends on "non-returning" status of target section | ||
| - `JUMPF` into returning section (can be only from returning section): `stack_height_min == stack_height_max == type[current_section_index].outputs + type[target_section_index].inputs - type[target_section_index].outputs` | ||
| - `JUMPF` into returning section (can be only from returning section): `stack_height_min == stack_height_max == type[current_section_index].outputs + type[target_section_index].inputs - type[target_section_index].outputs`. | ||
| **NOTE**: This means `JUMPF` must ensure target's inputs, must ensure its own outputs (to return control), but must take into account that the target section may leave extra output items after it finishes, so it may need that many fewer items on the operand stack |
There was a problem hiding this comment.
"must ensure" is duplicated here
Consider taking explanation from the EIP:
This means that target section can output less stack elements than the original code section called by the top element on the return stack, if the current code section leaves the delta
type[current_section_index].outputs - type[target_section_index].outputselement(s) on the stack.
There was a problem hiding this comment.
Generally EIPs have more explanations than mega-spec, and I'm not sure we have to repeat everything here.
There was a problem hiding this comment.
yeah, I'm not a fan of that particular explanation, not sure if what I proposed is better though :/.
As to:
Generally EIPs have more explanations than mega-spec, and I'm not sure we have to repeat everything here.
I believe it is useful. Some people still prefer to read the mega-spec and should not be confused by it. EIPs have Rationale and Motivation, which we do not repeat, but I guess some more unobvious passages of the spec will benefit from extra prose
There was a problem hiding this comment.
I updated the wording a little bit. LMK if you prefer the EIP one after all
7098d9b to
73e3b7d
Compare
No description provided.