This is a partial backport of [[https://github.com/bitcoin/bitcoin/pull/27596 | core#27596]], [[https://github.com/bitcoin/bitcoin/pull/28652 | core#28652]], [[https://github.com/bitcoin/bitcoin/pull/29345 | core#29345]], [[https://github.com/bitcoin/bitcoin/pull/28589 | core#28589]], [[https://github.com/bitcoin/bitcoin/pull/28590 | core#28590]], [[https://github.com/bitcoin/bitcoin/pull/28625 | core#28625]], [[https://github.com/bitcoin/bitcoin/pull/28639 | core#28639]], [[https://github.com/bitcoin/bitcoin/pull/28647 | core#28647]], [[https://github.com/bitcoin/bitcoin/pull/28562 | core#28562]], [[https://github.com/bitcoin/bitcoin/pull/28666 | core#28666]], [[https://github.com/bitcoin/bitcoin/pull/28669 | core#28669]], [[https://github.com/bitcoin/bitcoin/pull/28685 | core#28685]], [[https://github.com/bitcoin/bitcoin/pull/29215 | core#29215]], [[https://github.com/bitcoin/bitcoin/pull/29726 | core#29726]], [[https://github.com/bitcoin/bitcoin/pull/29354 | core#29354]], [[https://github.com/bitcoin/bitcoin/pull/29394 | core#29394]], [[https://github.com/bitcoin/bitcoin/pull/29478 | core#29478]], [[https://github.com/bitcoin/bitcoin/pull/29370 | core#29370]], [[https://github.com/bitcoin/bitcoin/pull/29617 | core#29617]], [[https://github.com/bitcoin/bitcoin/pull/28685 | core#28685]], [[https://github.com/bitcoin/bitcoin/pull/30053 | core#30053]], [[https://github.com/bitcoin/bitcoin/pull/29973 | core#29973]], [[https://github.com/bitcoin/bitcoin/pull/28838 | core#28838]], [[https://github.com/bitcoin/bitcoin/pull/29354 | core#29354]], [[https://github.com/bitcoin/bitcoin/pull/29478 | core#29478]], [[https://github.com/bitcoin/bitcoin/pull/30678 | core#30678]], [[https://github.com/bitcoin/bitcoin/pull/31556 | core#31556]] and [[https://github.com/bitcoin/bitcoin/pull/30909 | core#30909]]
Depends on D17933
------
rpc: add loadtxoutset
Co-authored-by: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
https://github.com/bitcoin/bitcoin/pull/27596/commits/ce585a9a158476b0ad3296477b922e79f308e795
[[https://github.com/bitcoin/bitcoin/pull/28652 | core#28652]]
[[https://github.com/bitcoin/bitcoin/pull/29345 | core#29345]]
------
rpc: add getchainstates
Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
https://github.com/bitcoin/bitcoin/pull/27596/commits/0f64bac6030334d798ae205cd7af4bf248feddd9
https://github.com/bitcoin/bitcoin/pull/28590/commits/a9ef702a877a964bac724a56e2c0b5bee4ea7586
----
test: add feature_assumeutxo functional test
Initial commit: https://github.com/bitcoin/bitcoin/pull/27596/commits/42cae39356fd20d521aaf99aff1ed85856f3c9f3
[[https://github.com/bitcoin/bitcoin/pull/28589 | core#28589]] (race fixes)
[[https://github.com/bitcoin/bitcoin/pull/28590 | core#28590]] (getchainstates return a list of chainstates)
[[https://github.com/bitcoin/bitcoin/pull/28625 | core#28625]] ( check that loading snapshot not matching AssumeUTXO parameters fails)
https://github.com/bitcoin/bitcoin/pull/28639/commits/fafde92f84fb7c245bc3c1cd946a32c891861e5e
[[https://github.com/bitcoin/bitcoin/pull/28647 | core#28647]] (Add assumeutxo test for wrong hash)
[[https://github.com/bitcoin/bitcoin/pull/28652 | core#28652]] (fail early if snapshot block hash doesn't match AssumeUTXO parameters)
[[https://github.com/bitcoin/bitcoin/pull/28562 | core#28562]] (`self.no_op`, `self.wait_until`)
[[https://github.com/bitcoin/bitcoin/pull/28666 | core#28666]] (assumeutxo file with unknown block hash)
[[https://github.com/bitcoin/bitcoin/pull/28669 | core#28669]] (check au file with changed outpoint index)
[[https://github.com/bitcoin/bitcoin/pull/28685 | core#28685]] (add tests for coin maleation)
[[https://github.com/bitcoin/bitcoin/pull/29215 | core#29215]] (spend coin from snapshot chainstate after loading)
https://github.com/bitcoin/bitcoin/pull/29726/commits/b7ba60f81a33db876f88b5f9af1e5025d679b5be (add coverage for -reindex and assumeutxo)
[[https://github.com/bitcoin/bitcoin/pull/29354 | core#29354]] (Assumeutxo with more than just coinbase transactions)
[[https://github.com/bitcoin/bitcoin/pull/29394 | core#29394]] (Add test to ensure failure when mempool not empty)
https://github.com/bitcoin/bitcoin/pull/29478/commits/2bc1ecfaa9b69a20388e913ec64967de2f506cd3 (Remove unnecessary sync_blocks in assumeutxo tests)
[[https://github.com/bitcoin/bitcoin/pull/29478 | core#29478]] (Add test for loadtxoutset when headers are not synced)
[[https://github.com/bitcoin/bitcoin/pull/29370 | core#29370]] (RPC test for fake nTx and nChainTX values, stale block CheckBlockIndex crash test & assumeutxo snapshot block CheckBlockIndex crash test)
[[https://github.com/bitcoin/bitcoin/pull/29617 | core#29617]] (test for coin_height > base_height & amount > money_supply)
https://github.com/bitcoin/bitcoin/pull/28685/commits/f6213929c519d0e615cacd3d6f479f1517be1662 (Check deserialized coins for out of range values)
[[https://github.com/bitcoin/bitcoin/pull/30053 | core#30053]] (coverage for "Couldn't open file..." error)
[[https://github.com/bitcoin/bitcoin/pull/29973 | core#29973]] (ensure failure when importing a snapshot twice)
------
test: add assumeutxo wallet test
initial commit: [[https://github.com/bitcoin/bitcoin/pull/28838 | core#28838]]
https://github.com/bitcoin/bitcoin/pull/29354/commits/fa5cd66f0a47d1b759c93d01524ee4558432c0cc (Assumeutxo with more than just coinbase transactions)
https://github.com/bitcoin/bitcoin/pull/29478/commits/2bc1ecfaa9b69a20388e913ec64967de2f506cd3 (Remove unnecessary sync_blocks in assumeutxo tests)
https://github.com/bitcoin/bitcoin/pull/30678/commits/7e3dbe4180cbeb65e59b53d9fa98509e9189549d (functional test only)
https://github.com/bitcoin/bitcoin/pull/30678/commits/f20fe33e94c6752e5d2ed92511c0bf51a10716ee (Add basic balance coverage)
https://github.com/bitcoin/bitcoin/pull/31556/commits/bc43ecaf6dc0830a27296d3a29428814fed07bb1 (test for balance after snapshot completion)
https://github.com/bitcoin/bitcoin/pull/30909/commits/595edee169045b6735b76ff9721677f0e43f13e5 (import descriptors during background sync)