Commit Graph

9242 Commits

Author SHA1 Message Date
Simon 90a9019387 Fix issue where a coinbase tx should have it's sigscript hashed
to avoid duplicate txids, as discussed in BIP34 and BIP30.
2016-07-27 00:52:27 -07:00
Simon 2481bab2b8 Revert "Set nLockTime in CreateNewBlock() so coinbase txs do not have the same txid."
This reverts commit 29306269f4.
2016-07-27 00:41:26 -07:00
Jack Grigg 51eb5273f5 Equihash: Pass each obtained solution to a callback for immediate checking
Closes #1143
2016-07-27 19:15:49 +12:00
Simon 07e6d5b025 Refactor GetTxid() into UpdateTxid() to match coding style of hash member variable.
UpdateTxid() is called alongside UpdateHash() when a CTransaction is
deserialized or constructed.  GetTxid() now returns a const reference.
2016-07-26 17:13:03 -07:00
Simon 29306269f4 Set nLockTime in CreateNewBlock() so coinbase txs do not have the same txid.
Update test data in miner_tests.
2016-07-26 17:13:03 -07:00
Simon 10d2c57c0d Replace calls to GetHash() with GetTxid() for transaction objects.
Where the caller intends to receive a transaction id and not a double
SHA256 hash.
2016-07-26 17:13:03 -07:00
Simon 1e84d84d3a Rename GetHash() method to GetSerializeHash().
When pulling from upstream we are now forced to examine GetHash() usage
and replace with GetSerializeHash() if the caller wants a double SHA256
hash, or with GetTxid() if the caller wants a transaction id.
2016-07-26 17:09:27 -07:00
Simon 3574c9251f Updated test data for script_tests by uncommenting UPDATE_JSON_TESTS flag. 2016-07-26 17:09:27 -07:00
Simon b742003ee9 Update block and tx data used in bloom filter tests. 2016-07-26 17:09:27 -07:00
Simon 2b9130cd1f Update precomputed equihash solutions used in test. 2016-07-26 17:09:27 -07:00
Simon a2cf219581 Update genesis blocks. 2016-07-26 17:09:27 -07:00
Simon 49689a574c Add GetTxid() which returns a non-malleable txid. 2016-07-26 17:09:27 -07:00
zkbot 6dfc9e7a7c Auto merge of #1120 - str4d:1055-asynchronous-miner-interrupts, r=str4d
Make Equihash solvers cancellable

The miner only cancels the solver when chainActive.Tip() changes.

Closes #1055
2016-07-25 23:51:23 +00:00
Simon a24a2e1144 Inform user that zcraw... rpc calls are being deprecated. 2016-07-24 10:05:20 -07:00
Sean Bowe 167aece517 z7 Release 2016-07-22 15:50:04 -06:00
zkbot eef6f737dc Auto merge of #1126 - ebfull:more-libsnark-changes, r=ebfull
Remove more from libsnark, and fix potential remote-DoS.

See https://github.com/zcash/libsnark/pull/1 as well.

[`59adbef`](59adbefcc8) removes a remote-DoS that can occur if proofs are not well-formed.

[`e3779f9`](e3779f9049) removes more files that we do not need from libsnark.

[`11242d8`](11242d8afe) replaces assertions that could be triggered by our verifier with exceptions.

Here in Zcash, we catch all exceptions from the verifier and return false.

Closes #459, Closes #69
2016-07-22 20:16:27 +00:00
zkbot f0f8622f2a Auto merge of #1127 - ebfull:test-merkle-tree-gadget, r=ebfull
Add test for non-intuitive merkle tree gadget witnessing behavior.

Closes #920
2016-07-22 19:37:13 +00:00
Jack Grigg 215b9e139d Use std::shared_ptr to deallocate partialSolns automatically 2016-07-23 00:31:47 +12:00
Jack Grigg 1655db285d Move initialisations to simplify cancelled checks 2016-07-22 23:54:14 +12:00
Taylor Hornby 73537ebe97 Put hardened stuff in libzcash CPPFLAGS. 2016-07-21 20:45:11 -06:00
Taylor Hornby b00b98ae2c Make security options in configure.ac fail if unavailable. 2016-07-21 20:45:11 -06:00
Taylor Hornby 56734f4b27 Pull in upstream's make check-security, based on upstream PR #6854 and #7424. 2016-07-21 20:45:10 -06:00
Taylor Hornby 1327d1915a Add tests for security hardening features 2016-07-21 20:45:07 -06:00
Taylor Hornby effd7ca1d8 Add checksec.sh from http://www.trapkit.de/tools/checksec.html 2016-07-21 20:45:07 -06:00
Taylor Hornby 4e0b4af40f Enable -O1 for better FORTIFY_SOURCE protections. 2016-07-21 20:45:02 -06:00
Jack Grigg 9e6adb124f Hardfork to the previous testnet difficulty adjustment behaviour at block 43400
This hardfork will be removed the next time the testnet blockchain is reset.
2016-07-22 14:17:46 +12:00
Taylor Hornby ae79cec542 Make the --enable-hardening flag explicit. 2016-07-21 19:53:45 -06:00
Sean Bowe 4d66f8f68a Add test for non-intuitive merkle tree gadget witnessing behavior. 2016-07-21 19:28:58 -06:00
Sean Bowe 25d2197043 Remove more from libsnark, and fix potential remote-DoS. 2016-07-21 18:34:59 -06:00
Jack Grigg e99731b4a4 Reinstate previous testnet adjustment behaviour
When the difficulty adjustment algorithm was altered, the special testnet
min-difficulty case was maintained, but the difficulty adjustment for the
following block then adjusted from min-difficulty instead of from the last
non-min-difficulty block. This caused the difficulty on the testnet to sawtooth
instead of stabilising. The intended behaviour is restored here.
2016-07-21 20:50:05 +12:00
Jack Grigg 5a360a5c6a Fix segfault by indirectly monitoring chainActive.Tip(), locking on mutex 2016-07-21 19:34:21 +12:00
zkbot cebeabb2f4 Auto merge of #1119 - ebfull:version-bump, r=ebfull
Bump the (minimum) protocol version to avoid invoking legacy behavior

This sets the current protocol version to `170002` (an order of magnitude larger than Bitcoin's) and the minimum to the same.

Closes #1107
2016-07-21 04:55:06 +00:00
Jack Grigg 5b4ebcd5e2 Add tests that exercise the cancellation code branches 2016-07-21 16:39:32 +12:00
Jack Grigg 2dbabb1159 Make Equihash solvers cancellable
The miner only cancels the solver when chainActive.Tip() changes.

Closes #1055
2016-07-20 19:17:02 +12:00
zkbot e117ff7651 Auto merge of #1048 - str4d:collect-all-valid-equihash-solns, r=ebfull
Collect all permutations of final solutions

This fixes a small bug where if there was a three-way (or more) collision in the final step, one or more valid solutions would be left out.
2016-07-20 03:54:30 +00:00
Sean Bowe 697cc53b29 Bump the (minimum) protocol version to avoid invoking legacy behavior from upstream. 2016-07-19 19:07:14 -06:00
zkbot b83061544f Auto merge of #1116 - ebfull:performance-check-valid-pour-fix, r=ebfull
Introduce `zcsamplejoinsplit` for creating a raw joinsplit description

We need this to generate joinsplits for use in the performance measurements. The current measurements for *memory usage* of verification are wrong now that we're computing the joinsplit before verifying: https://speed.z.cash/timeline/?exe=1&base=1%2B9&ben=memory+verifyjoinsplit&env=1&revs=50&equid=off&quarts=on&extr=on

This PR fixes that.
2016-07-20 00:03:46 +00:00
zkbot a1cded5b91 Auto merge of #1088 - ThisIsNotOfficialCodeItsJustForks:t1078-fix-sighash-bug-2, r=ebfull
Fix SIGHASH_SINGLE bug by removing in-band signalling.

Competes with #1079. Closes #1078.

**I FORCE PUSHED**
2016-07-19 23:39:06 +00:00
zkbot b5dfcd0fbb Auto merge of #1063 - ThisIsNotOfficialCodeItsJustForks:t898-remove-insecurely-downloaded-dependencies, r=ebfull
Remove insecurely-downloaded dependencies that we don't currently use.

Closes #898.
2016-07-19 23:14:06 +00:00
Taylor Hornby 86551dcb18 Remove insecurely-downloaded dependencies that we don't currently use. 2016-07-19 16:42:58 -06:00
zkbot 741cf2cedf Auto merge of #1115 - ebfull:shorten-proving-key, r=ebfull
Remove the constraint system from the alpha proving key.

This removes the constraint system from the `z5-proving.key`, shortening it by about 35%. It appeared at the end of the file, which is why we didn't need to change public parameters in #1104.
2016-07-19 22:38:50 +00:00
Taylor Hornby 838e3c753f Fix the tests that the SIGHASH_SINGLE bugfix breaks. 2016-07-19 16:36:37 -06:00
Taylor Hornby 67f0243533 Remove in-band error signalling from SignatureHash, fixing the SIGHASH_SINGLE bug. 2016-07-19 16:36:35 -06:00
Sean Bowe 1737627c4e Introduce `zcsamplejoinsplit` for creating a raw joinsplit description, and use it to construct the joinsplit for the performance tests that verify joinsplits. 2016-07-19 15:49:11 -06:00
Sean Bowe 1477fd3f40 Remove the constraint system from the alpha proving key. 2016-07-19 14:01:58 -06:00
bitcartel 85cc6f5b44 Update tor.md for Zcash 2016-07-19 12:48:09 -07:00
zkbot 431604c7d9 Auto merge of #1094 - ThisIsNotOfficialCodeItsJustForks:t488-document-side-channel-attacks, r=ebfull
Add security warnings doc with warning about side channels.

Closes #5. Closes #785. Closes #488. Closes #784.

Let's only merge this once we're sure the warning is at least as strong as it needs to be (and thus sufficient to close those tickets).
2016-07-19 17:39:27 +00:00
Jack Grigg c6365f4d80 Add test case that requires the fix 2016-07-19 23:33:28 +12:00
Jack Grigg 1bb40a42c2 Collect all permutations of final solutions 2016-07-19 23:11:49 +12:00
zkbot d20d866d89 Auto merge of #1105 - bitcartel:zc.v0.11.2.z6_issue_424, r=ebfull
New private/public key pairs for broadcasting alert messages

Implements #424

Fixes and integrates method of sending alerts as described by upstream here:
- https://gist.github.com/laanwj/0e689cfa37b52bcbbb44

To send an alert:
- Copy private keys into alertkeys.h.
- Modify alert parameters and message found in sendalert.cpp
- Build and run to send the alert e.g. ./zcashd -printtoconsole -sendalert

Tested and verified with local nodes on alpha 6 testnet.
2016-07-18 21:09:46 +00:00