HomePhabricator

[Chronik] Bridge txs in `bridge_block`

Description

[Chronik] Bridge txs in bridge_block

Summary:
To index txs, we have to bridge them over from the node.

Therefore, we add shared structs for BlockTx, Tx, OutPoint, TxInput, TxOutput, Coin, and bridge them in bridge_block.

We also set the positions for the block and undo data for each individual tx, so we can later read them again. This is a rather dangerous thing and easy to get wrong, which is why we thoroughly test this behavior. We add ReadTxFromDisk and ReadTxUndoFromDisk to blockstorage.h to test this. We'll need this later when querying txs anyway.

Test Plan: ninja test_bitcoin && ./src/test/test_bitcoin -t bridge_tests

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Mar 25 2023, 08:44
tobias_ruckPushed on Mar 25 2023, 13:07
Reviewer
Restricted Project
Differential Revision
D13428: [Chronik] Bridge txs in `bridge_block`
Parents
rABCa76e6da794e6: [Chronik] Add `TxReader` and `TxWriter`
Branches
Unknown
Tags
Unknown