Skip to content

eth_getLogs (forked blocks): NM returns -32000 instead of EIP-4444 error code 4444 #12089

Description

@manusw7

Description

The eth_getLogs@forked_blocks fixture set queries logs for historical block ranges that were reorged out of the canonical chain. Both Geth and NM return errors, but they diverge on code and message:

Error code Message
Geth 4444 "pruned history unavailable"
NM -32000 "Receipt not available for From block X."

Geth uses error code 4444 for EIP-4444 historical data unavailability. NM uses the legacy -32000 generic server error with a node-specific message. This causes a code+message mismatch on every forked-block log query.

Steps to Reproduce

{
  "jsonrpc": "2.0",
  "method": "eth_getLogs",
  "params": [{ "fromBlock": "0xd9a4e2", "toBlock": "0xd9a4e2" }],
  "id": 1
}

(0xd9a4e2 = block 14319330, pruned/reorged on the test node)

Expected (Geth)

{"jsonrpc":"2.0","id":1,"error":{"code":4444,"message":"pruned history unavailable"}}

Actual (Nethermind v1.39.0-rc+c6739713)

{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"Receipt not available for From block 14319330."}}

Fix Location

The receipt-unavailability path in NM's LogFinder / EthRpcModule (search for "Receipt not available"). Two changes:

  1. Error code: return 4444 instead of -32000 for receipt/history unavailability in eth_getLogs.
  2. Error message: align to "pruned history unavailable".

Geth reference: internal/ethapi/api.goerrMissingReceipts returns 4444.

Notes

  • 4444 is the EIP-4444 reserved code for "historical data not available". Distinct from -32000 (generic server error).
  • Scope: the entire eth_getLogs@forked_blocks fixture set. There are 92 fixture tarballs in integration/mainnet/eth_getLogs@forked_blocks/ and 50 diff files in logs/integration/mainnet/results/eth_getLogs@forked_blocks/ (3 result files per test: NM response, Geth response, diff). All 50 diffs show error.code: 4444 -> -32000 and error.message: "pruned history unavailable" -> "Receipt not available for From block X.". All 50 flip to PASS when the code and message are aligned.
  • Sample affected blocks: 14419460, 14669345, 5747919, 12259574, 7738073, 5908317, 17261027, 15365591, 18851891, and ~40 more.

Metadata

Metadata

Assignees

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