algorand / go-algorand

Algorand's official implementation in Go.
https://developer.algorand.org/
Other
1.35k stars 473 forks source link

transactions/pending/txid API call sometimes returns already confirmed transactions with round == 0 #485

Closed ejbaran closed 4 years ago

ejbaran commented 5 years ago

Subject of the issue

v1/transactions/pending/<txid> will show transactions that have already been confirmed when they are far in the past (not sure what the cutoff is) with round set to 0 as if it is still pending. Example of confirmed transaction on betanet that shows as pending: https://betanet.algoexplorer.io/tx/GKGM27HHNXD4NL5XA77WMQTVG66FJ6ZW2HZ4NR2TVMFAB2P3GMAA

Call that shows it as still pending: /v1/transactions/pending/GKGM27HHNXD4NL5XA77WMQTVG66FJ6ZW2HZ4NR2TVMFAB2P3GMAA

This does not seem to occur for recently confirmed transactions.

Your environment

8589934592 2.0.0.beta [rel/beta] (commit #38368dff) go-algorand is licensed with AGPLv3.0 source code available at https://github.com/algorand/go-algorand

Steps to reproduce

Confirm a transaction has been committed to the blockchain past the point at which your node is able to retrieve it (for non-archival nodes). Then call v1/transactions/pending/ on that transaction to see that round == 0.

Expected behaviour

Should return the correct round number or error if there is no record of it on that node (due to it being too far in the past).

Actual behaviour

It returns the tx with round == 0 making it seem like it is still pending.

algorotem commented 4 years ago

API v2 should fix it.