Conversation
EIP-7979 adds explicit call and return instructions to the EVM: a per-frame return stack and three opcodes, CALLSUB (0xB0), CALLDEST (0xB1) and RETURNSUB (0xB2), using the EIP's placeholder values. Spec (src/ethereum/forks/amsterdam): - Evm gains `return_stack` and `valid_call_destinations`; RETURN_STACK_LIMIT = 1024. - The JUMPDEST scan becomes a single pass, `get_valid_destinations`, returning both the jump and the call destination sets. A CALLDEST is both, so JUMP and JUMPI need no change. The EIP-8024 immediate handling is preserved. - callsub/calldest/returnsub in control_flow.py; ReturnStackOverflowError and ReturnStackUnderflowError; gas costs mid (8), jumpdest (1) and low (5). Framework (packages/testing): - Opcode table entries and the EIP7979 fork mixin, picked up by Amsterdam automatically. Tests (tests/amsterdam/eip7979_callsub, 44 tests, 130 fixtures): - The EIP's five vectors byte-for-byte; invalid destinations (JUMPDEST, PUSH data, DUPN immediate, out of range, uint64 overflow, self, stack underflow); return-stack underflow; the 1024 limit by counted recursion; per-frame isolation across all four call opcodes; call elimination via JUMP/JUMPI, tail call and mutual recursion at constant depth; exact gas by measurement; initcode, CREATE, CREATE2 and 7702 contexts; fork transition. - tests/frontier/opcodes/test_all_opcodes.py: CALLSUB and RETURNSUB get the same special-casing as JUMP in the generic harness.
EIP-7979: Call and Return Opcodes for the EVMChecklist revision: 2 (28 anchors) Link: https://eips.ethereum.org/EIPS/eip-7979 Self-assessment by the EIP author, offered as a starting point for the STEEL evaluator. Every row cites the reference implementation, ethereum/execution-specs#3575, rather than an estimate. Execution SpecsSpecsImplemented in execution-specs#3575 on
No transaction, block, state, precompile, system-contract, or fork-activation code is touched. TestingTests in Checklist
Total: 13 (10 if Modified opcodes is scored 0; 12 if Cross-EIP interactions is scored 0; 9 if both.) Special ConsiderationsNone. No dimension of the test matrix multiplies against another: the destination cases, the return-stack cases, and the execution-context cases (four call opcodes, two creation paths, transaction initcode, EIP-7702 delegation) are independent, and the full product is already filled in 130 fixtures. Notes
Final Assessment
For comparison within this fork's table: FOCIL scored 15 and Frame Transactions 38 on revision 1's scale. Among execution-layer feature EIPs proposed for Hegotá, this is the smallest surface: three constant-gas opcodes and one frame-local stack, with no state, transaction, block, or gas-accounting component. |
ethereum-spec-lint's UintLenHygiene rule requires ulen(...) rather than Uint(len(...)).
Reference implementation and tests for EIP-7979, proposed for Hegotá (PFI, ethspecs/pm#72). All 130 fixtures fill against the spec; 'just static' is clean.
EIP-7979 adds explicit call and return instructions to the EVM: a per-frame return stack and three opcodes, CALLSUB (0xB0), CALLDEST (0xB1) and RETURNSUB (0xB2), using the EIP's placeholder values.
Spec (src/ethereum/forks/amsterdam):
return_stackandvalid_call_destinations; RETURN_STACK_LIMIT = 1024.get_valid_destinations, returning both the jump and the call destination sets. A CALLDEST is both, so JUMP and JUMPI need no change. The EIP-8024 immediate handling is preserved.Framework (packages/testing):
Tests (tests/amsterdam/eip7979_callsub, 44 tests, 130 fixtures):
Description
Related Issues or PRs
N/A.
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture