HomePhabricator

[ecash-herald, mock-chronik-client, alias-server] Migrate ecash-herald to in…

Description

[ecash-herald, mock-chronik-client, alias-server] Migrate ecash-herald to in-node chronik-client and add supporting mock-chronik-client methods

Summary:
Migrate ecash-herald to in-node chronik-client

This diff is intended to maintain existing functionality of existing ecash-herald with as little refactoring as possible. New in-node chronik-client allows for many improvements to ecash-herald that will be handled in other refactors.

ALP txs now appear under "eToken sends" and not EMPP

Currently, we can detect a block that is found but rejected by avalanche bc the herald will send an error msg -- the block connects, but is not indexed, so the herald's chronik.block call fails and we see a default msg. ABC devs get what is going on but this is not clear to users.

I've added caching to preserve this alert feature. When a block is connected, ecash-herald will wait 10s. If no finalized msg comes in, a "block connected but not finalized by avalanche for 10s" is sent.

I added unit tests for this behavior and also got the msg to send testing prod by waiting 10ms instead of 10s:

image.png (201×644 px, 27 KB)

In practical testing, the BLK_FINALIZED msg seems to come in only a few seconds after the BLK_CONNECTED msg.

Some adjustments are made to alias-server unit tests because the mock-chronik-client change breaks them. Imo this removal is justified because

  • the behavior tested in alias-server (ws subscription) is not important to test...really it's testing the dependency.
  • alias-server will need to implement in-node chronik if alias path fwd still requires its use. in this case, it will need the mock-chronik-client changes introduced in this diff, just like the herald did.
  • does not make sense to implement in-node chronik-client in alias-server in this diff just to preserve these tests, the behavior change is expected. implementing in-node chronik-client in alias-server should be its own diff.

Test Plan:
npm test, CI for mock-chronik-client

Test block msg from nng:

image.png (769×634 px, 113 KB)

image.png (613×634 px, 141 KB)

Test block msg now:

image.png (740×613 px, 97 KB)

image.png (655×637 px, 157 KB)

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien, PiRK

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

Details

Provenance
bytesofmanAuthored on May 15 2024, 22:49
bytesofmanPushed on Tue, May 28, 12:56
Reviewer
Restricted Project
Differential Revision
D16171: [ecash-herald, mock-chronik-client, alias-server] Migrate ecash-herald to in-node chronik-client and add supporting mock-chronik-client methods
Parents
rABCda3768cf9394: Bump version to 0.29.5
Branches
Unknown
Tags
Unknown