Page MenuHomePhabricator

[alias-server] Implement new db collection serverState to track count of confirmedTxs
AbandonedPublic

Authored by bytesofman on Mar 16 2023, 21:51.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Summary

T2966

Depends on D13360

Add new database collection serverState that currently contains {processedConfirmedTxs: <numberOfProcessedConfirmedTxs}

With this number accurately tracked, it is no longer necessary to store the full tx history in the confirmedTxHistory collection.

A later diff will deprecate the confirmedTxHistory collection, as it would become quite enormous on the IFP address, defeating the point of using the blockchain as the db of record for this service.

Test Plan

Delete all tables related to this app.

mongosh
use ecashAliases
db.validAliasTxs.drop()
db.confirmedTxHistory.drop()

Start up the app
node index.js
App syncs correctly with new processedConfirmedTxs var matching total confirmed txs of test alias address
Register a few new aliases, send some non-alias txs to the test address
confirm processedConfirmedTxs increments appropriately, and the new aliases are picked up
npm test and all pass
npm run live and all pass

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22749
Build 45118: Build Diff
Build 45117: arc lint + arc unit

Event Timeline

emack requested changes to this revision.Mar 25 2023, 04:41
emack added a subscriber: emack.

Everything checks out except the final step in running npm run live, looks like it's still somehow being rate limited

image.png (410×1 px, 86 KB)

This revision now requires changes to proceed.Mar 25 2023, 04:41
This revision is now accepted and ready to land.Mar 28 2023, 23:23