HomePhabricator

RPC: Add type parameter to dumptxoutset

Description

RPC: Add type parameter to dumptxoutset

Summary:
This adds a height parameter to the dumptxoutset RPC. This internalizes the workflow that was previously done by scripts: roll back the chain to the height we actually want the snapshot from, create the snapshot, roll forward to the real tip again.

The nice thing about internalizing this functionality is that we can write tests for the code and it gives us more options to make the functionality robust. The shell scripts we have so far will be more cumbersome to maintain in the long run, especially since we will only notice later when we have broken them.

This is a partial backport of core#29553, core#18836, core#30808 and core#30817


RPC: Add type parameter to dumptxoutset

https://github.com/bitcoin/bitcoin/pull/29553/commits/993cafe7e45ab0af1e862c7def3de688f47c0443


test: Test for dumptxoutset at specific height

https://github.com/bitcoin/bitcoin/pull/29553/commits/842685035244e151f4a10019af2dfe0563f11a82


tests: Add a sha256sum_file function to util

https://github.com/bitcoin/bitcoin/pull/18836/commits/092fc434854f881330771a93a1280ac67b1d3549


assumeutxo: Remove devtools/utxo_snapshot.sh

https://github.com/bitcoin/bitcoin/pull/29553/commits/b29c21fc92dcc3da95bd032ba41675a8b9a0a24b


rpc: Don't re-enable previously disabled network after dumptxoutset

Also fixes a typo in the RPC help text.

https://github.com/bitcoin/bitcoin/pull/30808/commits/598b9bba5aa95d0b5f78ab90ac491f742819047a


refactor: Manage dumptxoutset RAII classes with std::optional

(partial) https://github.com/bitcoin/bitcoin/pull/30817/commits/c2b779da4e7f1bf1a5c5d67ec94cba3027b42ee7

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Fabian Jahr <fjahr@protonmail.com>Authored on Mar 2 2024, 15:43
PiRKCommitted on Mon, May 5, 14:54
PiRKPushed on Mon, May 5, 14:54
Reviewer
Restricted Project
Differential Revision
D18047: RPC: Add type parameter to dumptxoutset
Parents
rABC7c5b0ee93f30: test: fix another intermittent fault in p2p_leak
Branches
Unknown
Tags
Unknown