From bf9a6481979833be57161b5ad9f0a71c6ef0a14e Mon Sep 17 00:00:00 2001 From: pdobacz <5735525+pdobacz@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:08:31 +0100 Subject: [PATCH] Add a reference to EIP-7069 --- spec/eof.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/spec/eof.md b/spec/eof.md index be078d6..2ee37b2 100644 --- a/spec/eof.md +++ b/spec/eof.md @@ -159,10 +159,6 @@ Code executing within an EOF environment will behave differently than legacy cod - Legacy contract may not deploy EOF code - ~~If a `DELEGATECALL` crosses an EOF<>legacy boundary, then it returns 0 to signal failure (i.e. legacy->EOF and EOF->legacy `DELEGATECALL`s are disallowed).~~ - `DELEGATECALL` from an EOF contract to a legacy contract is disallowed, and it returns 0 to signal failure. We allow legacy to EOF path for existing proxy contracts to be able to use EOF upgrades. -- Introduce a replacement of `CALL`, `DELEGATECALL` and `STATICCALL` in EOF, with two differences to legacy: - - The `gas_limit` input is removed. - - The `output_offset` and `output_size` is removed. - - The `gas_limit` will be set to `(gas_left / 64) * 63` (aka as if the caller used `gas()` in place of `gas_limit`). ### New Behavior @@ -279,6 +275,13 @@ Code executing within an EOF environment will behave differently than legacy cod - 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` +- `CALL2 (0xf8)`, `DELEGATECALL2 (0xf9)`, `STATICCALL2 (0xfb)` + - Replacement of `CALL`, `DELEGATECALL` and `STATICCALL` instructions, as specced out in [EIP-7069](https://eips.ethereum.org/EIPS/eip-7069), except the runtime stack check. In particular: + - The `gas_limit` input is removed. + - The `output_offset` and `output_size` is removed. + - The `gas_limit` will be set to `(gas_left / 64) * 63` (aka as if the caller used `gas()` in place of `gas_limit`). + + **NOTE**: Despite EOF not being strictly required by EIP-7069 and contrary to the wording of EIP-7069, the replacement instructions continue being treated as **undefined** in legacy code. ## Code Validation