HomePhabricator

[alias-server] Determine most recently processed blockheight on new block found

Description

[alias-server] Determine most recently processed blockheight on new block found

Summary:
T2966

Per updated task, it is more memory efficient and imo less prone to errors if, instead of caching the entire tx history, we instead just process through unprocessed blockheights.

This diff gets the highest processed blockheight. Future diffs will use this info to process only unseen confirmed txs.

Test Plan:
npm run mocks and confirm that validAliasesInDb is organized by blockheight least to greatest
node index.js and confirm processedBlockheight appears in console.log. Register a new alias. Confirm processedBlockheight increases on next block found.
In mongo, db.validAliasTxs.drop(), then node index.js
Confirm processedBlockheight is initially zero, then corresponds with most recent blockheight with valid alias txs on next block found

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Subscribers: emack

Differential Revision: https://reviews.bitcoinabc.org/D13328

Details

Provenance
bytesofmanAuthored on Mar 14 2023, 12:46
bytesofmanPushed on Mar 16 2023, 03:42
Reviewer
Restricted Project
Differential Revision
D13328: [alias-server] Determine most recently processed blockheight on new block found
Parents
rABC90358b287bfc: [Automated] Update timing.json
Branches
Unknown
Tags
Unknown