HomePhabricator

[Chronik] Add `MempoolGroupUtxos` to store mempool UTXOs by group

Description

[Chronik] Add MempoolGroupUtxos to store mempool UTXOs by group

Summary:
To return to a user the UTXOs of an address, we also need to index the UTXOs in the mempool.

MempoolGroupUtxos stores all the UTXOs created in the mempool by group.

Note that it doesn't store which UTXOs have been destroyed in the mempool. This is because we already have this info in MempoolSpentBy.

We can query all the UTXOs of the DB using GroupUtxoReader, then remove all the UTXOs spent in the mempool using MempoolSpentBy, and add all the created UTXOs in the mempool using MempoolGroupUtxos.

In the NNG Chronik, we stored this data redundantly; but this actually only increases complexity so we don't do this here.

Depends on D13759.

Test Plan: ninja check-crates

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Apr 25 2023, 12:57
tobias_ruckPushed on Apr 25 2023, 16:14
Reviewer
Restricted Project
Differential Revision
D13760: [Chronik] Add `MempoolGroupUtxos` to store mempool UTXOs by group
Parents
rABC15a3009d3c91: [GUIX] Let cmake use the environment variable for (C|CXX|LD)FLAGS
Branches
Unknown
Tags
Unknown