NOMERGE: WIP: Support block signed custom testchains #9177

pull jtimon wants to merge 19 commits into bitcoin:master from jtimon:0.13-blocksign changing 55 files +932 −305
  1. jtimon commented at 7:00 AM on November 17, 2016: contributor

    Maybe helps review: https://github.com/jtimon/bitcoin/compare/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:

    • Use a proper factory for creating chainparams #8855
    • Really don't validate genesis block #9102
    • Testchains: Introduce custom chain whose constructor... #8994

    Open design concerns:

    • Global fSignBlocksGlobal is worrying
    • Global UnionProof is worrying

    You can also see https://github.com/jtimon/bitcoin/compare/0.13-blocksign...0.13-blocksign-longest for other things I'm trying or considering.

  2. jtimon force-pushed on Nov 18, 2016
  3. jtimon force-pushed on Nov 18, 2016
  4. jtimon force-pushed on Nov 22, 2016
  5. jtimon force-pushed on Nov 22, 2016
  6. jtimon force-pushed on Nov 22, 2016
  7. jtimon cross-referenced this on Nov 22, 2016 from issue Testchains: Introduce custom chain whose constructor... by jtimon
  8. jtimon force-pushed on Dec 2, 2016
  9. jtimon force-pushed on Dec 3, 2016
  10. jtimon force-pushed on Dec 20, 2016
  11. jtimon force-pushed on Dec 20, 2016
  12. jtimon force-pushed on Jan 10, 2017
  13. jtimon force-pushed on Jan 10, 2017
  14. jtimon force-pushed on Jan 10, 2017
  15. jtimon force-pushed on Jan 11, 2017
  16. Chainparams: Use a regular factory for creating chainparams ebdd4aa76c
  17. Chainparams: Get rid of CChainParams& Params(std::string) 626210172b
  18. Chainparams: Use the factory for pow tests 75ebe97f07
  19. Really don't validate genesis block c1828c520b
  20. Testchains: Generic selection with -chain=<str> in addition of -testnet and -regtest 23d873dbd2
  21. Testchains: Introduce custom chain whose constructor...
    ...reads params from regular arguments or the general conf file
    c7de527ed2
  22. Testchains: Qt: Simplify network/chain styles and add a default purple
    ...for unkown chains
    3469474405
  23. QA: Adapt BitcoinTestFramework for chains other than "regtest" ccac9f46ee
  24. QA: Use custom chain instead of regtest for rpc tests (except segwit.py) a5a7e700a3
  25. jtimon force-pushed on Jan 24, 2017
  26. jtimon commented at 11:34 PM on January 24, 2017: contributor
  27. fixup! introduce custom chain 875a4e998a
  28. Blocksign: Encapsulate pow.h behind an additional proof layer 0d8f8c18be
  29. Blocksign: Replace nBits and nNonce with UnionProof 5b34336263
  30. Base58: allow CBitcoinSecret to get CChainParams explicitly c023dd49d0
  31. Util: Create ArgsManager class e43c65a392
  32. Util: s/mapMultiArgs.count(/argsGlobal.IsArgSet(/ df0dd1813a
  33. Util: Introduce ArgsManager::ArgsAt() c7c15b4721
  34. Util: Put mapMultiArgs inside ArgsManager f884893822
  35. Testchains: Load custom chainparams config from a different file 08a9b6fec9
  36. Blocksign: WIP: Sign custom chain blocks
    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
    f83e1615d7
  37. jtimon force-pushed on Feb 3, 2017
  38. jtimon cross-referenced this on Apr 6, 2017 from issue Pow: Remove fCheckPOW from CheckBlockHeader by jtimon
  39. jtimon cross-referenced this on May 6, 2017 from issue Optimization: Calculate block hash less times by jtimon
  40. jtimon commented at 6:59 AM on June 19, 2017: contributor

    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

  41. jtimon closed this on Jun 19, 2017

  42. jtimon cross-referenced this on Jun 25, 2017 from issue Pow: Introduce MaybeGenerateProof by jtimon
  43. bitcoin locked this on Sep 8, 2021

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:55 UTC