vacuumlabs / adalite-backend-service

Icarus, a reference implementation for a lightweight wallet developed by the IOHK Engineering Team.
Apache License 2.0
2 stars 7 forks source link

Remove /api/txs/last endpoint #70

Closed refi93 closed 4 years ago

refi93 commented 4 years ago

This PR is removing the /api/txs/last endpoint

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.

closes #69