The OP Stack accelerates certain EVM precompiles during fault proof verification by delegating their execution to the L1 PreimageOracle contract rather than running them natively inside the proof VM. When a precompile is called on L2, the fault proof client sends a hint to the challenger, which calls loadPrecompilePreimagePart on L1. The L1 contract executes the precompile, stores the result under a preimage key, and the proof VM reads the result back.
The preimage key is computed as:
key = type_prefix(0x06) || keccak256(precompile_address || requiredGas || input)[1:]
The requiredGas value is output by the fault proof program in the hint and is embedded in the key. The loadPrecompilePreimagePart function uses it to enforce that the caller supplies sufficient gas so the precompile does not run out of gas during the L1 staticcall. The challenger always reads requiredGas directly from the fault proof program's hint, so the client and challenger always agree on the value used in the key.
<aside> ⚠️
Why OOG is dangerous here: If the precompile runs out of gas on L1, the staticcall returns (0 bytes, false) — but the outer transaction does not revert. The PreimageOracle would store a failure result (0x00) for a precompile call that actually succeeded on L2. Any dispute game reading this preimage would produce an incorrect result, potentially allowing a fraudulent state root to go unchallenged.
</aside>
The requiredGas value output by the fault proof program is currently derived from the L2 gas schedule (c.Orig.RequiredGas(input)). The loadPrecompilePreimagePart contract enforces:
require(gas() >= (_requiredGas * 64 / 63) + PRECOMPILE_CALL_RESERVED_GAS)
This ensures the caller forwards at least _requiredGas to the precompile staticcall (accounting for EIP-150's 63/64 rule).
If an L1 EIP raises the gas cost of a precompile above the current requiredGas value, then:
requiredGas = current value (currently derived from L2 cost)loadPrecompilePreimagePart with the same lower _requiredGas (taken from the hint)requiredGas worth of gas)requiredGasL1_cost > requiredGas → OOG