Nil Pointer Dereference Error When Querying Transactions with Proof in CometBFT #3352
Description
Bug Report
Have you tried the latest version: yes
ABCI app: any CosmosSDK chain
What happened?
When querying a transaction from LCD, that has min_retain_blocks set, the result is nil pointer error for transactions from blocks that had been deleted away.
for example:
{"code":2,"message":"runtime error: invalid memory address or nil pointer dereference: panic","details":[]}
The transaction itself is present in the CometBFT, which can be proved by calling the TX RPC endpoint directly with and without a proof.
{
"jsonrpc": "2.0",
"id": -1,
"error": {
"code": -32603,
"message": "Internal error",
"data": "runtime error: invalid memory address or nil pointer dereference"
}
}
{
"jsonrpc": "2.0",
"id": -1,
"result": {
"hash": "71B0034D463EC79CB0011C7F4EA9EE3B39342AF6BE40AA0402C672A43B21DA3B",
"height": "75002060",
"index": 5,
"tx_result": {
"code": 0,
"data":
omitted
Root cause for the nil pointer error can be found here. When block is no longer available, LoadBlock returns nil Block, which triggers the panic on the next line.
Lines 116 to 117 in 7f24fd2
What did you expect to happen?
I expect an error stating that proof is not available, since block had been pruned away.
Metadata
Assignees
Labels
Type
Projects
Status
Done