Skip to content

core: install Arbitrum precompile dispatch through a resolver hook#653

Closed
joshuacolvin0 wants to merge 1 commit into
masterfrom
precompiles-fix-interface
Closed

core: install Arbitrum precompile dispatch through a resolver hook#653
joshuacolvin0 wants to merge 1 commit into
masterfrom
precompiles-fix-interface

Conversation

@joshuacolvin0

@joshuacolvin0 joshuacolvin0 commented Apr 14, 2026

Copy link
Copy Markdown
Member

pulled in by OffchainLabs/nitro#4640

Remove the hardcoded IsDia/IsStylus/IsArbitrum dispatch from
activePrecompiledContracts / ActivePrecompiles and replace it with
a resolver hook installed at init by downstream Arbitrum integrations
(Nitro's gethhook). ArbOS activation-version semantics now live
outside core/vm, keeping the delta vs upstream ethereum/go-ethereum
minimal and rebases cheap.

arbOSActivePrecompiles returns ok=true even when the resolver yields
nil views so a pre-activation Arbitrum block cannot fall through to
the Ethereum switch: the upstream switch would warm precompile
addresses that the canonical chain treats as cold accounts, diverging
on state root during replay.

SetArbOSPrecompileResolver panics on a nil argument and on a second
install so misconfiguration is loud at init time (pre-block-execution),
never during dispatch.

Tests cover the four dispatch branches — non-Arbitrum passthrough,
no-resolver passthrough, resolver invocation with ArbOSVersion
forwarding through both entry points, and the load-bearing
nil-views-do-not-fall-through invariant — plus the two setter panic
paths.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Remove the hardcoded IsDia/IsStylus/IsArbitrum dispatch from
activePrecompiledContracts / ActivePrecompiles and replace it with
a resolver hook installed at init by downstream Arbitrum integrations
(Nitro's gethhook). ArbOS activation-version semantics now live
outside core/vm, keeping the delta vs upstream ethereum/go-ethereum
minimal and rebases cheap.

arbOSActivePrecompiles returns ok=true even when the resolver yields
nil views so a pre-activation Arbitrum block cannot fall through to
the Ethereum switch: the upstream switch would warm precompile
addresses that the canonical chain treats as cold accounts, diverging
on state root during replay.

SetArbOSPrecompileResolver panics on a nil argument and on a second
install so misconfiguration is loud at init time (pre-block-execution),
never during dispatch.

Tests cover the four dispatch branches — non-Arbitrum passthrough,
no-resolver passthrough, resolver invocation with ArbOSVersion
forwarding through both entry points, and the load-bearing
nil-views-do-not-fall-through invariant — plus the two setter panic
paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants