mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
Test: Add legacy script edge case spender test #36455
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!36455
Loading…
Reference in a new issue
No description provided.
Delete branch "taproot-legacy-edge-spenders"
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?
Move the spender framework from feature_taproot.py to test_framework/spenders.py, and use it in a new feature_legacy_script.py test for script edge cases that other implementations have gotten wrong: CSV with -2, a 5-byte operand whose value fits in 1 byte, IFDUP on negative or non-minimal zero, ROLL with duplicate values, OP_16 in a P2SH scriptSig, and a P2SH scriptSig that leaves 1,000 items for the scriptPubKey to run on.
The first commit is move-only. The new test supports --dumptests like feature_taproot.py, which is how the cases get into the script assets.
These were discovered by finding gaps in alternate implementations (bitcoin-s and rbitcoin)
Script assets: bitcoin-core/qa-assets#297
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:
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:
d7e3279392f4· Full review report · Previous reportspermalink
cc @instagibbs
cc @marcofleon can you look at https://github.com/bitcoin-core/qa-assets/pull/297.
ACK
fcfd8aa09bThough IIUC these will still be dropped on regeneration?
Should these even go into the functional tests then?
I tested this and they don't.
Since they survive regeneration and add coverage, I don't see why not. The dumps are how they get into the script assets.
I also moved the P2SH stack-size spender here from #36465, as you suggested there. I'll update qa-assets#297 as well
reACK
660c159220dont think we need this comment
Test coverage for surprising consensus-critical logic should take precedence, so not a blocker, but i dislike that this adds legacy-only cases to a test supposed to test Taproot logic. If we find the framework of this test is useful, which clearly is the case, then i think it should be exported to other non-Taproot specific tests. But also non-Taproot script test cases need less structure, so if you can just add those to script_tests.json & co as part of #36458 that's also a refactor we can punt down to another time.
@benthecarman how do you want to proceed here?
Moved the test infra out of the taproot specific stuff so we do this in a more clean way