test: Extend named pipe sqlite tool test to use rollback
What changed, and why it matters
This is a routine test-only change for a developer tool. It extends an existing functional test so that the utxo-to-sqlite helper tool is exercised with a 'rollback' snapshot instead of a 'latest' snapshot, and compares the result against the coinstats index. There is no change to production code, no wallet or node behavior change, and no security issue.
No security action needed. Treat as normal test improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/tool_utxo_to_sqlite.py only. It adds -coinstatsindex=1 to the test node arguments, switches the dumptxoutset call from ‘latest’ to ‘rollback’ at height current-10, and changes the assertion to compare the SQLite-derived muhash against the coinstats index muhash for that rollback height. This is purely additional test coverage for the named-pipe + sqlite tool path with rollback snapshots.
Changed components
test/functional/tool_utxo_to_sqlite.pyInspect captured patch +5 / −3
diff --git a/test/functional/tool_utxo_to_sqlite.py b/test/functional/tool_utxo_to_sqlite.py
index d3b3fc43..1c73bd80 100755
--- a/test/functional/tool_utxo_to_sqlite.py
+++ b/test/functional/tool_utxo_to_sqlite.py
@@ -77,7 +77,7 @@ class UtxoToSqliteTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
# we want to create some UTXOs with non-standard output scripts
- self.extra_args = [['-acceptnonstdtxn=1']]
+ self.extra_args = [['-acceptnonstdtxn=1', '-coinstatsindex=1']]
def skip_test_if_missing_module(self):
self.skip_if_no_py_sqlite3()
@@ -143,10 +143,12 @@ class UtxoToSqliteTest(BitcoinTestFramework):
output_direct_filename = os.path.join(self.options.tmpdir, "utxos_direct.sqlite")
p = subprocess.Popen([sys.executable, utxo_to_sqlite_path, fifo_filename, output_direct_filename],
stderr=subprocess.STDOUT)
- node.dumptxoutset(fifo_filename, "latest")
+ target_height = node.getblockcount() - 10
+ node.dumptxoutset(fifo_filename, "rollback", {"rollback": target_height})
p.wait(timeout=10)
muhash_direct_sqlite = calculate_muhash_from_sqlite_utxos(output_direct_filename, "hex", "hex")
- assert_equal(muhash_sqlite, muhash_direct_sqlite)
+ muhash_index = node.gettxoutsetinfo('muhash', target_height)['muhash']
+ assert_equal(muhash_index, muhash_direct_sqlite)
os.remove(fifo_filename)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.