Skip to content

Commit 94cb45b

Browse files
committed
Rename RETURNCONTRACT to RETURNCODE
1 parent 62ef1bf commit 94cb45b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

spec/eof.md

+12-12
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)`.
@@ -141,8 +141,8 @@ Creation transactions (tranactions with empty `to`), with `data` containing EOF
141141
5. `calldata` part of transaction `data` that follows `initcontainer` is treated as calldata to pass into the execution frame
142142
6. execute the container and deduct gas for execution
143143
1. Calculate `new_address` as `keccak256(sender || sender_nonce)[12:]`
144-
2. A successful execution ends with initcode executing `RETURNCONTRACT{deploy_container_index}(aux_data_offset, aux_data_size)` instruction (see below). After that:
145-
- load deploy-contract from EOF subcontainer at `deploy_container_index` in the container from which `RETURNCONTRACT` is executed
144+
2. A successful execution ends with initcode executing `RETURNCODE{deploy_container_index}(aux_data_offset, aux_data_size)` instruction (see below). After that:
145+
- load deploy-contract from EOF subcontainer at `deploy_container_index` in the container from which `RETURNCODE` is executed
146146
- concatenate data section with `(aux_data_offset, aux_data_offset + aux_data_size)` memory segment and update data size in the header
147147
- let `deployed_code_size` be updated deploy container size
148148
- if `deployed_code_size > MAX_CODE_SIZE` instruction exceptionally aborts
@@ -208,15 +208,15 @@ The following instructions are introduced in EOF code:
208208
- 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`)
209209
- an unsuccesful execution of initcode results in pushing `0` onto the stack
210210
- can populate returndata if execution `REVERT`ed
211-
- a successful execution ends with initcode executing `RETURNCONTRACT{deploy_container_index}(aux_data_offset, aux_data_size)` instruction (see below). After that:
212-
- load deploy-contract from EOF subcontainer at `deploy_container_index` in the container from which `RETURNCONTRACT` is executed
211+
- a successful execution ends with initcode executing `RETURNCODE{deploy_container_index}(aux_data_offset, aux_data_size)` instruction (see below). After that:
212+
- load deploy-contract from EOF subcontainer at `deploy_container_index` in the container from which `RETURNCODE` is executed
213213
- concatenate data section with `(aux_data_offset, aux_data_offset + aux_data_size)` memory segment and update data size in the header
214214
- let `deployed_code_size` be updated deploy container size
215215
- if `deployed_code_size > MAX_CODE_SIZE` instruction exceptionally aborts
216216
- set `state[new_address].code` to the updated deploy container
217217
- push `new_address` onto the stack
218218
- deduct `200 * deployed_code_size` gas
219-
- `RETURNCONTRACT (0xee)` instruction
219+
- `RETURNCODE (0xee)` instruction
220220
- loads `uint8` immediate `deploy_container_index`
221221
- 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
222222
- cost 0 gas + possible memory expansion for aux data
@@ -289,14 +289,14 @@ The following instructions are introduced in EOF code:
289289
- `EOFCREATE` `initcontainer_index` must be less than `num_container_sections`
290290
- `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))
291291
- `EOFCREATE` the subcontainer pointed to by `initcontainer_index` *must not* contain either a `RETURN` or `STOP` instruction.
292-
- `RETURNCONTRACT` `deploy_container_index` must be less than `num_container_sections`
293-
- `RETURNCONTRACT` the subcontainer pointed to `deploy_container_index` *must not* contain a `RETURNCONTRACT` instruction.
292+
- `RETURNCODE` `deploy_container_index` must be less than `num_container_sections`
293+
- `RETURNCODE` the subcontainer pointed to `deploy_container_index` *must not* contain a `RETURNCODE` instruction.
294294
- `DATALOADN`'s `immediate + 32` must be within `pre_deploy_data_size` (see [Data Section Lifecycle](#data-section-lifecycle))
295295
- the part of the data section which exceeds these bounds (the `dynamic_aux_data` portion) needs to be accessed using `DATALOAD` or `DATACOPY`
296296
- 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.
297-
- it is an error for a container to contain both `RETURNCONTRACT` and either of `RETURN` or `STOP`.
297+
- it is an error for a container to contain both `RETURNCODE` and either of `RETURN` or `STOP`.
298298
- it is an error for a subcontainer to never be referenced in its parent container
299-
- it is an error for a given subcontainer to be referenced by both `RETURNCONTRACT` and `EOFCREATE`
299+
- it is an error for a given subcontainer to be referenced by both `RETURNCODE` and `EOFCREATE`
300300

301301
## Stack Validation
302302

@@ -309,7 +309,7 @@ The following instructions are introduced in EOF code:
309309
- *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)`)
310310
- Terminating instructions:
311311
- ending function execution: `RETF`, `JUMPF`,
312-
- ending whole EVM execution: `STOP`, `RETURN`, `RETURNCONTRACT`, `REVERT`, `INVALID`.
312+
- ending whole EVM execution: `STOP`, `RETURN`, `RETURNCODE`, `REVERT`, `INVALID`.
313313
- 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.
314314
- first instruction has `stack_height_min = stack_height_max = types[current_section_index].inputs`.
315315

0 commit comments

Comments
 (0)