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:

    0[segwitnet]
    1segwitheight=0
    2rpcport=18555
    3port=18556
    4...
    

    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. DrahtBot commented at 8:26 pm on October 3, 2019: member

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

    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.

  9. jtimon force-pushed on Oct 5, 2019
  10. jtimon force-pushed on Oct 5, 2019
  11. 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
  12. laanwj added this to the "Chasing Concept ACK" column in a project

  13. DrahtBot added the label Needs rebase on Oct 30, 2019
  14. jtimon force-pushed on Oct 30, 2019
  15. jtimon commented at 6:10 pm on October 30, 2019: contributor
    Rebased
  16. jtimon force-pushed on Oct 30, 2019
  17. DrahtBot removed the label Needs rebase on Oct 30, 2019
  18. 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?
  19. 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.
  20. 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?

  21. 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.
  22. 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).
  23. 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 .

  24. DrahtBot added the label Needs rebase on Jan 7, 2020
  25. 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.

  26. jtimon force-pushed on Jan 9, 2020
  27. 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)

  28. DrahtBot removed the label Needs rebase on Jan 9, 2020
  29. jtimon force-pushed on Jan 15, 2020
  30. DrahtBot added the label Needs rebase on Feb 18, 2020
  31. 9102: Really don't validate genesis block 2773b97e25
  32. Config: Allow any chain/section name fbb6ce3bc4
  33. Chainparams: Test: Make is_test_chain configurable for regtest 41bf5d5c5f
  34. Test: select chain using -chain=regtest instead of regtest=1 0f4c1a7b8c
  35. 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
  36. Test: Custom chain genesis' are deterministic from the name 826ad96cf9
  37. jtimon force-pushed on Feb 19, 2020
  38. jtimon commented at 8:03 pm on February 19, 2020: contributor
    Rebased
  39. DrahtBot removed the label Needs rebase on Feb 19, 2020
  40. DrahtBot commented at 8:30 pm on March 17, 2020: member

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

  41. DrahtBot added the label Needs rebase on Mar 17, 2020
  42. jtimon commented at 1:33 pm on May 6, 2020: contributor
    Closing due to lack of interest.
  43. jtimon closed this on May 6, 2020

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

  45. DrahtBot 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: 2024-11-17 15:12 UTC

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