You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
9d9a745 assumeutxo: Remove BLOCK_ASSUMED_VALID flag (Ryan Ofsky)
ef174e9 test: assumeutxo snapshot block CheckBlockIndex crash test (Ryan Ofsky)
0391458 test: assumeutxo stale block CheckBlockIndex crash test (Ryan Ofsky)
ef29c8b assumeutxo: Get rid of faked nTx and nChainTx values (Ryan Ofsky)
9b97d5b doc: Improve comments describing setBlockIndexCandidates checks (Ryan Ofsky)
0fd915e validation: Check GuessVerificationProgress is not called with disconnected block (Ryan Ofsky)
63e8fc9 ci: add getchaintxstats ubsan suppressions (Ryan Ofsky)
f252e68 assumeutxo test: Add RPC test for fake nTx and nChainTx values (Ryan Ofsky)
Pull request description:
The `PopulateAndValidateSnapshot` function introduced in f6e2da5 from #19806 has been setting fake `nTx` and `nChainTx` values that can show up in RPC results (bitcoin/bitcoin#29328) and make `CBlockIndex` state hard to reason about, because it is difficult to know whether the values are real or fake.
Revert to previous behavior of setting `nTx` and `nChainTx` to 0 when the values are unknown, instead of faking them. Also drop no-longer needed `BLOCK_ASSUMED_VALID` flag.
Dropping the faked values also fixes assert failures in the `CheckBlockIndex` `(pindex->nChainTx == pindex->nTx + prev_chain_tx)` check that could happen previously if forked or out-of-order blocks before the snapshot got submitted while the snapshot was being validated. The PR includes two commits adding tests for these failures and describing them in detail.
Compatibility note: This change could cause new `-checkblockindex` failures if a snapshot was loaded by a previous version of Bitcoin Core and not fully validated, because fake `nTx` values will have been saved to the block index. It would be pretty easy to avoid these failures by adding some compatibility code to `LoadBlockIndex` and changing `nTx` values from 1 to 0 when they are fake (when `(pindex->nStatus & BLOCK_VALID_MASK) < BLOCK_VALID_TRANSACTIONS`), but a little simpler not to worry about being compatible in this case.
ACKs for top commit:
Sjors:
re-ACK 9d9a745
achow101:
ACK 9d9a745
mzumsande:
Tested ACK 9d9a745
maflcko:
ACK 9d9a745 🎯
Tree-SHA512: b1e1e2731ec36be30d5f5914042517219378fc31486674030c29d9c7488ed83fb60ba7095600f469dc32f0d8ba79c49ff7706303006507654e1762f26ee416e0
0 commit comments