Skip to content
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

MBV Property Based Testing -- Do Not Merge #3

Closed
wants to merge 44 commits into from

Commits on Jan 12, 2018

  1. Adding rapidcheck dependency, adding CKey properties

    Adding rapidcheck dependency, adding CKey properties
    
    Successfully compiling bitcoin with rapidcheck dependency
    
    Adding new property file for CKey
    
    Serialization symmetry for CKey -> CBitcoinSecret -> CKey
    
    Adding generators for CPrivKey, CPubKey, and uint256
    
    [depends] Rework rapidcheck.mk
    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    7f2ec38 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    24d0ab9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5e43d45 View commit details
    Browse the repository at this point in the history
  4. Adding block header serialization property

    Fixing generator bug where I wasn't setting all fields on a BlockHeader
    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    c176314 View commit details
    Browse the repository at this point in the history
  5. Creating transaction_gen.h, adding generator for COutPoint and serial…

    …ization symmetry property for COutPoint
    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    a95d107 View commit details
    Browse the repository at this point in the history
  6. Adding script generator and script_propertes, first property is CScri…

    …pt serialization symmetry
    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    52bd9ac View commit details
    Browse the repository at this point in the history
  7. Adding CTransaction generator, adding serialization symmetry property…

    … for CTransaction
    
    Removing 'oneOrMoreInputs' and 'oneOrMoreOutputs' generators in favor of using rapidcheck's gen::nonEmpty function
    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    d8ea6c6 View commit details
    Browse the repository at this point in the history
  8. Adding CTransactionRef and CBlock generators, adding property for CBl…

    …ock serialization symmetry
    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    792e150 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    12be36c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    8efafd7 View commit details
    Browse the repository at this point in the history
  11. Adding merkle_block properties

    Committing to try and debug mem leak
    
    Removing comments, rebasing to master
    
    Only adding rapidcheck dependency if tests are enabled
    
    Refactoring inclues in generator files, reordering files in Makefile.test.include
    
    Undoing change in merkleblock.cpp
    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    761218f View commit details
    Browse the repository at this point in the history
  12. Adding bloom_gen.cpp

    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    d7b29cd View commit details
    Browse the repository at this point in the history
  13. Reworking BetweenZeroAndOne to use rc::gen::map instead of rc::gen::s…

    …uchThat, removing some unused imports
    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    535fe44 View commit details
    Browse the repository at this point in the history
  14. Adding signedP2PKTx(), signedP2PKHTx(), signedMultisigTx(), and then …

    …a generator called signedP2SHTx() that creates a p2sh output and spends it
    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    e609407 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    45d6751 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    49858af View commit details
    Browse the repository at this point in the history
  17. fixing nits/ugliness

    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    65ef224 View commit details
    Browse the repository at this point in the history
  18. Adding block_gen.cpp

    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    fca7771 View commit details
    Browse the repository at this point in the history
  19. Modifying code to be closer to the style guide rules, use const/refer…

    …ences, fixing more nits
    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    dd5976b View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    0da8a85 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    82ddc10 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    4ca3aa5 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    be24239 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    7680d0c View commit details
    Browse the repository at this point in the history
  25. Extend validateaddress information for P2SH-embedded witness

    This adds new fields 'pubkeys' and 'embedded' to the RPC's output, and improves the
    documentation for previously added 'witness_version' and 'witness_program' fields.
    sipa authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    afb8c32 View commit details
    Browse the repository at this point in the history
  26. Replaces numbered place marker %2 with %1.

    Replaces numbered place marker %2 with %1, because the QString::arg() member function is called once on the string used to create the QString object.
    l2a5b1 authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    79e1b6f View commit details
    Browse the repository at this point in the history
  27. Fix incorrect Markdown link

    practicalswift authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    57a9ffb View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    3ba5920 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    daaf169 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    ec5c85c View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    4f976ab View commit details
    Browse the repository at this point in the history
  32. Implicitly know about P2WPKH redeemscripts

    Make CKeyStore automatically known about the redeemscripts necessary for P2SH-P2WPKH
    (and due to the extra checks in IsMine, also P2WPKH) spending.
    sipa authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    38c8760 View commit details
    Browse the repository at this point in the history
  33. SegWit wallet support

    This introduces two command line flags (-addresstype and -changetype) which control
    the type of addresses/outputs created by the GUI and RPCs. Certain RPCs allow
    overriding these (`getnewaddress` and `getrawchangeaddress`). Supported types
    are "legacy" (P2PKH and P2SH-multisig), "p2sh-segwit" (P2SH-P2WPKH and P2SH-P2WSH-multisig),
    and "bech32" (P2WPKH and P2WSH-multisig).
    
    A few utility functions are added to the wallet to construct different address type
    and to add the necessary entries to the wallet file to be compatible with earlier
    versions (see `CWallet::LearnRelatedScripts`, `GetDestinationForKey`,
    `GetAllDestinationsForKey`, `CWallet::AddAndGetDestinationForScript`).
    sipa authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    00cd277 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    9c89fea View commit details
    Browse the repository at this point in the history
  35. Add address_types test

    Improvements and cleanups by John Newbery
    sipa authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    4da4727 View commit details
    Browse the repository at this point in the history
  36. [Doc] Fix link for bip 159 pull request

    azuchi authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    2b03294 View commit details
    Browse the repository at this point in the history
  37. Add midstate output to CSHA256. This allows the intermediate state of…

    … a SHA-256 run to be saved for future resumption, or in the case of fast Merkle trees to perform a non-padded hash.
    maaku authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    c3f9b97 View commit details
    Browse the repository at this point in the history
  38. Add custom initialization vector support to CSHA256. Using alternativ…

    …e initialization vectors allows SHA-256 to be reused as a different cryptographic hash function while sharing the same implementation, which is necessary to secure some hash tree protocols.
    maaku authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    841077e View commit details
    Browse the repository at this point in the history
  39. Add fast Merkle branch functions. A fast Merkle branch uses midstate …

    …to perform a single SHA-256 compression with a custom initialization vector per internal node of a binary Merkle tree, and is not vulnerable to CVE-2012-2459. It produces different hash values though, so can only be used for new hash trees going forward.
    maaku authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    7b610c6 View commit details
    Browse the repository at this point in the history
  40. Add MerkleProof and MerkleTree data structures, for efficiently trans…

    …mitting and validating proofs of multiple elements from a fast Merkle tree. The MerkleProof contains the tree structure and skip hashes, while the MerkleTree contains a proof and associated verify hashes.
    maaku authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    a37dbe9 View commit details
    Browse the repository at this point in the history
  41. Replace NOP4 with MERKLEBRANCHVERIFY, presently disabled.

      [... leaf/H(leaf) ...] proof root {count,prehashed} MERKLEBRANCHVERIFY
    
    This opcode takes a Merkle root, any number of leaf hashes of the tree, and a 'proof' object composed of an encoding of the path through the tree from root to leaves and the minimal set of hash values necessary to recompute the the root from the leaf. Script validation fails if the recomputed root does not match the hash provided (which, presumably, would be committed to in the scriptPubKey).
    
    Only the logic and unit tests are implemented; this commit does not have any soft-fork activation logic in it.
    
    See BIP116 for details.
    maaku authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    d7e4181 View commit details
    Browse the repository at this point in the history
  42. Enable MERKLEBRANCHVERIFY as a standard script verification flag. Tra…

    …nsactions that fail MBV verification will be rejected from the mempool, making it easier to test and to later soft-fork activate this feature. Blocks which contain "invalid" MBV-using transactions will still be accepted; this is *not* the soft-fork required to use MBV in production.
    maaku authored and Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    7248500 View commit details
    Browse the repository at this point in the history
  43. Adding merkle_gen.{h,cpp}, merkle_properties.cpp

    Creating merkle branch verify script and transaction generators
    Christewart committed Jan 12, 2018
    Configuration menu
    Copy the full SHA
    4df11ab View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    c1be23d View commit details
    Browse the repository at this point in the history