Add test for superfluous witness record in deserialization #15893

pull instagibbs wants to merge 2 commits into bitcoin:master from instagibbs:test_super_witness changing 3 files +34 −15
  1. instagibbs commented at 6:22 pm on April 25, 2019: member
    Adds coverage for changed behavior in https://github.com/bitcoin/bitcoin/pull/14039
  2. instagibbs force-pushed on Apr 25, 2019
  3. instagibbs renamed this:
    Add test for superfulous witness record in deserialization
    Add test for superfluous witness record in deserialization
    on Apr 25, 2019
  4. MarcoFalke commented at 7:13 pm on April 25, 2019: member

    Tests are failing with

    0AssertionError: [node 0] Expected message "bad-txns-vin-empty" does not partially match log:
    1 - 2019-04-25T19:05:50.370758Z received: tx (119 bytes) peer=0
    2 - 2019-04-25T19:05:50.370863Z 
    3 - 
    4 - ************************
    5 - EXCEPTION: NSt8ios_base7failureB5cxx11E       
    6 - Superfluous witness record: iostream error       
    7 - bitcoin in ProcessMessages()       
    
  5. DrahtBot added the label Tests on Apr 25, 2019
  6. instagibbs commented at 7:38 pm on April 25, 2019: member
    wait, what? I didn’t touch this test: 64/119 - p2p_invalid_tx.py failed, Duration: 1 s
  7. MarcoFalke commented at 8:54 pm on April 25, 2019: member

    Could you include the following diff:

     0diff --git a/test/functional/data/invalid_txs.py b/test/functional/data/invalid_txs.py
     1index 02deae92f3..80d8d66f24 100644
     2--- a/test/functional/data/invalid_txs.py
     3+++ b/test/functional/data/invalid_txs.py
     4@@ -68,7 +68,7 @@ class OutputMissing(BadTxTemplate):
     5 
     6 
     7 class InputMissing(BadTxTemplate):
     8-    reject_reason = "bad-txns-vin-empty"
     9+    reject_reason = "Superfluous witness record"
    10     expect_disconnect = False
    11 
    12     def get_tx(self):
    
  8. instagibbs force-pushed on Apr 25, 2019
  9. instagibbs commented at 9:03 pm on April 25, 2019: member
    @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.
  10. Fix missing input template by making minimal tx 25b0786581
  11. Add test for superfluous witness record in deserialization cc556e4a30
  12. in test/functional/feature_block.py:154 in 59e81b1422 outdated
    145@@ -146,20 +146,6 @@ def run_test(self):
    146             badtx = template.get_tx()
    147             if TxTemplate != invalid_txs.InputMissing:
    148                 self.sign_tx(badtx, attempt_spend_tx)
    149-            else:
    150-                # Segwit is active in regtest at this point, so to deserialize a
    151-                # transaction without any inputs correctly, we set the outputs
    152-                # to an empty list. This is a hack, as the serialization of an
    153-                # empty list of outputs is deserialized as flags==0 and thus
    154-                # deserialization of the outputs is skipped.
    


    MarcoFalke commented at 9:16 pm on April 25, 2019:
    Please move this comment to data/invalid_txs.py, as it is not clear why the tx there is completely “empty”

    instagibbs commented at 1:04 am on April 26, 2019:
    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 :)
  13. instagibbs force-pushed on Apr 26, 2019
  14. MarcoFalke commented at 11:26 am on April 26, 2019: member
    utACK cc556e4a30b4a32eab6722f590489d89b2875de3
  15. MarcoFalke referenced this in commit 653b2b4426 on Apr 26, 2019
  16. MarcoFalke merged this on Apr 26, 2019
  17. MarcoFalke closed this on Apr 26, 2019

  18. MarcoFalke added the label Needs backport on Apr 26, 2019
  19. MarcoFalke added this to the milestone 0.18.1 on Apr 26, 2019
  20. sidhujag referenced this in commit 4a65581154 on Apr 27, 2019
  21. laanwj referenced this in commit bb291b50f2 on May 20, 2019
  22. MarcoFalke referenced this in commit 5a58ddb6d5 on May 20, 2019
  23. MarcoFalke referenced this in commit 86031083c7 on May 20, 2019
  24. MarcoFalke removed the label Needs backport on May 20, 2019
  25. sidhujag referenced this in commit 9f749c185f on May 20, 2019
  26. HashUnlimited referenced this in commit c48c0e26e6 on Aug 23, 2019
  27. HashUnlimited referenced this in commit 05f4d10f9f on Aug 23, 2019
  28. Bushstar referenced this in commit 73e34d2e08 on Aug 24, 2019
  29. Bushstar referenced this in commit a8369bb16f on Aug 24, 2019
  30. Munkybooty referenced this in commit 4df2763b77 on Oct 17, 2021
  31. Munkybooty referenced this in commit d6cefa9ce1 on Oct 22, 2021
  32. Munkybooty referenced this in commit c6c032be5f on Oct 22, 2021
  33. Munkybooty referenced this in commit ca421845a7 on Oct 23, 2021
  34. Munkybooty referenced this in commit c7e4472b83 on Oct 26, 2021
  35. Munkybooty referenced this in commit f63e287c06 on Oct 28, 2021
  36. Munkybooty referenced this in commit 211cf5bb25 on Oct 28, 2021
  37. Munkybooty referenced this in commit 740f21e8a1 on Nov 12, 2021
  38. Munkybooty referenced this in commit 466d006e5d on Nov 13, 2021
  39. Munkybooty referenced this in commit 6a652a4a27 on Nov 13, 2021
  40. Munkybooty referenced this in commit 1ab9ba86ef on Nov 14, 2021
  41. Munkybooty referenced this in commit 2749dbc651 on Nov 16, 2021
  42. Munkybooty referenced this in commit d21e550b0e on Nov 18, 2021
  43. MarcoFalke locked this on Dec 16, 2021


instagibbs MarcoFalke

Labels
Tests

Milestone
0.18.1


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-05 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me