EXTCODECOPY at host.rs converts code_offset with as_usize_or_halt, which halts with OutOfGas when the value does not fit in usize (>= 2^64). Per the EVM spec and revm, an out of range code offset must zero fill, not fault. The sibling opcodes CODECOPY, CALLDATACOPY, and RETURNDATACOPY correctly use as_usize_saturated (system.rs), so this is an isolated inconsistency.
Repro: EXTCODECOPY(addr, 0, 2**64, 32) returns 32 zero bytes on Ethereum but traps here, yielding a different state root.
Fix: switch host.rs to as_usize_saturated.
EXTCODECOPYat host.rs convertscode_offsetwithas_usize_or_halt, which halts with OutOfGas when the value does not fit inusize(>= 2^64). Per the EVM spec andrevm, an out of range code offset must zero fill, not fault. The sibling opcodesCODECOPY,CALLDATACOPY, andRETURNDATACOPYcorrectly useas_usize_saturated(system.rs), so this is an isolated inconsistency.Repro:
EXTCODECOPY(addr, 0, 2**64, 32)returns 32 zero bytes on Ethereum but traps here, yielding a different state root.Fix: switch host.rs to
as_usize_saturated.