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:
- Error code: return
4444 instead of -32000 for receipt/history unavailability in eth_getLogs.
- Error message: align to
"pruned history unavailable".
Geth reference: internal/ethapi/api.go — errMissingReceipts 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.
Description
The
eth_getLogs@forked_blocksfixture 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:4444"pruned history unavailable"-32000"Receipt not available for From block X."Geth uses error code
4444for EIP-4444 historical data unavailability. NM uses the legacy-32000generic 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:4444instead of-32000for receipt/history unavailability ineth_getLogs."pruned history unavailable".Geth reference:
internal/ethapi/api.go—errMissingReceiptsreturns4444.Notes
4444is the EIP-4444 reserved code for "historical data not available". Distinct from-32000(generic server error).eth_getLogs@forked_blocksfixture set. There are 92 fixture tarballs inintegration/mainnet/eth_getLogs@forked_blocks/and 50 diff files inlogs/integration/mainnet/results/eth_getLogs@forked_blocks/(3 result files per test: NM response, Geth response, diff). All 50 diffs showerror.code: 4444 -> -32000anderror.message: "pruned history unavailable" -> "Receipt not available for From block X.". All 50 flip to PASS when the code and message are aligned.14419460,14669345,5747919,12259574,7738073,5908317,17261027,15365591,18851891, and ~40 more.