Skip to content

Commit

Permalink
Remove rerminating instructions validation (ethereum#6168)
Browse files Browse the repository at this point in the history
  • Loading branch information
smartprogrammer93 authored Dec 19, 2022
1 parent 1377f1a commit e40865d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions EIPS/eip-4750.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,9 @@ If the code is valid EOF1, the following execution rules apply:
In addition to container format validation rules above, we extend code section validation rules (as defined in [EIP-3670](./eip-3670.md)).

1. Code validation rules of EIP-3670 are applied to every code section.
2. List of allowed *terminating instructions* in EIP-3670 is extended to include `RETF` and `JUMPF`. (*Note that `CALLF` and `JUMPF`, like other instructions with immediates, cannot be truncated.*)
3. Code section is invalid in case an immediate argument of any `CALLF` or `JUMPF` is greater than or equal to the total number of code sections.
4. Code section is invalid in case an immediate argument of any `JUMPF` is such that `type[callee_section_index].outputs != type[caller_section_index].outputs`, i.e. it is allowed to only jump to functions with the same output type.
5. `RJUMP`, `RJUMPI` and `RJUMPV` immediate argument value (jump destination relative offset) validation:
2. Code section is invalid in case an immediate argument of any `CALLF` or `JUMPF` is greater than or equal to the total number of code sections.
3. Code section is invalid in case an immediate argument of any `JUMPF` is such that `type[callee_section_index].outputs != type[caller_section_index].outputs`, i.e. it is allowed to only jump to functions with the same output type.
4. `RJUMP`, `RJUMPI` and `RJUMPV` immediate argument value (jump destination relative offset) validation:
1. Code section is invalid in case offset points to a position outside of section bounds.
2. Code section is invalid in case offset points to one of two bytes directly following `CALLF` or `JUMPF` instruction.

Expand Down

0 comments on commit e40865d

Please sign in to comment.