Page MenuHomePhabricator

[alias-server] Ignore tx history before aliases active
ClosedPublic

Authored by bytesofman on Jun 20 2023, 22:53.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC753bc4eaaad1: [alias-server] Ignore tx history before aliases active
Summary

T3060

chronik can be overloaded on app startup if it fetches the entire history of the IFP address. We have no need to fetch the tx history before alias txs start. So, initialize server state to that point.

Note: this can be deprecated when we migrate to the node version of chronik, which allows getting txHistory after a set txid.

Test Plan

npm test

If you want to confirm there are in fact 45587 confirmed txs thru blockheight 785000 on the IFP address, can do with by

npm run generateMocks
Inspect test/mocks/generated/aliasTxHistory.json (will need to write a script, it's an array ~130MB)

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emack requested changes to this revision.Jun 21 2023, 01:34
emack added a subscriber: emack.

npm run generateMocks runs into the following issue, is this related to the chronik outage?

image.png (362×1 px, 92 KB)

In any case, I queried the existing aliasTxHistory.json file via grep -o 'timeFirstSeen' test/mocks/generated/aliasTxHistory.json | wc -l and I'm already getting 57,623 transactions rather than 45587 stated in the config.

image.png (40×1 px, 11 KB)

This revision now requires changes to proceed.Jun 21 2023, 01:34

npm run generateMocks runs into the following issue, is this related to the chronik outage?

image.png (362×1 px, 92 KB)

It looks like you are getting the same "overload" issue I get when I try to run this function on my server. For whatever reason, I'm able to run it locally.

In any case, I queried the existing aliasTxHistory.json file via grep -o 'timeFirstSeen' test/mocks/generated/aliasTxHistory.json | wc -l and I'm already getting 57,623 transactions rather than 45587 stated in the config.

image.png (40×1 px, 11 KB)

We're looking for the number of txs through blockheight 785000, not the total

txs count of 45587 verified after filtering for block.height <= 785000

This revision is now accepted and ready to land.Jun 21 2023, 07:07