mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
Test: Add script vectors for interpreter edges #36458
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!36458
Loading…
Reference in a new issue
No description provided.
Delete branch "script-vectors-interpreter-edges"
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?
Add script_tests.json and tx_invalid.json vectors for edge cases that
other implementations have gotten wrong, including CSV with -2, IFDUP
on negative zero, ROLL with duplicate values, a taproot output key
that is not a valid x coordinate, and single-flag STRICTENC, LOW_S and
NULLFAIL cases.
Some policy cases were only caught by the tx_valid harness adding
flags back, which implementations copying the JSON don't replicate.
Related: #36455
These were discovered by finding gaps in an alternate implementation (bitcoin-s)
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.Base:
152a55397e451fed9c10041bddf01aa6839847d5Head:
5d2fb8d3098703bc4d23d582eb4987cb2dbeda7aFindings
Suggestions
Correct the minimal-encoding size in the comment (src/test/data/script_tests.json:1041, head)
0xff00000000is a five-byte little-endian ScriptNum encoding of +255, whose minimal signed encodingff00is two bytes, not one. The vector still tests1ADDrejecting a five-byte operand, but the explanation misstates the sign-bit boundary. Change “1 byte” to “2 bytes,” or use a five-byte encoding of a value such as +127 if a one-byte minimal encoding is intended.Review coverage was incomplete.
Review limitations
Full review report
I ran the new vectors at
5d2fb8dthrough btclib, a Python implementation I maintain. Every new script_tests.json row gives the expected result and error code. Each of the 4 new tx_invalid.json rows fails under its listed flag with the error its comment describes, and is valid with no flags.cc @instagibbs
Concept ACK. It's useful to know what re-implementations got wrong, as it's often non-obvious stuff we can better cover in our automated testing.
ACK
5d2fb8d309Nice.
Heh, nice. (Though the -1 vector would also catch this, but good to have it spelled out.)
Isn't this one redundant with the script_tests.json one you added above?
yeah i guess, being redundant doesn't really hurt here though
LGTM ACK
5d2fb8d309, but waiting on resolution here: https://github.com/bitcoin/bitcoin/pull/36455#pullrequestreview-5616742117Merging this. If there is more, it can just go into another pull request.