Skip to content

Conversation

jtimon
Copy link
Contributor

@jtimon jtimon commented Nov 17, 2016

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:

./src/test/test_bitcoin --run_test=BasicSignBlock

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 withgdb --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 :

  • p2p-comapctblocks.py
  • segwit.py
  • mempool_packages.py (extended)
  • pruning.py (extended)

(help here welcomed too)
Reusing all tests is not strictly necessary but would be nice.

Dependencies:

Open design concerns:

  • Global fSignBlocksGlobal is worrying
  • Global UnionProof is worrying

You can also see jtimon/bitcoin@0.13-blocksign...0.13-blocksign-longest for other things I'm trying or considering.

@jtimon jtimon force-pushed the 0.13-blocksign branch 5 times, most recently from d260a77 to 7927528 Compare November 22, 2016 20:27
@jtimon jtimon force-pushed the 0.13-blocksign branch 2 times, most recently from f0f02b6 to 0330c65 Compare December 3, 2016 13:46
@jtimon jtimon force-pushed the 0.13-blocksign branch 2 times, most recently from 0e9ae5d to b5e4183 Compare December 20, 2016 08:46
@jtimon jtimon force-pushed the 0.13-blocksign branch 4 times, most recently from 7386eca to 9d5cc44 Compare January 11, 2017 16:54
@jtimon
Copy link
Contributor Author

jtimon commented Jan 24, 2017

TODO: rebase jtimon/bitcoin@0.13-blocksign...0.13-blocksign-longest too.
Rebased

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
@jtimon
Copy link
Contributor Author

jtimon commented Jun 19, 2017

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

@jtimon jtimon closed this Jun 19, 2017
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants