Skip to content

Commit ac91da4

Browse files
feat: change oob behavior of RETURNDATALOAD and RETURNDATACOPY (#90)
1 parent 474ae32 commit ac91da4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/eof.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ Code executing within an EOF environment will behave differently than legacy cod
125125
- When executed from a legacy contract, if instructions `CREATE` and `CREATE2` have EOF code as initcode (starting with `EF00` magic)
126126
- deployment fails (returns 0 on the stack)
127127
- caller's nonce is not updated and gas for initcode execution is not consumed
128+
- `RETURNDATACOPY (0x3E)` instruction
129+
- same behavior as legacy, but changes the exceptional halt behavior to zero-padding behavior (same behavior as `CALLDATACOPY`).
128130

129131
#### Creation transactions
130132

@@ -260,8 +262,8 @@ The following instructions are introduced in EOF code:
260262
- `RETURNDATALOAD (0xf7)` instruction
261263
- deduct 3 gas
262264
- pop `offset` from the stack
263-
- if `offset + 32 > len(returndata buffer)`, execution results in an exceptional halt
264265
- push 1 item onto the stack, the 32-byte word read from the returndata buffer starting at `offset`
266+
- if `offset + 32 > len(returndata buffer)` the result is zero-padded (same behavior as `CALLDATALOAD`). see matching behavior of `RETURNDATACOPY` in `Modified Behavior` section.
265267
- `EXTCALL (0xf8)`, `EXTDELEGATECALL (0xf9)`, `EXTSTATICCALL (0xfb)`
266268
- Replacement of `CALL`, `DELEGATECALL` and `STATICCALL` instructions, as specced out in [EIP-7069](https://eips.ethereum.org/EIPS/eip-7069), except the runtime operand stack check. In particular:
267269
- The `gas_limit` input is removed.

0 commit comments

Comments
 (0)