HomePhabricator

[Chronik] Fix non-token inputs of bare burns

Description

[Chronik] Fix non-token inputs of bare burns

Summary:
Currently, inputs that have no token at all are skipped in process_non_token_tx, which is incorrect. Instead, it should add a NoToken input, as per this diff.

We also add an automatic upgrade mechanism to find and fix token txs that were incorrectly indexed, so users don't have to do a costly reindex. The upgrade takes around 3-5 minutes, depending on hardware.

Test Plan:

  1. ./test/functional/test_runner.py chronik_token_burn
  2. Run this patch on an existing instance, it will upgrade a few thousand token txs
  3. Test if 94ee31593d5ebc68c23c6c927752a404a0d1fc016d13a12388f12fc4c212b938 has the 0th input without tokens, and the 3rd input with 400 CACHET (if it failed, it would have the 0th input with 200 CACHET and the 3rd input without any tokens)

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Aug 3 2024, 15:58
tobias_ruckPushed on Aug 3 2024, 19:14
Reviewer
Restricted Project
Differential Revision
Restricted Differential Revision
Parents
rABC4433eca8dfa3: rpc, docs: Add note for commands that supports only legacy wallets
Branches
Unknown
Tags
Unknown