Add tests for compact blocks #8418

pull sdaftuar wants to merge 5 commits into bitcoin:master from sdaftuar:cb-testing changing 8 files +1026 −76
  1. sdaftuar commented at 6:10 pm on July 28, 2016: member

    This pull adds support to the python testing framework for the new p2p messages introduced in BIP 152, and adds a new test p2p-compactblocks.py.

    In order to test compact blocks effectively, I needed a way to disable regtest’s BIP9 parameters for segwit, as compact block behavior is affected by whether segwit activation is permitted or not. So one of the commits here adds support for a new command line argument to bitcoind, -bip9params, which allows specifying a “deployment:starttime:timeout” that will override the hardcoded values (only allowed in regtest mode).

    In the new p2p-compactblocks.py test, I also included two tests that exercise #8408. However, I’m not sure whether we’ll want to include this PR on the 0.13 branch, so I’ve just cherry-picked the two commits from #8408 over to this PR for now, so that the tests will pass.

    Thanks @sipa for the python siphash implementation used in this pull.

  2. jonasschnelli added the label Tests on Jul 28, 2016
  3. Allow changing BIP9 parameters on regtest 56c87e9211
  4. Implement SipHash in Python 9c8593d2b4
  5. Tests: refactor compact size serialization in mininode a8689fdf8e
  6. Add support for compactblocks to mininode 9a22a6c089
  7. Add p2p test for BIP 152 (compact blocks) 45c7ddd109
  8. sdaftuar force-pushed on Jul 29, 2016
  9. sdaftuar commented at 1:44 pm on July 29, 2016: member
    Rebased now that #8408 is merged.
  10. laanwj commented at 3:37 pm on July 29, 2016: member
    utACK 45c7ddd thanks for adding all these tests
  11. sipa commented at 7:43 pm on July 29, 2016: member
    Awesome, concept ACK.
  12. sipa commented at 1:44 am on July 30, 2016: member

    @sdaftuar When running this on top of #8393 I get:

    0got_data: error('unpack requires a bytes object of length 8',)
    

    I don’t expect the these tests to run, but the above error is unexpected.

  13. sdaftuar commented at 3:30 pm on July 30, 2016: member
    @sipa Looks like the last commit in #8393 has a bug, where the version is being sent as 4 bytes rather than 8.
  14. sipa commented at 3:33 pm on July 30, 2016: member
    @sdaftuar Oh, great catch!
  15. NicolasDorier commented at 2:07 pm on August 1, 2016: contributor
    tACK a8689fdf8e10300b73750161a73a23467ecd1efe
  16. laanwj merged this on Aug 2, 2016
  17. laanwj closed this on Aug 2, 2016

  18. laanwj referenced this in commit 63c03dd41c on Aug 2, 2016
  19. in src/init.cpp: in 45c7ddd109
    975@@ -975,6 +976,41 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
    976         fEnableReplacement = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "fee") != vstrReplacementModes.end());
    977     }
    978 
    979+    if (!mapMultiArgs["-bip9params"].empty()) {
    980+        // Allow overriding bip9 parameters for testing
    981+        if (!Params().MineBlocksOnDemand()) {
    


    jtimon commented at 10:01 pm on August 4, 2016:

    As mentioned in https://github.com/bitcoin/bitcoin/pull/8460/commits/f36be17578d46235a4bd63754dbba6e664d64117#r73609765 this could have anew parameter instead of reusing mineblocksOnDemand.

    What about fAllowOverwriteBIP9Softforks?


    sipa commented at 10:07 pm on August 4, 2016:
    Sounds good to me.
  20. laanwj referenced this in commit 198494ce53 on Sep 26, 2016
  21. laanwj referenced this in commit ff893aa557 on Sep 26, 2016
  22. laanwj referenced this in commit 4295a7aea5 on Sep 26, 2016
  23. laanwj referenced this in commit f6be478b0a on Sep 26, 2016
  24. laanwj referenced this in commit fb8706ebd7 on Sep 26, 2016
  25. gladcow referenced this in commit a1ff2503a4 on Mar 2, 2018
  26. gladcow referenced this in commit 2822bbc90b on Mar 13, 2018
  27. gladcow referenced this in commit 2648fe0c4a on Mar 14, 2018
  28. gladcow referenced this in commit 1468ae2084 on Mar 15, 2018
  29. gladcow referenced this in commit a30c85e0c5 on Mar 15, 2018
  30. gladcow referenced this in commit d325d9b455 on Mar 24, 2018
  31. gladcow referenced this in commit c0c8d8bd83 on Apr 4, 2018
  32. UdjinM6 referenced this in commit bc45a2f87a on Apr 11, 2018
  33. lateminer referenced this in commit fbd2dec95f on Nov 11, 2018
  34. andvgal referenced this in commit fd5c50bc2b on Jan 6, 2019
  35. CryptoCentric referenced this in commit dd3fd51204 on Feb 28, 2019
  36. MarcoFalke locked this on Sep 8, 2021

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-11-17 15:12 UTC

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