Appearance
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
| Field | Type | Meaning |
|---|---|---|
number | hex string, for example 0x18fa690 | The block with this number. The prefix is 0x or 0X. A decimal string or a JSON number gives -32602 Invalid params, as in reth. |
latest | tag | The 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. |
safe | tag | The safe block of the last forkchoice update from the consensus client, as in reth. |
finalized | tag | The finalized block of the last forkchoice update from the consensus client, as in reth. |
pending | tag | The 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. |
earliest | tag | The 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..."} | object | The block with this number (EIP-1898). |
{"blockHash": "0x..."} | object | The block with this hash (EIP-1898). The block must be on the canonical chain. |
``"0x..." (66 characters) | hash string | The block with this hash, as reth reads it. Methods that take only a number or a tag refuse it. |
requireCanonical | boolean, in the object with blockHash | Accepted. 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
nullwith -32602Invalid params, as reth. These areeth_getBlockByNumber,eth_getHeaderByNumber,eth_getBlockTransactionCountByNumber,eth_getUncleCountByBlockNumber,eth_get(Raw)TransactionByBlockNumberAndIndex,debug_traceBlockByNumber,eth_feeHistory, andfromBlockandtoBlockof a log filter. - An object with both
blockHashandblockNumbergives -32602Invalid params(duplicate field).eth_getAccountandeth_getAccountInfoneed the block parameter. - A number below the first block of the node (the
earliesttag) gives the error 4444pruned history unavailable: requested N, earliest available M, as in reth. This is for the block, receipt, log and trace methods.debug_getRawBlockgives -32603block #N is not available, history has expired (earliest available: #M). - A number above the head gives
nullfrom the block methods and the error -32001block not foundfrom 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 -32603failed to apply blockhash contract call: ... insufficient changesets ...instead. For a block of the Cancun fork, the text isfailed 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,
safeandfinalizedgivenullfrom the block methods and the error -32001block not found: safe(orfinalized) 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 --servereads the database only: itslatestcan 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.