Skip to content

assumeutxo draft #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

assumeutxo draft #1

wants to merge 7 commits into from

Conversation

PiRK
Copy link
Owner

@PiRK PiRK commented Apr 3, 2025

No description provided.

@PiRK PiRK force-pushed the pr27596 branch 2 times, most recently from ee00f48 to e544699 Compare April 10, 2025 12:59
@PiRK PiRK force-pushed the pr27596 branch 3 times, most recently from c2337a6 to 9817426 Compare April 14, 2025 15:53
PiRK and others added 3 commits April 14, 2025 18:09
Summary:
This is another small backport that can only be tested after we have the loadtxoutset RPC command, but that I think should be included before we allow loadng UTXO snapshot because it may guard against amount malleation in snapshot files (see bitcoin/bitcoin#28685 (comment) "certain negative values seem to result in the same hash as their positive counter part")

This is a partial backport of core#28685
bitcoin/bitcoin@f621392

Test Plan:
`ninja all check-all`

tested on my dev branch in feature_assumeutxo.py

Reviewers: #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D17930
Co-authored-by: Sebastian Falbesoner <[email protected]>

bitcoin/bitcoin@ce585a9
core#28652

rpc: Do not wait for headers inside loadtxoutset

core#29345
Co-authored-by: Ryan Ofsky <[email protected]>

bitcoin/bitcoin@0f64bac
bitcoin/bitcoin@a9ef702 (partial, TODO functional test)
jamesob and others added 4 commits April 14, 2025 18:24
bitcoin/bitcoin@42cae39
core#28589 (race fixes)
core#28590 (getchainstates return a list of chainstates)
core#28625 ( check that loading snapshot not matching AssumeUTXO parameters fails)
bitcoin/bitcoin@fafde92
core#28647 (Add assumeutxo test for wrong hash)
core#28652 (fail early if snapshot block hash doesn't match AssumeUTXO parameters)
core#28562 (`self.no_op`, `self.wait_until`)
core#28666 (assumeutxo file with unknown block hash)
core#28669 (check au file with changed outpoint index)

core#28685 (add tests for coin maleation)
    Bitcoin ABC doesn't have the same malleation issue as Bitcoin Core, it was implemented correctly in D512:
     - Core : `it->second.nHeight * 2 + it->second.fCoinBase ? 1u : 0u` (problem of operator priority, missing parentheses)
     - ABC : `it->second.GetHeight() * 2 + it->second.IsCoinBase()`

    Grab the tests anyway

core#29215 (spend coin from snapshot chainstate after loading)

bitcoin/bitcoin@b7ba60f (add coverage for -reindex and assumeutxo)

core#29354 (Assumeutxo with more than just coinbase transactions)

core#29394 (Add test to ensure failure when mempool not empty)

bitcoin/bitcoin@2bc1ecf (Remove unnecessary sync_blocks in assumeutxo tests)

core#29478 (Add test for loadtxoutset when headers are not synced)

-----

assumeutxo test: Add RPC test for unset nTx and nChainTx values

bitcoin/bitcoin@f252e68
bitcoin/bitcoin@ef29c8b (functional test only)

-----------
test: assumeutxo snapshot block CheckBlockIndex crash test

Add a test for a CheckBlockIndex crash that would happen before previous
"assumeutxo: Get rid of faked nTx and nChainTx values" commit.

The crash was an assert failure in the (pindex->nChainTx == pindex->nTx +
prev_chain_tx) check that would previously happen if the snapshot block was
submitted after loading the snapshot and downloading a few blocks after the
snapshot. In that case ReceivedBlockTransactions() previously would overwrite
the nChainTx value of the submitted snapshot block with a fake value based on
the previous block, so the (pindex->nChainTx == pindex->nTx + prev_chain_tx)
check would later fail on the first block after the snapshot. This test was
originally posted by Martin Zumsande <[email protected]> in
bitcoin/bitcoin#29370 (comment)

Co-authored-by: Martin Zumsande <[email protected]>i

fixme: commit or pr number
------------

core#29617 (test for coin_height > base_height & amount > money_supply)

bitcoin/bitcoin@f621392 (Check deserialized coins for out of range values)

core#30053 (coverage for "Couldn't open file..." error)

core#29973 (ensure failure when importing a snapshot twice)
Co-Authored-By: MarcoFalke <*~=`'#}+{/-|&$^[email protected]>

core#28838
bitcoin/bitcoin@fa5cd66
bitcoin/bitcoin@2bc1ecf
bitcoin/bitcoin@7e3dbe4 (functional test only)
bitcoin/bitcoin@f20fe33

------
test: add functional test for balance after snapshot completion

Use a third node for this, which doesn't get restarted like the second
node.
This test would fail without the previous commit.

fixme: find commit hash

-----

test, assumeutxo: import descriptors during background sync

bitcoin/bitcoin@595edee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants