Reason: The /api/txs/last endpoint is not needed for a wallet, it was just to mimick the API of the old cardanoexplorer and it was (mis)used to see if the database is syncing, but the /api/v2/bestBlock added later on, which shows the last available block is good enough for that.
This endpoint is currently a problem, because it makes a query on the txs table ordering by time which unfortunately is not indexed in the db schema created by the new importer (tangata-manu - see https://github.com/Emurgo/tangata-manu/blob/master/migrations/1551287652718_initial.js), so it takes a lot of time and overloads the db, so it can be abused to take down the service with little effort. We could update the tangata-manu migrations to have that index, but it's probably not worth it since wallets (i.e. adalite) do not need this endpoint.
This PR is removing the
/api/txs/last
endpointReason: The
/api/txs/last
endpoint is not needed for a wallet, it was just to mimick the API of the old cardanoexplorer and it was (mis)used to see if the database is syncing, but the/api/v2/bestBlock
added later on, which shows the last available block is good enough for that.This endpoint is currently a problem, because it makes a query on the
txs
table ordering bytime
which unfortunately is not indexed in the db schema created by the new importer (tangata-manu - see https://github.com/Emurgo/tangata-manu/blob/master/migrations/1551287652718_initial.js), so it takes a lot of time and overloads the db, so it can be abused to take down the service with little effort. We could update the tangata-manu migrations to have that index, but it's probably not worth it since wallets (i.e. adalite) do not need this endpoint.closes #69