ton-blockchain / ton

Main TON monorepo
Other
2.89k stars 848 forks source link

getTransaction API request fails under specific conditions #1105

Open ch-4ml opened 1 month ago

ch-4ml commented 1 month ago

The getTransactions?address=${address}&limit=${limit} request fails under specific conditions.

If the number of queryable transactions for the given address is less than the limit, it should be possible to retrieve only the transactions within that range.

For example, if there are actually 8 queryable transactions and the limit option is set to 10, the response should include information for 8 transactions.

The following response is returned: { "ok": false, "error": "LITE_SERVER_UNKNOWN: cannot compute block with specified transaction: cannot find block (0,ee5241437c5c7412) lt=47596406000001: lt not in db", "code": 500 }

Call getTransactions?address=${address}&limit=100 for random accounts - preferably accounts with infrequent transactions. Some accounts successfully return a list of transactions, while others return the error mentioned above.

This can also be verified at https://toncenter.com/api/v2.

Mac OS (Apple Silicon)

ch-4ml commented 1 month ago

When I use { archival: true }, it worked as intended.

But I think it's still needed even on non-archived light servers.

If the number of queryable transactions for the given address is less than the limit, it should be possible to retrieve only the transactions within that range.