Scroll
Scroll

eth_blockNumber
eth_blockNumber returns the height of the most recent block accepted by consensus. It takes no parameters and is the cheapest call you can make against an EVM endpoint — ideal as a heartbeat for monitoring, a sanity check after deploying a node, or as a baseline measurement in latency probes.
Use cases
- Check whether the endpoint is alive and synced.
- Track real-time progression for time-sensitive flows.
- Establish the current chain height before paginating logs or transactions.
- Verify finality by comparing a target block against the latest.
- Drive
wait-for-confirmationshelpers in deployment scripts.
Response shape
The result is a hex-encoded integer. To work with it as a number, parse it with parseInt(value, 16) or BigInt(value). Block numbers grow indefinitely, so prefer BigInt for arithmetic if the value is going to be persisted.
Notes for production use
- This method is cached aggressively at the edge by most providers, so two consecutive calls a few milliseconds apart may return the same height even on a healthy chain. If you need a fresh value every time, accept that one in a row may be stale.
- On rollups (Optimism, Arbitrum, Base) the returned value is the L2 block — not the L1 batch in which it was included. Use the chain-specific
l1_*namespace if you need L1 confirmation height. - Each call counts as 1 Compute Unit under TheRPC's pricing — same as every other read.
See also
- eth_getBlockByNumber — fetch the full block once you have its height.
- eth_getBlockByHash — lookup by hash instead of height.
- eth_syncing — check whether the node is still catching up.