Test loadtxoutset RPC method#537
Merged
tcharding merged 1 commit intorust-bitcoin:masterfrom Apr 2, 2026
Merged
Conversation
tcharding
reviewed
Apr 1, 2026
Comment on lines
+123
to
+126
| let loaded: LoadTxOutSet = | ||
| node_b.client.load_tx_out_set(dump_path).expect("loadtxoutset should succeed"); | ||
|
|
||
| let model = loaded.into_model().expect("into_model"); |
Member
There was a problem hiding this comment.
let json: LoadTxOutSet =
node_b.client.load_tx_out_set(dump_path).expect("loadtxoutset should succeed");
let model: Result<mtype::LoadTxOutSet, LoadTxOutSetError> = json.into_model();
let model = model.unwrap();Testing loadtxoutset on regtest requires a deterministic chain that produces a state matching the hardcoded assumeutxo entry in Bitcoin Core’s chainparams. Without this alignment, a standard dump-and-load cycle on a random regtest chain will always be rejected. Replicate Bitcoin Core's C++ TestChain100Setup deterministic chain (mocktime 1598887952, P2PK coinbase to compressed pubkey of private key 0x01, 110 blocks) so the resulting block hash matches the assumeutxo entry. Dump the UTXO set from the miner node, feed headers to a fresh node via submitheader, then load the snapshot and verify the model. Wire the load_tx_out_set client macro into v27 through v30, which were missing the call.
c33cab7 to
913d526
Compare
tcharding
approved these changes
Apr 2, 2026
Member
|
This was nice work bro, keep it coming! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Testing loadtxoutset on regtest requires a deterministic chain that produces a state matching the hardcoded assumeutxo entry in Bitcoin Core’s chainparams . Without this alignment, a standard dump-and-load cycle on a random regtest chain will always be rejected.
Replicate Bitcoin Core's C++ TestChain100Setup deterministic chain (mocktime 1598887952, P2PK coinbase to compressed pubkey of private key 0x01, 110 blocks) so the resulting block hash matches the assumeutxo entry. Dump the UTXO set from the miner node, feed headers to a fresh node via submitheader, then load the snapshot and verify the model.
Wire the load_tx_out_set client macro into v27 through v30, which were missing the call.
closes #313