Page MenuHomePhabricator

[Chronik] Fix bug in MINT VAULT indexing
ClosedPublic

Authored by tobias_ruck on Oct 16 2024, 08:07.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC3d229b849ce0: [Chronik] Fix bug in MINT VAULT indexing
Summary

Currently, MINT VAULT transactions that have no output quanitty will be indexed incorrectly once they are mined.

An example is this transaction, which is reported to have "Missing MINT vault", but in fact it does have a MINT vault.

The bug originates from an optimization that doesn't store "empty" token transactions; however, the indexer also stores whether a tx had a valid MINT vault, and assumes it doesn't if there's no corresponding entry in the DB.

The fix is very simple, we just always index MINT vault transactions that have a valid MINT vault input (and thus the FLAGS_HAS_MINT_VAULT flag is saved to the DB).

This requires a reindex of the DB; fixing the DB automatically it would require scanning all txs since the first known MINT vault GENESIS tx, which seems a bit overkill. Also, D16899 is another reason to reindex.

Test Plan

./test/functional/test_runner.py chronik_token_slp_mint_vault

Diff Detail

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

Event Timeline

test/functional/chronik_token_slp_mint_vault.py
246 ↗(On Diff #50136)

This should better be a self.log.info() call but it's nowhere used in this test so let's keep it for another diff.

This revision is now accepted and ready to land.Oct 16 2024, 08:41