Ethereum
Ethereum
eth_blockNumber
eth_blockNumber returns the height of the most recent block the node has accepted on Ethereum mainnet. Since The Merge a validator proposes one block per 12-second slot, so under normal conditions the number this method reports climbs by one roughly every 12 seconds. It takes no parameters and answers with a single hex integer. Point it at https://ethereum.therpc.io/YOUR_API_KEY (chain ID 1, native coin ETH) and you get the current tip of the canonical chain. It is the lightest call in the whole eth_ namespace.
Use cases
- Liveness probe. With no params and a CU cost of 1, it is the cheapest way to confirm your Ethereum endpoint is reachable and not stalled behind the tip.
- Anchor a log scan. Read the tip first, then page
eth_getLogsbackward in fixed windows so you never request a range that runs past the head. - Confirmation loops. Deployment and bridge scripts poll the height and wait until
current - txBlockcrosses your confirmation threshold before treating a transaction as settled. - Finality gauge. Diff the returned height against the block tagged
finalizedto see how many slots still sit in the reorg-able window above economic finality.
Parameters
This method takes no parameters. Pass an empty array [].
Response
| Type | Description |
|---|---|
| string (hex) | Hex-encoded integer block number. Parse with parseInt(value, 16) or BigInt(value). |
Example request
Try it live in the Ethereum playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32603 | Internal error | Node is not reachable or has not yet produced any block. |
Common pitfalls
- You get back a hex-encoded height such as
0x12d4f1a. Decode it withBigInt(value)orparseInt(value, 16); comparing or adding to the raw string gives garbage. - Two calls a few milliseconds apart often return the same height — blocks only arrive once per ~12s slot, and providers cache the tip. Don't read a flat value as a stalled node.
- This number tracks the head, which can still reorg before justification. For money movement read at
finalizedorsafeinstead of acting on the rawlatestheight.
Supported networks
- Mainnet — Chain ID: 1
- Sepolia — Chain ID: 11155111