Optimism
Optimism
Optimism
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
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.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockTag | string | 是 | The block to count uncles in. |
| 类型 | 描述 |
|---|---|
| string (hex) | Hex-encoded uncle count. |
Try it live in the Optimism playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-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.参数
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"