mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:44:38 +00:00
test: cover cumulative input value range in CheckTxInput tests. #36686
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36686
Loading…
Reference in a new issue
No description provided.
Delete branch "2026-10-checktxinputs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In
Consensus::CheckTxInputs, the inputs are invalid if, for every input coin, eithercoin.out.nValueornValueInis out of range. However, the currentchecktxinputs_invalid_transactions_testonly covers cases with one input, so the sumnValueInis always equal tocoin.out.nValue, leaving the following mutant alive.https://github.com/bitcoin/bitcoin/pull/36686/commits/f8c6cd84e08043f206ca338d0ba7e4dc8bef5214 adds support for multiple inputs in the test helper.
https://github.com/bitcoin/bitcoin/pull/36686/commits/133714d1695bc40277b213afd252c3e320cac73e adds a test case with multiple valid inputs, whose sum exceed
MAX_MONEY, while also havingnValueIn!=coin.out.nValue, killing the mutant.https://github.com/bitcoin/bitcoin/pull/36686/commits/98f9eb6afdfd2bb1cd2872bd7d2eb439ec2043a1 adds a test for uncovered negative input case.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, this pull request conflicts with the following ones:
CAmounta class by hodlinator)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
No verified findings are available from this review.
Review coverage was incomplete.
Reviewed:
98f9eb6afdfd· Full review report · Previous reportspermalink
🚧 At least one of the CI tasks failed.
Task
lint: https://github.com/bitcoin/bitcoin/actions/runs/40738712606/job/122994163824LLM reason (✨ experimental): CI failed the
commit_msglint check because both commits lack a blank line between the subject and body.Hints
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
Optional: use
output_value = 1here so the||->&&mutant passes the fee check and incorrectly returnstrue. The current case already catches the mutant via the reject reason, this would catch erroneous acceptance directly.Or we could keep the zero-output case and add another with
output_value = 1. The existing case also checks that the input value error takes precedence over the fee error.Changed the output value to 1 as suggested in the first comment. I'd prefer to change the existing case rather than add another one. That way we keep new test cases to a minimum while exercising the erroneous acceptance and killing the mutant. Thanks for the suggestions!
ACK
133714d169Verified the mutant is killed. I have left an optional suggestion for the per-coin check, which is still uncovered.
Could add a case for the per-coin check too, removing it currently doesn't break any test.
Thanks for the suggestion! Added.
reACK
98f9eb6afdACK
98f9eb6afdnice!ACK
98f9eb6afd.