HomePhabricator

[alias-server] Only add aliases to db if blockheight is avalanche confirmed

Description

[alias-server] Only add aliases to db if blockheight is avalanche confirmed

Summary:
This is (almost) handled by only trying to update the server state if we have a blockheight that is avalanche confirmed. However, the chronik call to get tx history occurs after we have this avalanche confirmed block.

Possible edge case where

  1. Block comes in as avalanche confirmed
  2. Another block confirms before chronik call to get tx history
  3. Tx history is returned with some txs having a blockheight higher than the avalanche confirmed height of the server

In this case, we do not want to add any of these txs as valid alias registrations. They may indeed be valid, but they need to be picked up in the next loop processing an avalanche confirmed block.

Test Plan: npm test

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
bytesofmanAuthored on Jul 28 2023, 18:20
bytesofmanPushed on Jul 28 2023, 20:20
Reviewer
Restricted Project
Differential Revision
D14321: [alias-server] Only add aliases to db if blockheight is avalanche confirmed
Parents
rABC313627592385: [alias-server] Return price and price expiration blockheight from /alias…
Branches
Unknown
Tags
Unknown