I maintain a wallet that uses bitcoin-cli
for signing transactions, and its test system uses regtest to create a bunch of UTXOs for the signing tests to sign. These tests use a git-committed wallet.dat
that is copied into the newly-created datadir
before launching bitcoind
.
For years, up until bc886fcb31e1afa7bbf7b86bfd93e51da7076ccf (part of #24699), this was stable and worked well. Occasionally I would need to recreate all the transactions when this project changed mining (#24732) or coin selection (#24584) but I could handle that.
What I can’t handle is having the generated transactions be different each time I run the exact same sequence of bitcoin-cli
commands starting from the same wallet.dat
. Starting with bc886fcb31e1afa7bbf7b86bfd93e51da7076ccf, that’s what happens.
Is this a supported use model, or is it unreasonable to expect this to be stable?
Summarizing:
- v0.20.0 – stable
- v0.21.0 – stable
- v22.0 – stable
- v23.0 – stable
- 272356024db978c92112167f8d8e4cc62adad63d (which is bc886fcb31e1afa7bbf7b86bfd93e51da7076ccf^) – stable
- bc886fcb31e1afa7bbf7b86bfd93e51da7076ccf – unstable
- v24.0rc2 – unstable
- Current master (f37bd15d472fdc7dd3d40cafaba9e8dfddd6b530) – unstable
Expected behavior
The generated transactions should be identical given an identical series of bitcoin-cli
calls.
Actual behavior
The generated transactions choose different input coins from the regtest blockchain every time I run.
To reproduce
In my Glacier wallet fork, run t/online_regtest_wallet.py recreate-all-tests
; git commit the result. Run the same command again – git status
should show no changes.
When it’s unstable, dozens of files change.
System information
Running on Whonix 16. Building inside the git repo as such:
0(cd depends && make -j4 NO_QT=1) && ./autogen.sh && ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu && make -j4