HomePhabricator

[Chronik] Add `Mempool`, make `/tx/:txid` return mempool txs

Description

[Chronik] Add Mempool, make /tx/:txid return mempool txs

Summary:
We store everything we need to index the mempool in the Mempool struct.

Currently, we redundantly store all the mempool txs again, but this reduces implementation complexity. Once RAM usage becomes an issue, we can make sure we re-use the node's mempool.

To get a mempool tx, we add bridge_tx, which finds the spent coins for us and builds a ffi::Tx.

make_chronik_block now sets the time_first_seen of the mempool.

Depends on D13467.

Test Plan: ninja check-crates && ninja && ./test/functional/test_runner.py chronik_tx

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Mar 27 2023, 10:51
tobias_ruckPushed on Mar 27 2023, 17:33
Reviewer
Restricted Project
Differential Revision
D13468: [Chronik] Add `Mempool`, make `/tx/:txid` return mempool txs
Parents
rABC9514a0915212: [Chronik] Index txs; add `/tx/:txid` HTTP endpoint
Branches
Unknown
Tags
Unknown