Optimism
Bereit, das in der Produktion aufzurufen?
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
Optimism
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
eth_getUncleCountByBlockNumber returns the number of uncle blocks referenced by the block at a given height or block tag. On OP Mainnet — the ETH-gas OP Stack rollup at chain ID 10 (0xa) that settles to Ethereum L1 — that count is always 0x0. The chain is built by a single sequencer with no proof-of-work competition, so no orphaned sibling blocks ever become uncles. Point the call at https://optimism.therpc.io/YOUR_API_KEY with any height or tag such as latest, and it returns zero uncles; the method is retained purely for Ethereum JSON-RPC compatibility.
0x0, so the resulting rate is flat zero.eth_getUncleByBlockNumberAndIndex — though on OP Mainnet the 0x0 answer tells you upfront there are no uncle details to fetch.| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | blockTag | string | Ja | The block to count uncles in. |
| Typ | Beschreibung |
|---|---|
| string (hex) | Hex-encoded uncle count. |
Try it live in the Optimism playground.
| Code | Meldung | Ursache |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or unrecognised. |
0x0 regardless of which block or tag you query — its OP Stack consensus produces no uncles, so never branch on a non-zero count here."0x0"), not a number — parse it (for example parseInt(result, 16)) before doing any numeric comparison.Parameter
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"