Skip to content

Fix: Document hex-only JSON-RPC block number parameters #2013

@alexandratran

Description

@alexandratran

What should be changed?

Update the JSON-RPC docs for the breaking behavior merged in besu-eth/besu#10515.

Besu now rejects decimal string block numbers for RPC parameters backed by BlockParameter. Numeric block numbers must be hex quantity strings with a 0x prefix, or one of the supported block tags such as latest, earliest, pending, finalized, or safe. Decimal strings such as "2", "7", or "55" return -32602 INVALID_PARAMS instead of being parsed.

Suggested docs updates:

  • Update docs/public-networks/how-to/use-besu-api/json-rpc.md#block-parameter to explicitly say numeric block numbers must be 0x-prefixed hexadecimal strings and that decimal strings are invalid.
  • Audit affected API reference sections in docs/public-networks/reference/api/index.md, including admin_logsRemoveCache, admin_generateLogBloomCache, eth_estimateGas, eth_getBlockByNumber, eth_getBlockTransactionCountByNumber, eth_getTransactionByBlockNumberAndIndex, eth_getUncleByBlockNumberAndIndex, eth_getUncleCountByBlockNumber, eth_feeHistory, trace_block, trace_call, trace_callMany, trace_replayBlockTransactions, debug_traceBlockByNumber, debug_traceCall, and debug_replayBlock.
  • Fix examples that still use decimal block strings. One known example is admin_logsRemoveCache, which currently uses "1" and "100"; those should be hex values such as "0x1" and "0x64".
  • Audit docs/private-networks/reference/api.md for private-network RPCs that link to the shared block parameter docs.

Docs page

Issue type

  • Inaccurate content
  • Outdated content
  • Broken or misleading example

Source links

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions