Page MenuHomePhabricator

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

Authored by bytesofman on Mar 14 2023, 12:50.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
alias-server-incremental-tx-history
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22440
Build 44505: Build Diff
Build 44504: arc lint + arc unit

Event Timeline

emack requested changes to this revision.Mar 15 2023, 07:39
emack added a subscriber: emack.

image.png (326×978 px, 91 KB)

everything checks out except the last part. After db.validAliasTxs.drop() and running node index.js it is not initially showing processedBlockheight as zero, it goes straight to the latest processed blockheight.

This revision now requires changes to proceed.Mar 15 2023, 07:39

Seems to be an issue with log function if the data parsing is applied to 0

This revision is now accepted and ready to land.Mar 16 2023, 03:21