Comparison tool successor? #4545

issue sipa openend this issue on July 16, 2014
  1. sipa commented at 5:16 pm on July 16, 2014: member

    The current comparison tool tests network behavior that is too specific - in particular, it seems hard to adapt it to headers-first (which in some cases does not fetch blocks in the same order, e.g. because it already knows that it’s invalid through the header, even though at every point it should have the same best block) - correct me if I’m wrong, @TheBlueMatt.

    One of the reasons is that the current comparison both incorporates the scenario of comparisons to run, and the logic to compare it to (BitcoinJ full node code). This makes it hard to adapt.

    I propose writing a tool that does nothing but implement a testing scenario, and run it against 2 bitcoind’s in parallel: an old trusted version, and the new version to be tested, and compares whether at every point in time (after synchronizing through a ping/ping) they agree on the best chain.

    This could be as simple as a python node with an associated block database and block header tree, that can answer getdata/getheaders/getblocks, and runs through a scripted scenario, but doesn’t do any validation itself.

  2. sipa added the label Brainstorming on Jul 16, 2014
  3. TheBlueMatt commented at 5:23 pm on July 16, 2014: member
    I think you can go much further and closer to the current tester than that. A tester that, instead of sending blocks and then testing the results, implements a node which announces invs, then has code which will correctly respond to messages, then tests chain head after groups of blocks (ie after each discrete test) would work well and potentially be able to test more things, no?
  4. TheBlueMatt commented at 5:23 pm on July 16, 2014: member
    Not to say a mini-network of different-version bitcoinds isnt a good idea, too.
  5. sipa commented at 5:30 pm on July 16, 2014: member

    Maybe I’m not describing things well, or I’m misunderstanding you. But I do mean a node implementation that correctly sends invs, and answers correctly (a subset of) the p2p protocol, given a known header tree and block database.

    Or do you mean not doing the “relative comparison” between two bitcoinds, but just knows statically what the best block should be after every step of the scenario, and compares to that? Both sound feasible, I guess.

  6. sipa commented at 5:33 pm on July 16, 2014: member

    One advantage to the relative approach is that you can vary the layout:

    • A comparison tool that talks to two independent bitcoinds of different version.
    • A comparison tool talking to two bitcoind’s that are also interconnected.
    • A comparison tool talking to one bitcoind, which itself is connected to a second one.

    Then variations with multiple old and multiple new instances, which need to synchronize in between them.

  7. TheBlueMatt commented at 5:36 pm on July 16, 2014: member

    Yes, I think a combination of both would be ideal.

    On 07/16/14 17:33, Pieter Wuille wrote:

    One advantage to the relative approach is that you can vary the layout:

    • A comparison tool that talks to two independent bitcoinds of different version.
    • A comparison tool talking to two bitcoind’s that are also interconnected.
    • A comparison tool talking to one bitcoind, which itself is connected to a second one.

    Then variations with multiple old and multiple new instances, which need to synchronize in between them.

    — Reply to this email directly or view it on GitHub #4545 (comment).

  8. jtimon commented at 5:28 pm on July 17, 2014: contributor
    It would be great to be able to functionally compare two local git branches automatically.
  9. sipa assigned sipa on Oct 2, 2014
  10. reorder referenced this in commit 473e3cbb4f on Dec 28, 2014
  11. laanwj commented at 12:35 pm on December 8, 2015: member
    Motivated by discussion in #7093: Now that #5981 is merged we have our own internal P2P testing framework. How is it along to replacing the blocktester? It is putting up a maintenance bottleneck.
  12. laanwj added the label Tests on Dec 9, 2015
  13. laanwj added this to the milestone 0.13.0 on Dec 9, 2015
  14. droark commented at 0:38 am on April 9, 2016: contributor

    Hello. Just FYI, I ended up poking around the Core code recently and saw the comparison tool. While poking around and trying to troubleshoot some stuff, I discovered that comparison tool support seems to have been dropped from the forthcoming v0.14. For that matter, v0.13.6 doesn’t work without a one-line fix, and even then, I’ve seen an intermittent DB error that I can’t reproduce right now.

    Anyway, I just wanted to add that here in case this is still on anybody’s radar. My Java experience is limited, and it sounds like nobody’s really happy with the tool anyway, so I’m really not the right person to tackle this project. Besides, I don’t think there will be a v0.13.7 release, so as things stand, the tool is completely broken.

    EDIT: There might be a v0.13.7 after all. Not sure if the aforementioned fix would make it in but I’ll ask for it.

  15. laanwj commented at 7:32 am on April 9, 2016: member
    Thanks for the information @droark. IMO, we should just drop it too.
  16. laanwj commented at 1:21 pm on April 14, 2016: member
    Seems I’ll just have to set a deadline: I’m going to remove use of the unmaintained java-based comparison framework after the 0.13 branch-off (projected 2016-07-06, see #7679). I hope the Python framework will be a full replacement by then, but as this is holding up progress in other areas, that will not affect the decision.
  17. MarcoFalke commented at 9:53 am on May 1, 2016: member

    Does anyone know at what point (line in code) travis fetches the bitcoinj.jar? Or is it somewhere cached?

    Edit: Oh it is cached: https://github.com/sipa/bitcoin/blob/bafd075c5e6a1088ef0f1aa0b0b224e026a3d3e0/depends/packages/native_comparisontool.mk

    Also, did anyone check if the test actually test something? I.e. fail on assertion errors, etc.?

    Edit: Yes, Apparently it writes: ERROR: bitcoind and bitcoinj acceptance differs ....

    If they don’t and no one knows how to fix, we can remove them right now. Because the only thing they’d be doing then, is slowing down travis.

  18. sipa commented at 9:56 am on May 1, 2016: member
    I believe the last update to the comparison tool was for headers-first synchronization. We did a simple test back then, opening 4 PRs that intentionally introduced consensus bugs, and the tool indeed found them.
  19. MarcoFalke commented at 10:25 am on May 1, 2016: member
    Ah, found them: #5006 (comment)
  20. MarcoFalke removed this from the milestone 0.13.0 on Jun 15, 2016
  21. MarcoFalke added this to the milestone 0.14 on Jun 15, 2016
  22. MarcoFalke commented at 2:09 pm on June 15, 2016: member
    Changed milestone to 0.14.
  23. MarcoFalke commented at 7:28 pm on September 27, 2016: member
    #8227 should be revived before 0.14.0, other than this, I think the issue can be closed.
  24. MarcoFalke closed this on Sep 27, 2016

  25. DrahtBot 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-07-03 10:13 UTC

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