Page MenuHomePhabricator

[Cashtab] Batch utxo requests to hydrateUtxos
ClosedPublic

Authored by bytesofman on Apr 9 2021, 17:24.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC90e09af3d859: [Cashtab] Batch utxo requests to hydrateUtxos
Summary

Group calls to BCH.SLP.Utils.hydrateUtxos by batches of utxos, set by new parameter in Ticker.js, for now to 20 to match typical limit in bch-api. The usual batch size limit of 20 is not correctly implemented for the hydrateUtxos method in bch-api. Instead, it will accept unlimited utxos from up to 20 addresses.

This performance optimization will eventually need to be implemented on bch-api to prevent ddos. In the meantime, implementing it here as Cashtab will need to work with bch-api limits.

Test Plan

npm test; also go ahead and give it an npm start and confirm balance and tokens match what is displayed from cashtabapp.com

Diff Detail

Repository
rABC Bitcoin ABC
Branch
batch-hydrate-utxo-requests
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 15490
Build 30900: Build Diffcashtab-tests
Build 30899: arc lint + arc unit

Event Timeline

Fabien added a subscriber: Fabien.
Fabien added inline comments.
web/cashtab/src/utils/cashMethods.js
56 ↗(On Diff #28133)

?

This revision is now accepted and ready to land.Apr 12 2021, 19:22

Remove extra comment, mark mocks as generated