Repository navigation
Description
Hi — during a precompile differential campaign we confirmed a
consensus-relevant call-target split when an EIP-7702 designator is installed on a
precompile address.
Summary
Same pre-state + same tx + same fork (Prague+):
| Client | CALL 0x01 when 0x01 holds 0xef0100‖delegate |
|---|---|
geth v1.17.5-128-ga5b90d2a2 |
runs ecrecover precompile → returndata empty (invalid sig) |
revm v118-6 (reth default; source) |
runs ecrecover precompile |
evmone v0.23.0-51-gee0bf394 |
runs delegate code → returndata 0xdeadbeef… |
Measured on evmone at Prague, Osaka, and Amsterdam — delegation wins in all three.
Root cause
evmone test/state/host.cpp:
// Calls to precompile address via EIP-7702 delegation execute empty code instead of precompile.
if ((msg.flags & EVMC_DELEGATED) == 0 && is_precompile(m_rev, msg.code_address))
return call_precompile(m_rev, msg);EVMC_DELEGATED is set in instructions_calls.cpp get_target_address when the
account code is a 7702 designator — including when code_address is a precompile.
geth core/vm/evm.go Call:
p, isPrecompile := evm.precompile(addr)
...
if isPrecompile {
ret, gas, err = RunPrecompiledContract(...)
} else {
code := evm.resolveCode(addr) // 7702 only here
...
}revm uses bytecode_address = to and runs precompiles.get(&bytecode_address) before bytecode.
Auth validation accepts this setup on all three: precompile stored code is empty, so
"code empty or already delegated" passes.
Note: evmone statetest_loader rejects JSON fixtures with code at precompile addresses
(unexpected code at precompile address), so this shape does not show up in evmone
statetest CI — but Host still implements delegation-wins.
Repro
Pre-state:
- delegate
0xd00d:0x7fdeadbeef…60005260206000f3(RETURN 32-byte deadbeef) 0x01:0xef0100000000000000000000000000000000000d
Tx: CALL 0x01, empty input, Prague+.
| geth | evmone | |
|---|---|---|
| Executed | ecrecover | delegate 0xd00d |
| Returndata | empty | deadbeef… |
| Gas | ~3000 | contract cost |
Full probe sources and raw logs are available on request (archive results-9-19/poc/*7702*, raw-results/*7702*).
Impact
- Consensus split on gas, returndata, logs, and post-state.
- If delegation wins, arbitrary code can sit at a precompile address — contracts that assume
CALL 0x01 = ecrecoverobserve attacker-controlled return data. - Spec does not pin precompile-vs-delegation priority when a designator is on a precompile address.
Asks
- Confirm intended behavior for designator-on-precompile (cite EIP-7702 / execution-specs if specified).
- If precompile should win (geth/revm behavior): drop the
EVMC_DELEGATEDskip whenis_precompile(rev, code_address). - If delegation should win: geth/revm need to change — please coordinate an execution-specs PR.
- Alternative: reject 7702 auth whose authority is a precompile address in all clients.
- Add state-transition tests for designator on
0x01/0x05/0x0a/0x0100at Prague+; allow such fixtures in the statetest loader if Host supports them.
Happy to provide probes, raw logs, and a state-test JSON.
Four-client note (2026-09-20): besu 7e05c23424 and nethermind fe11e1c029 both resolve precompile first when a designator sits on a precompile address (besu MessageCallProcessor.start; nethermind IsPrecompile short-circuit in CodeInfoRepository). With geth and revm this is four production clients precompile-wins vs evmone delegation-wins. Details in besu-nethermind-7702-precompile.md.
Activity