Skip to content

Commit

Permalink
feat: change oob behavior of RETURNDATALOAD and RETURNDATACOPY (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper authored May 29, 2024
1 parent 474ae32 commit ac91da4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/eof.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ Code executing within an EOF environment will behave differently than legacy cod
- When executed from a legacy contract, if instructions `CREATE` and `CREATE2` have EOF code as initcode (starting with `EF00` magic)
- deployment fails (returns 0 on the stack)
- caller's nonce is not updated and gas for initcode execution is not consumed
- `RETURNDATACOPY (0x3E)` instruction
- same behavior as legacy, but changes the exceptional halt behavior to zero-padding behavior (same behavior as `CALLDATACOPY`).

#### Creation transactions

Expand Down Expand Up @@ -260,8 +262,8 @@ The following instructions are introduced in EOF code:
- `RETURNDATALOAD (0xf7)` instruction
- deduct 3 gas
- pop `offset` from the stack
- if `offset + 32 > len(returndata buffer)`, execution results in an exceptional halt
- push 1 item onto the stack, the 32-byte word read from the returndata buffer starting at `offset`
- if `offset + 32 > len(returndata buffer)` the result is zero-padded (same behavior as `CALLDATALOAD`). see matching behavior of `RETURNDATACOPY` in `Modified Behavior` section.
- `EXTCALL (0xf8)`, `EXTDELEGATECALL (0xf9)`, `EXTSTATICCALL (0xfb)`
- 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:
- The `gas_limit` input is removed.
Expand Down

0 comments on commit ac91da4

Please sign in to comment.