Skip to content

Conversation

jtimon
Copy link
Contributor

@jtimon jtimon commented Oct 3, 2019

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) #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.

@jtimon jtimon changed the title Test: Many regtests with different genesis and default datadir Tests: Many regtests with different genesis and default datadir Oct 3, 2019
@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 3, 2019

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

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.

@jtimon jtimon force-pushed the b20-n-chains branch 2 times, most recently from 848ff18 to 90e3696 Compare October 5, 2019 22:53
@jtimon jtimon changed the title Tests: Many regtests with different genesis and default datadir Testschains: Many regtests with different genesis and default datadir Oct 5, 2019
@jtimon
Copy link
Contributor Author

jtimon commented Oct 30, 2019

Rebased

@JeremyRubin
Copy link
Contributor

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

@jtimon
Copy link
Contributor Author

jtimon commented Dec 18, 2019

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.

@JeremyRubin
Copy link
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?

@jtimon
Copy link
Contributor Author

jtimon commented Dec 20, 2019

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.

@JeremyRubin
Copy link
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).

@jtimon
Copy link
Contributor Author

jtimon commented Dec 21, 2019 via email

@kallewoof
Copy link
Contributor

kallewoof commented Jan 8, 2020

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.

@jtimon
Copy link
Contributor Author

jtimon commented Jan 9, 2020

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)

instagibbs and others added 6 commits February 19, 2020 20:27
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
@jtimon
Copy link
Contributor Author

jtimon commented Feb 19, 2020

Rebased

@DrahtBot
Copy link
Contributor

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

@jtimon
Copy link
Contributor Author

jtimon commented May 6, 2020

Closing due to lack of interest.

@jtimon jtimon closed this May 6, 2020
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants