Skip to content

Commit 70dc409

Browse files
committed
Rename RETURNCONTRACT to RETURNCODE
1 parent 5cb6ec7 commit 70dc409

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

spec/eof.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ pre_deploy_data_section | static_aux_data | dynamic_aux_data
8282
```
8383

8484
where:
85-
- `aux_data` is the data which is appended to `pre_deploy_data_section` on `RETURNCONTRACT` instruction [see New Behavior](#new-behavior).
86-
- `static_aux_data` is a subrange of `aux_data`, which size is known before `RETURNCONTRACT` and equals `pre_deploy_data_size - len(pre_deploy_data_section)`.
85+
- `aux_data` is the data which is appended to `pre_deploy_data_section` on `RETURNCODE` instruction [see New Behavior](#new-behavior).
86+
- `static_aux_data` is a subrange of `aux_data`, which size is known before `RETURNCODE` and equals `pre_deploy_data_size - len(pre_deploy_data_section)`.
8787
- `dynamic_aux_data` is the remainder of `aux_data`.
8888

8989
`data_size` in the deployed container header is also updated to be equal `len(data_section)`.
@@ -242,8 +242,8 @@ The following instructions are introduced in EOF code:
242242
- behavior on `accessed_addresses` and address colission is same as `CREATE2` (rules for `CREATE2` from [EIP-684](https://eips.ethereum.org/EIPS/eip-684) and [EIP-2929](https://eips.ethereum.org/EIPS/eip-2929) apply to `EOFCREATE`)
243243
- an unsuccesful execution of initcode results in pushing `0` onto the stack
244244
- can populate returndata if execution `REVERT`ed
245-
- a successful execution ends with initcode executing `RETURNCONTRACT{deploy_container_index}(aux_data_offset, aux_data_size)` instruction (see below). After that:
246-
- load deploy-contract from EOF subcontainer at `deploy_container_index` in the container from which `RETURNCONTRACT` is executed
245+
- a successful execution ends with initcode executing `RETURNCODE{deploy_container_index}(aux_data_offset, aux_data_size)` instruction (see below). After that:
246+
- load deploy-contract from EOF subcontainer at `deploy_container_index` in the container from which `RETURNCODE` is executed
247247
- concatenate data section with `(aux_data_offset, aux_data_offset + aux_data_size)` memory segment and update data size in the header
248248
- let `deployed_code_size` be updated deploy container size
249249
- if `deployed_code_size > MAX_CODE_SIZE` instruction exceptionally aborts
@@ -264,7 +264,7 @@ The following instructions are introduced in EOF code:
264264
- in addition to this, checks if the initcode container has its `len(data_section)` equal to `data_size`, i.e. data section content is exactly as the size declared in the header (see [Data section lifecycle](#data-section-lifecycle))
265265
- fails (returns 0 on the stack) if any of those was invalid
266266
- caller’s nonce is not updated and gas for initcode execution is not consumed. Only `TXCREATE` constant gas was consumed
267-
- `RETURNCONTRACT (0xee)` instruction
267+
- `RETURNCODE (0xee)` instruction
268268
- loads `uint8` immediate `deploy_container_index`
269269
- pops two values from the stack: `aux_data_offset`, `aux_data_size` referring to memory section that will be appended to deployed container's data
270270
- cost 0 gas + possible memory expansion for aux data
@@ -337,14 +337,14 @@ The following instructions are introduced in EOF code:
337337
- `EOFCREATE` `initcontainer_index` must be less than `num_container_sections`
338338
- `EOFCREATE` the subcontainer pointed to by `initcontainer_index` must have its `len(data_section)` equal `data_size`, i.e. data section content is exactly as the size declared in the header (see [Data section lifecycle](#data-section-lifecycle))
339339
- `EOFCREATE` the subcontainer pointed to by `initcontainer_index` *must not* contain either a `RETURN` or `STOP` instruction.
340-
- `RETURNCONTRACT` `deploy_container_index` must be less than `num_container_sections`
341-
- `RETURNCONTRACT` the subcontainer pointed to `deploy_container_index` *must not* contain a `RETURNCONTRACT` instruction.
340+
- `RETURNCODE` `deploy_container_index` must be less than `num_container_sections`
341+
- `RETURNCODE` the subcontainer pointed to `deploy_container_index` *must not* contain a `RETURNCODE` instruction.
342342
- `DATALOADN`'s `immediate + 32` must be within `pre_deploy_data_size` (see [Data Section Lifecycle](#data-section-lifecycle))
343343
- the part of the data section which exceeds these bounds (the `dynamic_aux_data` portion) needs to be accessed using `DATALOAD` or `DATACOPY`
344344
- no unreachable code sections are allowed, i.e. every code section can be reached from the 0th code section with a series of CALLF / JUMPF instructions, and section 0 is implicitly reachable.
345-
- it is an error for a container to contain both `RETURNCONTRACT` and either of `RETURN` or `STOP`.
345+
- it is an error for a container to contain both `RETURNCODE` and either of `RETURN` or `STOP`.
346346
- it is an error for a subcontainer to never be referenced in its parent container
347-
- it is an error for a given subcontainer to be referenced by both `RETURNCONTRACT` and `EOFCREATE`
347+
- it is an error for a given subcontainer to be referenced by both `RETURNCODE` and `EOFCREATE`
348348

349349
## Stack Validation
350350

@@ -357,7 +357,7 @@ The following instructions are introduced in EOF code:
357357
- *Forward jump* refers to any of `RJUMP`/`RJUMPI`/`RJUMPV` instruction with relative offset greater than or equal to 0. *Backwards jump* refers to any of `RJUMP`/`RJUMPI`/`RJUMPV` instruction with relative offset less than 0, including jumps to the same jump instruction (e.g. `RJUMP(-3)`)
358358
- Terminating instructions:
359359
- ending function execution: `RETF`, `JUMPF`,
360-
- ending whole EVM execution: `STOP`, `RETURN`, `RETURNCONTRACT`, `REVERT`, `INVALID`.
360+
- ending whole EVM execution: `STOP`, `RETURN`, `RETURNCODE`, `REVERT`, `INVALID`.
361361
- For each instruction in the code the operand stack height bounds are recorded as `stack_height_min` and `stack_height_max`. Instructions are scanned in a single linear pass over the code.
362362
- first instruction has `stack_height_min = stack_height_max = types[current_section_index].inputs`.
363363

0 commit comments

Comments
 (0)