Testschains: Many regtests with different genesis and default datadir #17037

pull jtimon wants to merge 6 commits into bitcoin:master from jtimon:b20-n-chains changing 14 files +118 −79
  1. jtimon commented at 3:17 AM on October 3, 2019: contributor

    And bip70 name. And on demand (meaning you don't have to mine a genesis block for it to pass minimal pow).

    This allows the daemon to create a new regtest-like chains on demand. The hash of the genesis block is dependent on the "petname" of the chain. Examples: "regtest2, custom, chain_2, aaa, bbbb"

    The hash of the genesis block could depend on more things. For example, for signet chains, it could depend on the signet_blockscript in the case of BIP325 (signet) https://github.com/bitcoin/bitcoin/pull/16411/

    In fact, #16411 could be simplified if this was merged first, for the genesis block wouldn't need to be mined anymore (which requires a special case in grindblock which in turn requires CreateSignetGenesisBlock to be exposed in chainparams). So I guess perhaps signet could be counted as a use case, or perhaps only part of this.

    But why would somebody want more than one regtest?

    I'm personally using it for doing cross-chain payments in lightning, see https://github.com/jtimon/multi-ln-demo/blob/master/conf/bitcoind.conf I would like to work on what I call "cross chain trampoline payments" and I plan to keep using it for that too.

    I imagine other developers could find this useful for other developments involving bitcoin-like chains. For example atomic swaps or submarine swaps.

    Of course, an alternative for these use cases is to use other regtests from other bitcoin-like networks, for example litecoin regtest or liquid regtest.

    Another use case is creating temporal testnets for testing upcoming features. For example, had this been in place before segwit, when "segwitnet" (was that its name) was created, it could have simply been some shared configuration instead of an additional hardoced chainparams. Something like:

    [segwitnet]
    segwitheight=0
    rpcport=18555
    port=18556
    ...
    

    We're not going to use it for a segwitnet now, obviously, but perhaps for a taprootnet or something. Perhaps #17032 would be needed too for this use case in particular to be more useful though, or at least make that for some of the fields that are different between testnet3 and regtest.

  2. jtimon renamed this:
    Test: Many regtests with different genesis and default datadir
    Tests: Many regtests with different genesis and default datadir
    on Oct 3, 2019
  3. DrahtBot added the label GUI on Oct 3, 2019
  4. DrahtBot added the label Tests on Oct 3, 2019
  5. DrahtBot added the label Utils/log/libs on Oct 3, 2019
  6. DrahtBot added the label UTXO Db and Indexes on Oct 3, 2019
  7. DrahtBot added the label Validation on Oct 3, 2019
  8. jtimon cross-referenced this on Oct 3, 2019 from issue Testchains: Introduce custom chain whose constructor... by jtimon
  9. DrahtBot commented at 8:26 PM on October 3, 2019: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #18210 (test: type hints in Python tests by kiminuo)
    • #18189 (Add error handling to all boost filesystem functions by uhliksk)
    • #17601 (Validation: Move CheckBlock() mutation guard to AcceptBlock() by jnewbery)
    • #17556 (test: Change feature_config_args.py not to rely on strange regtest=0 behavior by ryanofsky)
    • #17032 (Tests: Chainparams: Make regtest almost fully customizable by jtimon)
    • #16770 (Chainparams: Rename IsTestChain() to AllowAcceptNonstd() by jtimon)
    • #15283 (log: Fix UB with bench on genesis block by instagibbs)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  10. jtimon force-pushed on Oct 5, 2019
  11. jtimon force-pushed on Oct 5, 2019
  12. jtimon renamed this:
    Tests: Many regtests with different genesis and default datadir
    Testschains: Many regtests with different genesis and default datadir
    on Oct 5, 2019
  13. jtimon cross-referenced this on Oct 8, 2019 from issue Tests: Use self.chain instead of 'regtest' in all current tests by jtimon
  14. jtimon cross-referenced this on Oct 8, 2019 from issue BIP-325: Signet support by kallewoof
  15. jtimon cross-referenced this on Oct 9, 2019 from issue Signet with #17037 on top by jtimon
  16. laanwj added this to the "Chasing Concept ACK" column in a project

  17. jtimon cross-referenced this on Oct 26, 2019 from issue Different error when trying to pay an invoice from another network by jtimon
  18. DrahtBot added the label Needs rebase on Oct 30, 2019
  19. jtimon force-pushed on Oct 30, 2019
  20. jtimon commented at 6:10 PM on October 30, 2019: contributor

    Rebased

  21. jtimon force-pushed on Oct 30, 2019
  22. DrahtBot removed the label Needs rebase on Oct 30, 2019
  23. jtimon cross-referenced this on Dec 12, 2019 from issue chainparams: Hardcode 2 new custom regtests by jtimon
  24. JeremyRubin commented at 10:27 PM on December 18, 2019: contributor

    Can you write a more detailed PR description motivating what use cases require this?

  25. jtimon commented at 11:34 PM on December 18, 2019: contributor

    Sure, done. Thanks for the suggestion, it is true that the motivation wasn't well explained at all. I think it is much better now, but please suggest more changes to the description if you think of anything else to improve.

  26. JeremyRubin commented at 11:49 PM on December 18, 2019: contributor

    Can you explain more why it's worthwile to review this and not just signet?

    I understand it makes it a bit easier to make a genesis block for signet, but how hard is that?

  27. jtimon commented at 6:01 PM on December 20, 2019: contributor

    This would simplify signet. Right now with signet, you need to call grindblock for the genesis block. It also makes the code more complicated. If signet gets merged first, I can rebase this as a simplification of signet. Ideally both would be reviewed. Another option would be to simply modify #16411 , but I don't think @kallewoof will be open to that unless he knows for sure that skipping pow validation in the genesis block is fine with people. Although I guess I should let him speak for himself.

  28. JeremyRubin commented at 6:27 PM on December 20, 2019: contributor

    I'd be interested to hear @kallewoof's thoughts on if this PR is good for signet or not -- it seems like that having the signet stuff merged would make this "nice to have", but not enabling something new (as you can use signets instead of regtests).

  29. jtimon commented at 10:25 PM on December 21, 2019: contributor

    Yeah, only one configurable class is necessary. Even making not signet regtests should be as simple as making is_signet configurable. Whether that class is called CSignetChainparams or CCustomChainparams shouldn't be very important IMO. And if it was the other way around, signet could just be adding those parameters to the existing class. I can produce 2 branches with this and signet. One with this first and the other with signet first. Although if I do both of them the end result will be the same in both. But that may be useful to see what I have in mind. And to discuss things that could be different. If there's interest, I'm happy to do them.

    On Fri, Dec 20, 2019, 19:27 Jeremy Rubin notifications@github.com wrote:

    I'd be interested to hear @kallewoof https://github.com/kallewoof's thoughts on if this PR is good for signet or not -- it seems like that having the signet stuff merged would make this "nice to have", but not enabling something new (as you can use signets instead of regtests).

    — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/pull/17037?email_source=notifications&email_token=AAHWGSVIANX3MEUBC2IWNTTQZUFC3A5CNFSM4I453GF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHNYXCY#issuecomment-568036235, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHWGSSLVDAHLLSJXQLPG4TQZUFC3ANCNFSM4I453GFQ .

  30. DrahtBot added the label Needs rebase on Jan 7, 2020
  31. kallewoof commented at 6:42 AM on January 8, 2020: member

    I don't have strong opinions on this PR in particular, as @JeremyRubin stated, we can use multiple signets to get approximately the same effect as multiple custom-named regtests. I don't think this would be detrimental to signet, though.

    As a sidenote, I would love to remove the grind genesis proof of work part from signet, but unfortunately this was discussed and people didn't like it so it was scratched (hence -signet_genesisnonce. I don't know if people will have a different opinion for this PR, but maybe with more feedback, we get a more complete picture on the topic.

    Anyway, I'm pretty much neutral.

  32. jtimon force-pushed on Jan 9, 2020
  33. jtimon commented at 10:38 PM on January 9, 2020: contributor

    Rebased.

    Regarding -signet_genesisnonce , as far as I understand the hesitation to remove it is having to touch consensus code. But the changes are minimal, it is just the first commit in this PR. As a reminder, the main reason for not merging that commit alone in its own PR, was that it wasn't tested (this PR does test it, as #16411 would if it included that same commit and removed -signet_genesisnonce), see #9102 (comment)

  34. DrahtBot removed the label Needs rebase on Jan 9, 2020
  35. jtimon force-pushed on Jan 15, 2020
  36. MarcoFalke cross-referenced this on Feb 9, 2020 from issue Util: Allow scheduler to be mocked by amitiuttarwar
  37. DrahtBot cross-referenced this on Feb 11, 2020 from issue Fix crashes and infinite loop in ListWalletDir() by uhliksk
  38. DrahtBot cross-referenced this on Feb 11, 2020 from issue Validation: Move CheckBlock() mutation guard to AcceptBlock() by jnewbery
  39. DrahtBot cross-referenced this on Feb 11, 2020 from issue test: Change feature_config_args.py not to rely on strange regtest=0 behavior by ryanofsky
  40. DrahtBot cross-referenced this on Feb 11, 2020 from issue Tests: Chainparams: Make regtest almost fully customizable by jtimon
  41. DrahtBot cross-referenced this on Feb 11, 2020 from issue Chainparams: Rename IsTestChain() to AllowAcceptNonstd() by jtimon
  42. DrahtBot added the label Needs rebase on Feb 18, 2020
  43. 9102: Really don't validate genesis block 2773b97e25
  44. Config: Allow any chain/section name fbb6ce3bc4
  45. Chainparams: Test: Make is_test_chain configurable for regtest 41bf5d5c5f
  46. Test: select chain using -chain=regtest instead of regtest=1 0f4c1a7b8c
  47. Testchains: Qt: Introduce custom chains with different:
    1) genesis block hash
    2) default datadir
    3) chain name (bip70)
    
    all directly or indirectly configured with the -chain option
    
    ...whose constructor reads params from regular arguments (like regtests)...
    
    Qt: Add a default purple and title for unkown chains
    d9181a0371
  48. Test: Custom chain genesis' are deterministic from the name 826ad96cf9
  49. jtimon force-pushed on Feb 19, 2020
  50. jtimon commented at 8:03 PM on February 19, 2020: contributor

    Rebased

  51. DrahtBot removed the label Needs rebase on Feb 19, 2020
  52. DrahtBot cross-referenced this on Feb 20, 2020 from issue log: Fix UB with bench on genesis block by instagibbs
  53. DrahtBot cross-referenced this on Feb 21, 2020 from issue Add error handling to all boost filesystem functions by uhliksk
  54. DrahtBot cross-referenced this on Feb 25, 2020 from issue test: type hints in Python tests by kiminuo
  55. DrahtBot cross-referenced this on Mar 5, 2020 from issue BIP-325: Signet [consensus] by kallewoof
  56. DrahtBot cross-referenced this on Mar 12, 2020 from issue refactor: Add params to node context by MarcoFalke
  57. DrahtBot commented at 8:30 PM on March 17, 2020: contributor

    <!--cf906140f33d8803c4a75a2196329ecb-->

    🐙 This pull request conflicts with the target branch and needs rebase.

  58. DrahtBot added the label Needs rebase on Mar 17, 2020
  59. jtimon commented at 1:33 PM on May 6, 2020: contributor

    Closing due to lack of interest.

  60. jtimon closed this on May 6, 2020

  61. laanwj removed this from the "Chasing Concept ACK" column in a project

  62. bitcoin locked this on Feb 15, 2022

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: 2026-05-20 06:54 UTC