Gnosis

Gnosis

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-confirmations helpers 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.

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x14a3b27"
}

Notes for production use

  1. 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.
  2. 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.
  3. Each call counts as 1 Compute Unit under TheRPC's pricing — same as every other read.

See also

curl https://gnosis.therpc.io \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.