Skip to content

Block parameter ​

How a request names one block. Many methods take it as their last parameter.

The value is a block number in hex, a tag, or an object. The methods that read state (balances, code, storage, calls and traces) accept the head and the 128 blocks before it.

Fields ​

FieldTypeMeaning
numberhex string, for example 0x18fa690The block with this number. The prefix is 0x or 0X. A decimal string or a JSON number gives -32602 Invalid params, as in reth.
latesttagThe head of the last forkchoice update from the consensus client, as in reth. The node serves it also before it writes the block to its database. In cinder --serve, the newest block in the database.
safetagThe safe block of the last forkchoice update from the consensus client, as in reth.
finalizedtagThe finalized block of the last forkchoice update from the consensus client, as in reth.
pendingtagThe block after latest, as reth builds it with its default --rpc.pending-block full. The node builds it from its transaction pool on latest and keeps it for 1 second or until the head changes. The block methods return this block. The state methods (balance, code, storage) read the state after it. A call (eth_call, eth_estimateGas, eth_createAccessList, debug_traceCall, trace_call) runs on the state of latest, as in reth. It sees the number, time and fees of the next block. eth_feeHistory stops at latest. eth_getProof, eth_getAccount and debug_getRaw* give -32001 block not found: pending, as reth. cinder --serve has no pool: its pending block has no transactions.
earliesttagThe first block that the node keeps with its transactions and receipts, as in reth. A node that started from an import has no earlier block. The state of this block is usually not available.
{"blockNumber": "0x..."}objectThe block with this number (EIP-1898).
{"blockHash": "0x..."}objectThe block with this hash (EIP-1898). The block must be on the canonical chain.
``"0x..." (66 characters)hash stringThe block with this hash, as reth reads it. Methods that take only a number or a tag refuse it.
requireCanonicalboolean, in the object with blockHashAccepted. Cinder looks up canonical blocks only. With an unknown hash and true, the methods that run code give block not found: canonical hash 0x..., as reth. Examples are eth_call, eth_getAccount and trace_block.

Notes ​

  • Tags are not case-sensitive (LATEST, Latest), as in reth.
  • Some methods take a block number or a tag only. They refuse an object, a hash and null with -32602 Invalid params, as reth. These are eth_getBlockByNumber, eth_getHeaderByNumber, eth_getBlockTransactionCountByNumber, eth_getUncleCountByBlockNumber, eth_get(Raw)TransactionByBlockNumberAndIndex, debug_traceBlockByNumber, eth_feeHistory, and fromBlock and toBlock of a log filter.
  • An object with both blockHash and blockNumber gives -32602 Invalid params (duplicate field). eth_getAccount and eth_getAccountInfo need the block parameter.
  • A number below the first block of the node (the earliest tag) gives the error 4444 pruned history unavailable: requested N, earliest available M, as in reth. This is for the block, receipt, log and trace methods. debug_getRawBlock gives -32603 block #N is not available, history has expired (earliest available: #M).
  • A number above the head gives null from the block methods and the error -32001 block not found from the state, call and trace methods.
  • A state query more than 128 blocks below the head gives the error 4444 pruned history unavailable: requested N, earliest available M, as in reth. N is the requested block. M is the oldest block whose state the node serves. The methods that replay a block (traces of a block or transaction, trace_filter, eth_simulateV1) give -32603 failed to apply blockhash contract call: ... insufficient changesets ... instead. For a block of the Cancun fork, the text is failed to apply beacon root contract call at 0x<root>: ..., with the parent beacon root of the block. Before Cancun, these methods also give 4444, for the parent block.
  • Before the first forkchoice update, safe and finalized give null from the block methods and the error -32001 block not found: safe (or finalized) from the other methods, as reth.
  • In cinder --serve, if the safe or the finalized block is not in the database yet, the tag gives the database head. cinder --serve reads the database only: its latest can be behind the chain head of the node while the node writes blocks.

Used by ​

debug_codeByHash, debug_executionWitness, debug_getRawBlock, debug_getRawBlockAccessList, debug_getRawHeader, debug_getRawReceipts, debug_traceBlockByNumber, debug_traceCall, eth_call, eth_createAccessList, eth_estimateGas, eth_feeHistory, eth_getAccount, eth_getAccountInfo, eth_getBalance, eth_getBlockAccessList, eth_getBlockByNumber, eth_getBlockReceipts, eth_getBlockTransactionCountByNumber, eth_getCode, eth_getHeaderByNumber, eth_getProof, eth_getRawTransactionByBlockNumberAndIndex, eth_getStorageAt, eth_getStorageValues, eth_getTransactionByBlockNumberAndIndex, eth_getTransactionCount, eth_getUncleByBlockNumberAndIndex, eth_getUncleCountByBlockNumber, eth_simulateV1, trace_block, trace_call, trace_callMany, trace_rawTransaction, trace_replayBlockTransactions.