Skip to content

State methods

Willow RPC serves account state on Ethereum, Base, Arbitrum One, OP Mainnet, Unichain, Ink, Robinhood Chain, BNB Smart Chain, World Chain, and Soneium. On the other chains, every state method returns -32601. State is read from a provider’s EIP-1186 proof and verified against the state root of a block that Willow verified, before it is returned. On each of these chains, eth_call is executed by Willow over state verified in the same way, and so is eth_estimateGas on all of them except Base and BNB Smart Chain. On Ethereum and Unichain, the trace methods run the block again in Willow’s own EVM over verified state. Sending a transaction is the one state method whose result no block commits to, so it is forwarded to a provider. The fee methods are computed by Willow from its own verified blocks (see Fee methods).

Every read, call, gas estimate, and trace also has a proof method (willow_getStateProof, willow_getCallProof, willow_getEstimateGasProof, and willow_getTraceProof) whose response anyone can verify independently. The one exception is eth_call on Base and BNB Smart Chain: the verifier’s EVM doesn’t run those chains’ calls yet, so willow_getCallProof is refused there. See Block, state, and fee proofs and Trace proofs.

State methods are set per plan. Of the self-serve plans, Pay as you go, Builder, and Scale include them, and Free does not. An Enterprise plan includes them only if its agreement does. A key on a plan that does not include state methods receives -32601 for every state method and its proof method, including eth_sendRawTransaction and the trace methods, so a router sends the request to another provider. /v1/prices reports each plan’s state_methods. See Plans.

MethodChainsHow it is servedUnits
eth_getBalance, eth_getTransactionCount, eth_getCode, eth_getStorageAt, eth_getProofAll listed aboveVerified against the block’s state root3
eth_callAll listed aboveExecuted by Willow over verified state3
eth_estimateGasAll listed above except Base and BNB Smart ChainExecuted by Willow over verified state, with geth’s gas search (Nitro’s on Robinhood Chain)3
debug_traceTransaction, debug_traceBlockByNumber, debug_traceBlockByHash, debug_traceCall, trace_block, trace_transaction, trace_replayBlockTransactions, trace_replayTransaction, trace_call, trace_filterEthereum, UnichainThe block run again by Willow over verified state, each transaction checked against its receipt6
eth_sendRawTransactionAll listed aboveForwarded to a provider. The hash returned is computed from the transaction’s bytes.3

These are minimums. A request costs its minimum, 3 units for each request it required to a paid provider, or the size of its response in units, whichever is most. See Units.

eth_call and eth_estimateGas on the other chains return -32601, as do eth_estimateGas on Base and BNB Smart Chain and the trace methods on chains other than Ethereum and Unichain. See eth_call, eth_estimateGas, and Traces.

Willow requests the account, and any storage slots, as an eth_getProof response from a provider. It verifies the account proof and each storage proof against the state root in the header of the requested block, and verifies the returned code against the account’s code hash. A provider whose proof does not verify is not used, and the next provider is asked. If no provider returns a proof that verifies, the request is refused with -32000, so a router can send it to another provider.

The header is one Willow verified before serving it:

  • On Ethereum, state is read only at blocks the light client (Helios) has confirmed. See Blocks.
  • On the L2s, state is read at blocks the sequencer signed, and on BNB Smart Chain at blocks whose headers Willow verified against its validators: the same blocks Willow serves. See How Willow verifies data.

A value that does not exist is proven absent: the balance, nonce, and storage of an account with no entry in the state are returned as 0x0, and its code as 0x.

The block parameter accepts a hexadecimal number, a tag (latest, pending, earliest, finalized, or safe), a block hash, or an EIP-1898 object ({"blockHash": …} or {"blockNumber": …}). An omitted block parameter means latest. finalized and safe are served and refused as for the other methods (see finalized and safe), so safe is refused on Ethereum, Arbitrum One, and Robinhood Chain.

  • latest and pending on Ethereum refer to the newest block the light client has confirmed, which can be behind the newest block that eth_blockNumber returns. If that block is more than 180 seconds old, the request is refused with -32000 instead of being served from an old block.
  • A block number on Ethereum later than the newest confirmed block is refused with -32000 (not yet confirmed by the light client).
  • On the other chains, latest and pending refer to the newest block Willow holds, under the same freshness rule as the other methods.
  • Older blocks are served when a provider holds their state. Willow asks archive providers for older blocks; a block whose state no provider returns is refused with -32000. On the other chains, a block older than those Willow holds is refused as described in History.

The proof methods are not held to the light client: on Ethereum they are served at any block Willow verified, since their verifier anchors the block itself.

eth_getTransactionCount with pending returns the proven nonce at the newest confirmed block, the same value as latest. A provider’s pending nonce includes transactions in its mempool, which no block commits to, so Willow doesn’t use it. An app that sends several transactions in a row tracks its own next nonce, as the verifying client does.

eth_getBalance, eth_getTransactionCount, eth_getCode, and eth_getStorageAt return the same values as a node. eth_getProof returns the verified proof in the standard form (address, balance, codeHash, nonce, storageHash, accountProof, and storageProof), with at most 256 storage keys per request.

Request:

Terminal window
curl -s https://api.willow.tech/v1/rpc/1/{YOUR_KEY} \
-H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["0x00000000219ab540356cbb839cbe05303d7705fa","latest"]}'

Response:

{"id":1,"jsonrpc":"2.0","result":"0x…"}

eth_call is served on every chain with state methods. Willow executes the call in its own EVM at the requested block: on Ethereum as reth runs it, on OP Mainnet, Unichain, Ink, World Chain, and Soneium as op-reth runs it, on Arbitrum One and Robinhood Chain as Nitro runs it, on Base as Base’s own node (base-reth-node) runs it, and on BNB Smart Chain as bsc-geth runs it. Every account, storage slot, and contract code the call reads is proven against the block’s state root before the call returns. A provider’s access list is used only to request the likely state in advance; state it omits is requested when the execution reaches it, and is verified in the same way.

The call object accepts the standard fields: from, to, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value, data (or input), accessList, and chainId.

ResultCodeMessage
Returnedresult holds the return data.
Reverted3execution reverted, with the decoded reason when the data is an Error(string) or Panic(uint256), and on Arbitrum One and Robinhood Chain one of ArbOS’s own errors by name, as Nitro reports it. error.data holds the revert data.
Halted-32000out of gas, or VM execution error: followed by the reason.

These results are final: another provider executing the same call at the same block returns the same result, so a router should return them to the client rather than fall back.

State overrides and block overrides (the third and fourth parameters) are accepted, in the form reth reads them. What an override sets is the caller’s own input: it is used as given and is not proven. Everything else the call reads is still proven against the block’s state root. An account whose storage is replaced has none of its slots proven, an account whose code is set has its own code neither fetched nor checked, and its nonce and balance are proven unless the override sets them too. A block override keeps the block’s own network upgrade rules, as reth does. On BNB Smart Chain, a block override’s number and time set the rules instead, as they do in bsc-geth.

  • One call’s overrides may set at most 256 accounts, 8,192 storage slots, and 512 KB of code in all. Beyond that, the call is refused with -32000 (at most 256 accounts, 8192 slots and 524288 bytes of code are run here in one call).
  • An override with movePrecompileToAddress is refused with -32000.
  • An account override with both state and stateDiff, or invalid code, is refused with -32602.

On Ethereum, a call that names a gas price runs as reth runs it. The sender is not charged for gas before the call, and its balance is not checked against the gas. GASPRICE and BASEFEE read the prices the call names. A maxFeePerGas below the block’s base fee is refused as an invalid transaction (-32000). Without a gas field, the call’s gas is what the sender’s balance, less value, pays for at that price, at most the block’s gas limit.

A call that reaches a part of Nitro that Willow’s EVM does not rebuild, such as a Stylus program, NodeInterface, or an ArbOS precompile it does not run, is refused with -32000 and a message that contains “not found”, so a router sends it to another provider.

A call that runs one of BNB Smart Chain’s own precompiles (0x64 to 0x69), or its native CAS20 token code under Jenner’s rules, is refused with -32000 and a message that contains “not found”, so a router sends it to another provider.

  • State per call. A call may read at most 256 accounts and 8,192 storage slots. A call that reads more is refused with -32000 (the call reads more state than one call may).
  • Time. A request is served within 20 seconds. A call whose state cannot be proven within that time is refused with -32000 (proving the state it reads took longer than this request may).
  • Blobs and authorizations. A call object with blobVersionedHashes or an authorizationList (EIP-7702) is refused with -32000.
  • Network upgrades. A call at a block after a network upgrade that Willow’s EVM does not yet run is refused with -32000 (calls after the coming fork are not run here yet).

eth_estimateGas is served on every chain with state methods except Base and BNB Smart Chain. Willow runs the gas search in its own EVM at the requested block, and every run of the search reads only state proven against the block’s state root, as for eth_call:

  • Ethereum, OP Mainnet, Unichain, Ink, World Chain, Soneium, and Arbitrum One: geth v1.17.10’s gas estimation (eth/gasestimator), ported line for line, over the chain’s own call runs. On Ethereum the search is also capped by EIP-7825’s gas limit per transaction.
  • Robinhood Chain: Nitro v3.12.2’s gas estimation, ported line for line. The gas cap is raised by the call’s L1 data gas, each run is priced as Nitro’s estimation mode prices it, and a plain transfer is estimated at 21,000.

The call object, the block parameter, state and block overrides, and the limits are those of eth_call. On Arbitrum One and Robinhood Chain, an estimate with a difficulty or prevRandao block override is refused with -32000.

ResultCodeMessage
Estimatedresult holds the gas limit.
Reverted3execution reverted, with the decoded reason. error.data holds the revert data.
No gas limit works-32000gas required exceeds allowance (N), where N is the most gas the call may have.
Halted otherwise-32000The same message as eth_call.

These results are final, as for eth_call. In testing, the estimates on Ethereum equaled geth’s exactly, at the same block, for a plain transfer, a USDC transfer, a WETH deposit, a Uniswap v2 swap, a contract creation, a call that reverts, and one that runs out of gas. On Robinhood Chain, 16 recorded estimates, among them transfers, a contract creation, a revert, a call that never ends, and calls with gas prices and block overrides, equaled the chain’s own eth_estimateGas exactly.

On the other chains, Base and BNB Smart Chain included, eth_estimateGas is refused with -32601 (eth_estimateGas is not served on chain {id}: Willow does not execute this chain's transactions yet), so a router sends it to another provider.

The trace methods are served on Ethereum and Unichain. Willow runs the block again in its own EVM, with the block’s transactions as it verified them, over the parent block’s state proven against the parent’s state root. Each transaction’s gas used and status must equal the block’s verified receipts before any trace of the block is returned. The traces are written by the tracers reth uses (revm-inspectors), and on Unichain as op-reth writes them. A call’s trace (debug_traceCall, trace_call) runs the call over proven state as eth_call runs it, with its state and block overrides.

EthereumUnichain
Methodsdebug_traceTransaction, debug_traceBlockByNumber, debug_traceBlockByHash, debug_traceCall, trace_block, trace_transaction, trace_replayBlockTransactions, trace_replayTransaction, trace_call, trace_filterdebug_traceTransaction, debug_traceBlockByNumber, debug_traceBlockByHash, trace_block, trace_transaction, trace_filter
geth tracersThe struct logger (the default) and its options, callTracer, prestateTracer (with diffMode), 4byteTracer, noopTracer, muxTracer, and flatCallTracercallTracer, prestateTracer (with diffMode), and noopTracer
Parity trace typestrace, stateDiff, and vmTraceFlat traces (trace_block, trace_transaction, trace_filter)

The block parameter is read as for the other state methods: on Ethereum, the trace methods run only at blocks the light client has confirmed (see Blocks). A transaction is traced in the block that holds it.

  • trace_filter spans at most 16 blocks. A larger range is refused with -32602 (Block range too large; currently limited to 16 blocks).
  • State and steps. A request whose traces read more state, or record more steps, than one request may is refused with -32000 (more state or steps than one request may trace here).
  • Time. A trace whose state cannot be proven within the request’s 20 seconds is refused with -32000 (proving the state the block reads took longer than this request may).
  • Tracers not run. JavaScript tracers, the erc7562Tracer, and debug_traceCall with txIndex are refused with -32000. On Unichain, the tracers and methods the table leaves out are refused with -32000 (… are not run here on this chain yet).
  • Genesis is not traceable (-32602).

eth_sendRawTransaction is sent to a provider, and the provider’s errors are returned unchanged. No block commits to whether a provider broadcast a transaction, so this is the one state method that is not verified. Its inclusion can be verified once it is in a block, with a proof of its receipt.

The hash returned is computed from the transaction’s bytes, not as reported by the provider (for a blob transaction, the hash of the transaction without its blobs). If a provider reports the transaction as already known, the transaction is treated as sent.

eth_gasPrice, eth_maxPriorityFeePerGas, eth_blobBaseFee, and eth_feeHistory are computed by Willow from its own verified blocks with the published willow-fee-v1 formula, at the newest block it serves. No provider is asked, and each response can be recomputed from willow_getFeeProof or willow_getFeeHistoryProof. They are served on every plan, including Free, and metered by size, at least 1 unit (see Units and pricing).

The formula has rules for Ethereum, Base, OP Mainnet, Unichain, Ink, Arbitrum One, and Robinhood Chain. On the other chains, the fee methods and their proofs are refused with -32601 (the fee methods are not served on chain {id}: willow-fee-v1 has no rules for this chain).

Each chain has separate capacity for reads, calls, traces, and sent transactions. The proof methods share their standard methods’ lanes:

LaneAt once per chainAt once per key
Reads (eth_getBalance … eth_getProof, willow_getStateProof)6416
Calls (eth_call, eth_estimateGas, and their proofs)84
Traces (the trace methods and willow_getTraceProof)42
eth_sendRawTransaction164

A key’s requests beyond its share wait their turn. When the lane itself is full, a request waits up to 2 seconds and is then refused with -32000 (this server is busy, try again in a moment), so a router can send it to another provider.

Each kind of state method has a minimum price in units. A request costs that minimum, 3 units for each request it required to a paid provider, or the size of its response in units, whichever is most. Requests to Willow’s own nodes and to free public providers are not counted. At a minimum of 3 units, any response larger than 12 KB costs its size in units, such as a long eth_getProof, a large contract’s code, or a call proof.

KindUnits
Read, and willow_getStateProof3
eth_call, and willow_getCallProof3
eth_estimateGas, and willow_getEstimateGasProof3
Forwarded (eth_sendRawTransaction)3
The trace methods, and willow_getTraceProof6
  • Billed: a result, a revert, a halted call, and an error returned by a provider for eth_sendRawTransaction.
  • Billed per paid-provider request (3 units each): a call or trace refused because it reads too much state or ran out of time, since the provider requests were made.
  • Not billed: a refusal because the server is busy, because no provider returned a proof that verifies, or because the request was invalid.
CodeMeaningRemedy
3The call reverted. error.data holds the revert data.Return to the client. Do not fall back.
-32000, message without “not found”The call halted (out of gas, VM execution error: …), the call is invalid at the block (such as a fee cap below the base fee), or no gas limit works for an estimate (gas required exceeds allowance (N)).Return to the client. Do not fall back.
-32000, message with “not found”The block is not yet confirmed or is too old, no provider returned a proof that verifies, the call or trace reads too much state or ran out of time, the call or tracer is one Willow does not run, or the server is busy.Fall back to another provider.
-32601eth_call or eth_estimateGas on a chain where Willow does not execute them, a trace method on a chain other than Ethereum and Unichain, the fee methods on a chain without fee rules, or a key on a plan that does not include state methods.Send to another provider.
-32602A malformed address, slot, call object, or override, more than 256 keys in eth_getProof, or a trace_filter over more than 16 blocks.Correct the request.
Provider’s codeAn error returned by the provider for eth_sendRawTransaction, such as a rejected transaction.Handle as the provider’s error.

Examples:

{"error":{"code":-32000,"message":"not found in this store: block 23650010 is not yet confirmed by the light client"},"id":1,"jsonrpc":"2.0"}
{"error":{"code":-32000,"message":"not found in this store: state reads: this server is busy, try again in a moment"},"id":2,"jsonrpc":"2.0"}
{"error":{"code":-32601,"message":"eth_estimateGas is not served on chain 8453: Willow does not execute this chain's transactions yet"},"id":3,"jsonrpc":"2.0"}