-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Add test for superfluous witness record in deserialization #15893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
91dcbe1 to
a49893c
Compare
|
Tests are failing with |
|
wait, what? I didn't touch this test: |
|
Could you include the following diff: diff --git a/test/functional/data/invalid_txs.py b/test/functional/data/invalid_txs.py
index 02deae92f3..80d8d66f24 100644
--- a/test/functional/data/invalid_txs.py
+++ b/test/functional/data/invalid_txs.py
@@ -68,7 +68,7 @@ class OutputMissing(BadTxTemplate):
class InputMissing(BadTxTemplate):
- reject_reason = "bad-txns-vin-empty"
+ reject_reason = "Superfluous witness record"
expect_disconnect = False
def get_tx(self): |
a49893c to
59e81b1
Compare
|
@MarcoFalke I tried a slightly different track by using the fact that 0-vin, 0-vout have input sizes checked first, and kept that test case, then also kept my new test for the actual test we're checking for. It seemed weird to me to simply hope that that type of transaction would trigger this case. |
test/functional/feature_block.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this comment to data/invalid_txs.py, as it is not clear why the tx there is completely "empty"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote something else in its place. I found the previous text a little baffling to be honest. Willing to take heavy edits on it :)
59e81b1 to
cc556e4
Compare
|
utACK cc556e4 |
…ialization cc556e4 Add test for superfluous witness record in deserialization (Gregory Sanders) 25b0786 Fix missing input template by making minimal tx (Gregory Sanders) Pull request description: Adds coverage for changed behavior in bitcoin#14039 ACKs for commit cc556e: MarcoFalke: utACK cc556e4 Tree-SHA512: 3404c8f75e87503983fac5ae27d877309eb3b902f2ec993762911c71610ca449bef0ed98bd17e029414828025b2713e1bd012e63b2a06497e34f1056acaa6321
…ialization cc556e4 Add test for superfluous witness record in deserialization (Gregory Sanders) 25b0786 Fix missing input template by making minimal tx (Gregory Sanders) Pull request description: Adds coverage for changed behavior in bitcoin#14039 ACKs for commit cc556e: MarcoFalke: utACK cc556e4 Tree-SHA512: 3404c8f75e87503983fac5ae27d877309eb3b902f2ec993762911c71610ca449bef0ed98bd17e029414828025b2713e1bd012e63b2a06497e34f1056acaa6321
fa2b52a Disallow extended encoding for non-witness transactions (take 3) (MarcoFalke) Pull request description: (previous title "p2p: Disallow extended encoding for non-witness transactions (take 3)") Remote peers can send us illegally encoded txs and thus have us write to stderr. Fix that by not writing to stderr. This is a follow up to the previous (incomplete) attempts at this: * Disallow extended encoding for non-witness transactions #14039 * Add test for superfluous witness record in deserialization #15893 ACKs for commit fa2b52: laanwj: utACK fa2b52a ryanofsky: utACK fa2b52a. Would change title to something like "Avoid logging transaction decode errors to stderr" instead of "Disallow extended encoding for non-witness transactions." The current title is confusing because this PR isn't really allowing or disallowing anything, just logging the condition differently. "Disallow" also seems to contradict the "Allow exceptions from..." comments in the actual code. Tree-SHA512: c66990e69b432d00dc1c5510bf976a1188664d0890a32d1e5c6459094e7e27da82a5d227627afcbc203676f5540eec74b7d9b1d71d2c62d3b2069e1781824b4d
Github-Pull: bitcoin#15893 Rebased-From: 25b0786
Github-Pull: bitcoin#15893 Rebased-From: cc556e4
…stderr fa2b52a Disallow extended encoding for non-witness transactions (take 3) (MarcoFalke) Pull request description: (previous title "p2p: Disallow extended encoding for non-witness transactions (take 3)") Remote peers can send us illegally encoded txs and thus have us write to stderr. Fix that by not writing to stderr. This is a follow up to the previous (incomplete) attempts at this: * Disallow extended encoding for non-witness transactions bitcoin#14039 * Add test for superfluous witness record in deserialization bitcoin#15893 ACKs for commit fa2b52: laanwj: utACK fa2b52a ryanofsky: utACK fa2b52a. Would change title to something like "Avoid logging transaction decode errors to stderr" instead of "Disallow extended encoding for non-witness transactions." The current title is confusing because this PR isn't really allowing or disallowing anything, just logging the condition differently. "Disallow" also seems to contradict the "Allow exceptions from..." comments in the actual code. Tree-SHA512: c66990e69b432d00dc1c5510bf976a1188664d0890a32d1e5c6459094e7e27da82a5d227627afcbc203676f5540eec74b7d9b1d71d2c62d3b2069e1781824b4d
Github-Pull: bitcoin#15893 Rebased-From: 25b0786
Github-Pull: bitcoin#15893 Rebased-From: cc556e4
Github-Pull: bitcoin#15893 Rebased-From: 25b0786
Github-Pull: bitcoin#15893 Rebased-From: cc556e4
…stderr fa2b52a Disallow extended encoding for non-witness transactions (take 3) (MarcoFalke) Pull request description: (previous title "p2p: Disallow extended encoding for non-witness transactions (take 3)") Remote peers can send us illegally encoded txs and thus have us write to stderr. Fix that by not writing to stderr. This is a follow up to the previous (incomplete) attempts at this: * Disallow extended encoding for non-witness transactions bitcoin#14039 * Add test for superfluous witness record in deserialization bitcoin#15893 ACKs for commit fa2b52: laanwj: utACK fa2b52a ryanofsky: utACK fa2b52a. Would change title to something like "Avoid logging transaction decode errors to stderr" instead of "Disallow extended encoding for non-witness transactions." The current title is confusing because this PR isn't really allowing or disallowing anything, just logging the condition differently. "Disallow" also seems to contradict the "Allow exceptions from..." comments in the actual code. Tree-SHA512: c66990e69b432d00dc1c5510bf976a1188664d0890a32d1e5c6459094e7e27da82a5d227627afcbc203676f5540eec74b7d9b1d71d2c62d3b2069e1781824b4d
Adds coverage for changed behavior in #14039