Skip to content

eth_getLogs: improve prune error message #13198

@AskAlexSharov

Description

@AskAlexSharov

current error message:

seek with txNum=1962853355 but data before txNum=2662500000 is not available: blockNum=16999999, txNum=1962853355, seek with txNum=1962853355 but data before txNum=2662500000 is not available

example request:

curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method": "eth_getLogs","params": [ {"fromBlock": "0x103663f", "toBlock": "0x103663f"} ], "id":1}' -s localhost:8546


{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"state transitaion failed: seek with txNum=1962853355 but data before txNum=2662500000 is not available: blockNum=16999999, txNum=1962853355, seek with txNum=1962853355 but data before txNum=2662500000 is not available"}}
  1. user didn't request txNum
  2. user likely doesn't know what is TxNum - because it's not Ethereum concept
  3. reason why data is not available is not clear. reason is: "likely pruned"
  4. error message repeated twice
  5. This is error message from ii.seekInFiles method (GetAsOf). But we have special error message: state.PrunedError for this cases. It's because we have several places where NewHistoryReaderV3 created without CreateHistoryStateReader helper. My advise (but up to you) - let's move .StateHistoryStartFrom() call inside SetTxNum method.

thank you

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions