Module nodeinterface_rpc

Module nodeinterface_rpc 

Source
Expand description

RPC-layer handlers for NodeInterface (0xc8) methods that require chain-history or call-stack access beyond what a precompile can do.

In Nitro these are handled by InterceptRPCMessage before the EVM dispatches — we implement the same pattern as an eth_call override on ArbEthApi. Precompile-level fallbacks for these methods return zero / empty (see arb_precompiles::nodeinterface) so callers that don’t go through eth_call still get a valid response.

Constants§

NODE_INTERFACE_ADDRESS
NodeInterface virtual contract address.
SEL_CONSTRUCT_OUTBOX_PROOF
SEL_FIND_BATCH_CONTAINING_BLOCK
SEL_GAS_ESTIMATE_COMPONENTS
SEL_GAS_ESTIMATE_L1_COMPONENT
SEL_GET_L1_CONFIRMATIONS
SEL_L2_BLOCK_RANGE_FOR_L1

Functions§

decode_single_u64_arg
Decode the uint64 argument from the selector blockL1Num(uint64) / l2BlockRangeForL1(uint64) / findBatchContainingBlock(uint64) / nitroGenesisBlock() (no arg, returns 0).
encode_gas_estimate_components
ABI-encode the (uint64, uint64, uint256, uint256) result of gasEstimateComponents: (gasEstimate, gasEstimateForL1, baseFee, l1BaseFeeEstimate).
encode_l2_block_range
ABI-encode the (uint64, uint64) result of l2BlockRangeForL1.
find_l2_block_range
Binary-search headers to find the block-range that was emitted against the given L1 block. The predicate on each header is l1_block_number_from_mix_hash(header.mix_hash).
gas_estimate_data_len
Extract the bytes parameter (data) from an ABI-encoded (address, bool, bytes) gas-estimate call, returning its length.
unpack_mix_hash
Decode a packed header’s mix_hash field to (sendCount, l1BlockNumber, arbosVersion).