Commit Graph

5891 Commits

Author SHA1 Message Date
zkbot
f2e157ab25 Auto merge of #846 - DoNotUseThisCodeJUSTFORKS:automated-performance-measurement-zcash-cli-method, r=ebfull
Automated performance measurement

Supersedes #843 because that one would have merged into the wrong branch. (Oh yeah and I rebased).

**REBASED AND FORCE PUSHED**
2016-04-11 21:56:12 +00:00
Sean Bowe
62fdd8d094 Change pchMessageStart for new testnet. 2016-04-11 12:46:46 -06:00
Taylor Hornby
722b0117d0 Benchmark a random equihash input. 2016-04-11 11:51:12 -06:00
Taylor Hornby
a1cd1a27ac Add verify equihash benchmark 2016-04-11 10:03:31 -06:00
Taylor Hornby
d44feea44c Add JoinSplit verification benchmarks 2016-04-11 10:03:17 -06:00
Taylor Hornby
bf8def9749 Add equihash solving benchmarks 2016-04-11 10:02:59 -06:00
Taylor Hornby
6962bb3df0 Add automated performance measurement system. 2016-04-11 08:15:25 -06:00
Sean Bowe
f3ffa3d27f Implementation of Founders' Reward.
All blocks before the first subsidy halving block, with the exception of
the genesis block, must contain an output which sends 20% of the block
subsidy value to a scriptPubKey `FOUNDERS_REWARD_SCRIPT`.
2016-04-08 14:40:28 -06:00
Jack Grigg
aa86873afd Fix pow_tests to work with Equihash
Changing the order of difficulty calculation operations to divide first doesn't
affect the result significantly, but ensures we never overflow the arith_uint256
during multiplication and get an artificial jump in difficulty.
2016-04-08 23:19:03 +12:00
Sean Bowe
e22df48519 Fix miner_tests to work with equihash 2016-04-08 22:16:29 +12:00
Jack Grigg
cf00c47d5b Fix tests that depend on old block header format
Changes to bloom tests were done by running the following commands:

sed -i 's/\(CDataStream stream(ParseHex(".\{152\}\)\(.\{8\}\)/\100000000000000000000000000000000000000000000000000000000\200/' src/test/bloom_tests.cpp
sed -i 's/\(vector<unsigned char> vch = ParseHex(".\{152\}\)\(.\{8\}\)/\100000000000000000000000000000000000000000000000000000000\200/' src/test/bloom_tests.cpp

and then reverting the single change to the transaction line.
2016-04-08 14:50:56 +12:00
Jack Grigg
b82dccaa0d Adjust genesis blocks to have valid solutions and hashes
The mainnet genesis block is artifically easy; we will revert this when we
actually start using mainnet.
2016-04-08 13:56:00 +12:00
Jack Grigg
fdda3c5085 Use Equihash for Proof-of-Work
The main and test networks are configured to use parameters that are currently
low-memory but usable with the basic solver; they will be increased once the
solver is optimised. The regtest network is configured to have extremely low
memory usage for speed.

Note that Bitcoin's double-hasher is used for the difficulty check. This does
not match the paper, but is simpler than changing the block header
serialization. Single hashing is kept for the EquiHash solver because there is
no requirement on execution time there, only on memory usage.
2016-04-08 13:56:00 +12:00
Jack Grigg
020bed6021 Add test vectors for Equihash 2016-04-08 13:56:00 +12:00
Jack Grigg
6d25662f25 Implement validator and basic solver for Equihash 2016-04-08 13:56:00 +12:00
Sean Bowe
fd5007c126 Create new hasher for sha256() utility. 2016-03-31 16:19:29 -06:00
Sean Bowe
27a109af01 Improve testing and API of CSHA256 compression. 2016-03-31 16:15:07 -06:00
Sean Bowe
d3612b1c94 Remove zerocash's SHA256 implementation 2016-03-31 15:59:06 -06:00
Sean Bowe
8466467a35 Added SHA256Compress to Bitcoin's SHA256 implementation. 2016-03-31 14:23:56 -06:00
Taylor Hornby
9bab3e89a2 Initialize libsodium first. 2016-03-24 13:13:14 -06:00
Sean Bowe
6806256b80 Initialize libsodium and remove openssl headers from util.cpp 2016-03-23 16:26:57 -06:00
Taylor Hornby
41d4eb705b Link with libsodium and replace a CSPRNG. 2016-03-17 16:38:27 -06:00
Sean Bowe
a633044b25 Reorder proving key and verifying key arguments. 2016-03-15 15:59:52 -06:00
Sean Bowe
8f8c4c6c0c Lazily load the proving key at time of first pour. 2016-03-15 14:16:05 -06:00
Sean Bowe
57220d0320 Fix test_pour return type. 2016-02-18 00:04:55 -07:00
Sean Bowe
6e96cf089b Add zerocash tests and utilities. 2016-02-15 22:57:55 -07:00
Sean Bowe
cf5f4f679d Remove unnecessary comments. 2016-02-15 19:10:15 -07:00
Sean Bowe
e463edc122 Build and link libzerocash. 2016-02-15 15:28:20 -07:00
Sean Bowe
a897db652f Reorganizing the zerocash tree. 2016-02-15 15:28:20 -07:00
Sean Bowe
523bc77f64 Move libzerocash (dd5db5815be70f0e4895784cc905df6f1c73cb17) into the src tree. 2016-02-11 13:44:25 -07:00
Sean Bowe
63ea9b75bb Add decoding support for vpour in the decoderawtransaction RPC. 2016-01-23 18:07:18 -07:00
Sean Bowe
9ce86bec59 Remove type check on zcrawpour which is not necessary and causes errors with the RPC. 2016-01-20 14:53:27 -07:00
Sean Bowe
d488e75ea8 Fix comment. 2016-01-19 16:29:44 -07:00
Nathan Wilcox
8cb250885c Replace magic 2s in rpcwallet and change > to != for arity checks. Replace magic 2's with named constants in test cases. 2016-01-19 14:36:18 -07:00
Nathan Wilcox
f15b9549dc Implement online help for zcraw* commands. 2016-01-19 14:36:18 -07:00
Sean Bowe
cf47198370 Fixed a couple incremental merkle tree bugs breaking consistency checks. 2016-01-19 14:36:10 -07:00
Sean Bowe
8505fd548a Prevent testnet from connecting to Bitcoin and getting people marked as DoS. 2016-01-19 14:36:10 -07:00
Sean Bowe
9144ea8c2b Testnet modifications -- just take the parameters from regtest. Also, move loading ZC params to _before_ verification. 2016-01-19 14:36:10 -07:00
Sean Bowe
d66877afb3 Added mapSerials consensus rules to prohibit double-spending. 2016-01-19 14:36:09 -07:00
Sean Bowe
03bff15fe2 Enforce zk-SNARK validity during consensus. 2016-01-19 14:36:09 -07:00
Sean Bowe
a8ac403db0 Added mapAnchors consensus rules, finished zcrawpour/zcrawreceive.
Some specifics on consensus changes:
* Transactions must be anchored to a real anchor in the chain.
* Anchors are pushed and popped during ConnectBlock/DisconnectBlock as appropriate.
* DisconnectTip triggers evictions, under some circumstances, of transactions in the
  mempool which are anchored to roots that are no longer valid.
* Commitments append to the tree at the current best root during ConnectBlock.
2016-01-19 14:36:04 -07:00
Sean Bowe
730790f7a4 Added primitive zcrawkeygen/zcrawpour implementations 2016-01-19 14:36:04 -07:00
Sean Bowe
4f1c37980e Load proving/verifying keys at startup from the public alpha parameters file. 2016-01-19 14:36:04 -07:00
Sean Bowe
f512cf7c7b Added value balance consensus enforcement for pours. 2016-01-19 14:36:04 -07:00
Sean Bowe
45d6bee945 Add mapSerials infrastructure to CCoinsView.
This adds the TXDB/CCoinsViewCache primitives necessary for
writing consensus rules for mapSerials later.
2016-01-19 14:36:04 -07:00
Sean Bowe
9f25631d50 Add mapAnchors infrastructure to CCoinsView.
This adds the TXDB/CCoinsViewCache primitives necessary for
writing consensus rules for mapAnchors later.
2016-01-19 14:36:04 -07:00
Sean Bowe
96c31d163f Added CPourTx verification and construction routines. 2016-01-19 14:36:04 -07:00
Sean Bowe
69761d8269 Primitive, context-free consensus changes for CPourTx
* PourTxs cannot appear in coinbase transactions.
* Transactions can only contain empty vin/vouts if they contain a PourTx.
* PourTx public values must be well-formed (not negative or too large).
* Transactions cannot have the same serial twice throughout all PourTxs.
2016-01-19 14:36:04 -07:00
Sean Bowe
5884044ba9 Introduce vpour to CTransaction.
Transactions of version 2 and above contain a `vpour` field which is a vector of `CPourTx`
objects that embody our protocol. We introduce serialization primitives for boost::array
(we intend for changing the amount of inputs and outputs in the circuit to be simple).

SIGHASH_* operations hash this field like any other for now.
2016-01-19 14:35:59 -07:00
Nathan Wilcox
108650a55a Include a dubious "bug-fix" which allows exceptions to be thrown in reverselock destructor, which is required in reverselock_tests. ref #480 2015-12-22 09:20:42 -08:00