[[nodiscard]]#169
Draft
l0rinc wants to merge 5 commits into
Draft
Conversation
Return an invalid block validation state when `InvalidateBlock` is asked to invalidate genesis instead of returning false with a valid state. Extend the existing invalidation unit test to cover the genesis case so callers can reliably surface this failure.
Check the boolean result from manual block and header validation APIs instead of relying only on `BlockValidationState`. This lets RPC callers surface failures where the callee returns false without changing the validation state.
Stop import processing with a fatal error if the post-reindex `LoadGenesisBlock` retry fails. This avoids continuing after the recovery path that is meant to ensure the genesis block exists did not succeed.
Check validation-internal `FlushStateToDisk` and `ResizeCoinsCaches` results where failure was previously ignored. Propagate failures from block acceptance and snapshot activation, and log failures in periodic mempool flush and cache rebalance paths where the public API result cannot currently express them.
Annotate high-signal validation, block storage, consensus, PoW, and policy helpers whose return values carry success, failure, status, or optional result information. Update existing call sites and tests to explicitly consume those results so future ignored validation outcomes are caught at compile time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Temporarily Annotated
CalculateClaimedHeadersWork, CheckInputScripts, CalculatePrevHeights, CheckInputsFromMempoolAndCache, MemPoolAccept::*, ApplyTxInUndo, CheckBlockHeader, CheckMerkleRoot, CheckWitnessMalleation, ContextualCheckBlockHeader, ContextualCheckBlock,
GetSynchronizationState.
ActivateBestChainStep, ConnectTip, FindMostWorkChain, RollforwardBlock, NotifyHeaderTip, AcceptBlockHeader, MaybeValidateSnapshot, ProcessNewBlock, ProcessNewBlockHeaders, AcceptBlock, LoadBlockIndex, LoadAssumeutxoChainstate,
ValidatedSnapshotCleanup, GetHistoricalBlockRange, ActivateBestChains, BlocksAheadOfTip.
CCoinsViewCache::SpendCoin, CheckTransaction, sequence-lock helpers, PoW helpers, and policy/package/RBF/TRUC/ephemeral standardness helpers.
Diagnostics
Annotations Kept
Kept [[nodiscard]] on the high-signal validation, chainstate, blockstorage I/O, consensus tx, PoW, package/policy/RBF/TRUC, and mempool acceptance return values in validation.h, validation.cpp, node/blockstorage.h, consensus/*, pow.h, and policy/
*.
Annotations Removed
Removed exploratory [[nodiscard]] from CCoinsViewCache::SpendCoin, BlockManager::DeletePruneLock, ChainstateManager::NotifyHeaderTip, ChainstateManager::MaybeValidateSnapshot, and GetSynchronizationState.
Verification
processnewblock_signals_ordering.
rerun as separate tests.
Open Questions