-
Notifications
You must be signed in to change notification settings - Fork 37.7k
NOMERGE: WIP: Support block signed custom testchains #9177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d260a77
to
7927528
Compare
12 tasks
f0f02b6
to
0330c65
Compare
0e9ae5d
to
b5e4183
Compare
7386eca
to
9d5cc44
Compare
...reads params from regular arguments or the general conf file
...for unkown chains
9d5cc44
to
3f88a9c
Compare
|
Introduce -con_fsignblockchain and -con_signblockscript new options to configure the custom chain Set fSignBlocksGlobal on CCustomParams::UpdateFromArgs() Adds an Additional CreateChainParams() that takes args
3f88a9c
to
f83e161
Compare
This has been needing rebase for a while. I've been working on a simpler approach (still incomplete) in https://github.com/jtimon/bitcoin/commits/b15-blocksign . Closing |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Maybe helps review: jtimon/bitcoin@0.13-new-testchain...jtimon:0.13-blocksign from #8994.
Once we allow users to create their own chains with #8994 and customize chain params viacommand line and/or a separate file (discuss there), this PR adds additional options and chainparams -con_fsignblockchain and -con_signblockscript to optionally replace pow with bitcoin scripts if -con_fsignblockchain=1; -con_signblockscript being the scriptPubKey the block producers need to provide a scriptSig for with each block (instead of prociding a nonce that passes the pow in the block hash like regular miners).
This will help spring testchains that are more reliable and controllable by developers testing new features. Among other people, folks from the lightning community have communicated that testnet3 is not ideal for some testing scenarios.
Note that also travis tests pass, the new functionality is only tested in test/signedblocks_tests.cpp
Apart from that, BasicSignBlock is dependent on some other tests because the following doesn't pass:
It is good that it fails because testing manually with
importprivkey cTVbLcfg8ftQ25j1YSysmTVugBVEuZymbKUqjHaiCmg2ZSWNmccU
and -con_signblockscript != 21026f9ee99573cf566726ab891ad7dd7ffd36cae816efe71a93bd81f71c3abd04d6ac[CScript() << ParseHex("cTVbLcfg8ftQ25j1YSysmTVugBVEuZymbKUqjHaiCmg2ZSWNmccU") << OP_CHECKSIG] doesn't work either. I hope I will eventually figure it out with
gdb --args ./src/test/test_bitcoin --run_test=BasicSignBlock``` but if someone else is faster than me, thanks in advance.Ideally, we would also reuse all the rpc tests for testing this mode with an additional option similar to -extended.
First we need #8994 to reuse (or replace, please discuss there) all the rpc test for regtest with the new custom chain which by default is identical to regtest, only with a different genesis block and .bitcoin directory. Currently all of them are converted from regtest to custom except :
(help here welcomed too)
Reusing all tests is not strictly necessary but would be nice.
Dependencies:
Open design concerns:
You can also see jtimon/bitcoin@0.13-blocksign...0.13-blocksign-longest for other things I'm trying or considering.