HomePhabricator

[Chronik] Refactor: Split `load_block_undo` out of `bridge_block`

Description

[Chronik] Refactor: Split load_block_undo out of bridge_block

Summary:
Currently, the design that bridge_block internally reads the undo data is a bit unintuitive, especially since it doesn't take ChronikBridge as reference nor has "load" in the name.

This diff splits out the loading of the undo data from bridge_block such that bridge_block becomes a completely IO free function that only rearranges the inputs in memory, just like bridge_tx.

load_block_undo now basically does nothing but IO, which also ich much clearer.

Note that we currently "needlessly" put this into ChronikBridge, however, this parallels with load_block, and allows BlockManager to be backported from Core without being blocked by Chronik.

Test Plan: ninja check && ninja check-functional

Reviewers: Fabien, #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Event Timeline