Skip to content

Commit

Permalink
Update EIP-6206: fix discrepancy in stack height check JUMPF
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
pdobacz authored May 13, 2024
1 parent 7b973be commit bd42196
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion EIPS/eip-6206.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The first code section MUST have 0 inputs and be non-returning.
A new instruction, `JUMPF (0xe5)`, is introduced.

1. `JUMPF` has one immediate argument, `target_section_index`, encoded as a 16-bit unsigned big-endian value.
2. If the operand stack size exceeds `1024 - type[target_section_index].max_stack_height` (i.e. if the called function may exceed the global stack height limit), execution results in an exceptional halt. This guarantees that the target function does not exceed global stack height limit.
2. If the operand stack size exceeds `1024 - type[target_section_index].max_stack_height + type[target_section_index].inputs` (i.e. if the called function may exceed the global stack height limit), execution results in an exceptional halt. This guarantees that the target function does not exceed global stack height limit.
3. `JUMPF` sets `current_section_index` to `target_section_index` and `PC` to `0`, but does not change the return stack. Execution continues in the target section.
4. `JUMPF` costs 5 gas.
5. `JUMPF` neither pops nor pushes anything to the operand stack.
Expand Down

0 comments on commit bd42196

Please sign in to comment.