-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
coreCore EVM functionalityCore EVM functionalityeipEIP specification implementationEIP specification implementation
Description
Summary
CREATE and CREATE2 must reject deployment of code whose first byte is 0xEF. This prefix is reserved for the future EOF (EVM Object Format). Introduced in the London hardfork.
Specification
- When
CREATEorCREATE2init code returns runtime bytecode, check if the first byte is0xEF - If yes, the deployment fails — push
0to stack, consume gas for the init code execution, but do NOT deploy the code - This does NOT apply to init code itself — only to the deployed (runtime) bytecode returned by
RETURN
Implementation Guide
- In
lib/eevm/opcodes/system/creation.ex, after init code executes and returns runtime code:if byte_size(runtime_code) > 0 and :binary.first(runtime_code) == 0xEF do # Deployment fails — push 0, do not store code end
- This check goes AFTER the EIP-170 code size check and AFTER init code execution succeeds
- Gas for init code execution is still consumed — only the code deposit is prevented
Acceptance Criteria
-
CREATErejects code starting with0xEF -
CREATE2rejects code starting with0xEF - Init code starting with
0xEFis allowed (only runtime code is checked) - Empty runtime code (
<<>>) is allowed - Failed deployment pushes 0 to stack
- Gas for init code is consumed
- Tests pass
Reference
- EIP-3541: https://eips.ethereum.org/EIPS/eip-3541
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreCore EVM functionalityCore EVM functionalityeipEIP specification implementationEIP specification implementation