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:

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

  39. DrahtBot locked this on Sep 8, 2021


jtimon


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-07-03 10:13 UTC

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