Commit Graph
100 Commits
Author SHA1 Message Date
zkbot fd23341f1e Auto merge of #1547 - daira:1378-witness-cache-assertion-failure.1, r=bitcartel
Add more precise assertions in IncrementNoteWitnesses

Part of #1378
2016-10-17 03:00:19 -04:00
zkbot 98224d76f5 Auto merge of #1521 - zcash:gitian, r=bitcartel
Update Linux Gitian descriptor for building Zcash

Changes required to use the Gitian builder at https://github.com/zcash/zcash-gitian

Closes #540.
2016-10-17 01:55:03 -04:00
zkbot 4ee9d712b5 Auto merge of #1541 - str4d:upstream-gitian-updates, r=bitcartel
Upstream gitian updates

This PR pulls in all gitian-related PRs that have been merged upstream since 0.11.2. The only ones I left out were documentation-only PRs, because we removed `doc/gitian-building.md` at some point. Here are the commits applied here, in the order shown in `git log` (ie. last to first):

- bitcoin/bitcoin#7283
  - fa42a67
  - fa58c76
- bitcoin/bitcoin#8175
  - 74c1347
- bitcoin/bitcoin#8167
  - 7e7eb27
  - ad38204
  - b676f38
- bitcoin/bitcoin#7776
  - f063863
- bitcoin/bitcoin#7424
  - a81c87f ~ we already partly applied
  - a8ce872
  - f3d3eaf ~ we already partly applied
  - 475813b
  - ~~cd27bf5~~ X we already applied
- bitcoin/bitcoin#7060
  - 3b468a0 ~ we removed doc/gitian-building.md
  - ~~99fda26~~ X we removed doc/gitian-building.md
- bitcoin/bitcoin#7251
  - fa09562
- bitcoin/bitcoin#6900
  - ~~2cecb24~~ X we removed doc/gitian-building.md
  - 957c0fd
  - 2e31d74
  - ~~0b416c6~~ X we removed QT
  - 9f251b7
- bitcoin/bitcoin#6854
  - 579b863 ~ we already partly applied

Part of #540
2016-10-17 01:17:01 -04:00
zkbot e8d28a0acc Auto merge of #1448 - ageis:debian-package, r=bitcartel
Initial packaging for Debian

This adds some source files, a script and skeleton for building a Debian package that installs the zcash daemon and CLI tool.

To test it:

Check out my branch.
Build Zcash binaries: `./zcutil/build.sh`
Build the package: `./zcutil/build-debian-package.sh`
You now have a .deb in the source root folder, so install it: `sudo dpkg -i zcash-1.0.0-rc1-amd64.deb`
Now you can run `zcashd`, `zcash-cli`, and `zcash-fetch-params` from `$PATH`.

This pull request will need further refinement and review, so let's leave it open for a while.
2016-10-17 00:22:50 -04:00
zkbot ec8dc3a88a Auto merge of #1431 - bitcartel:master_1373_taddr_coinbase_error, r=bitcartel
Return a more informative error message when trying to spend coinbase; select non-coinbase inputs when sending to a transparent output if needed

For #1373 and #1519

Code change:
- Extra parameter added to AvailableCoins to include or exclude Coinbase coins.  Default value of parameter is 'true' as current behaviour is to include Coinbase coins.
- SelectCoins, used for sending taddr->taddr, will now exclude Coinbase coins.

Unit test:
Tried to write a test to focus on the extra parameter added to AvailableCoins but could not.

Empirical testing on Testnet:
Current behaviour is that upstream RPC commands sendfrom and sendtoaddress try to spend coinbase coins returned by AvailableCoins.  So the user will see:

```
./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 1000.0
error: {"code":-6,"message":"Insufficient funds"}

./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
error: {"code":-4,"message":"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."}

./zcash-cli sendfrom "" mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
error: {"code":-4,"message":"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."}
```

After fix is applied:

```
./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 1000.0
error: {"code":-6,"message":"Insufficient funds"}

./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
error: {"code":-4,"message":"Coinbase funds can only be sent to a zaddr"}
```

When non-coinbase UTXOs exist, they will now be selected and used:

```
./zcash-cli z_sendmany tnPJZHeVxegCg91utaquBRPEDBGjozfz9iLDHt7zvphFbZdspNgkTVLCGjDcadQBKNyUwKs8pNjDXuEZKrE1aNLpFwHgz4t '[{"address":"mx5fTRhLZwbYE7ZqhAPueZgQGSnwTbdvKU", "amount":0.01}]'

./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 1000.0
error: {"code":-6,"message":"Insufficient funds"}

./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
9818e543ac2f689d4ce8b52087607d73fecd771d45d316a1d9db092f0485aff2

./zcash-cli sendfrom "" mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
899f2894823f51f15fc73b5e0871ac943edbe0ff88e1635f86906087b72caf30
```
2016-10-16 22:08:07 -04:00
zkbot 67ec04e6f4 Auto merge of #1520 - str4d:1502-cache-nullifiers-on-wallet-unlock, r=str4d
Cache nullifiers on wallet unlock

Closes #1502
2016-10-16 17:28:48 -04:00
zkbot cc10005247 Auto merge of #1486 - str4d:1456-writewitnesscache-exception-safety, r=bitcartel
WriteWitnessCache: Catch errors and abort transaction

Closes #1452
2016-10-14 17:37:53 -04:00
zkbot 3fceaca3a1 Auto merge of #1506 - bitcartel:master_1478_fix_testnet3_test_issue, r=bitcartel
Stop some wallet tests creating ~/.zcash/testnet3 folder by setting -datadir environment

Closes #1478
2016-10-14 17:03:11 -04:00
zkbot 27bc01a05b Auto merge of #1523 - bitcartel:master_1504_z_logging, r=bitcartel
Refine LogPrint debugging for z_* rpc calls

For #1504 ZCA011
2016-10-14 11:11:26 -04:00
zkbot 6432b8c453 Auto merge of #1499 - arcalinea:document-coinbase-maturity-security, r=bitcartel
Note that Coinbase maturity interval does not protect JoinSplits

Changed wording of Block Chain Reorganization section in security-warnings.md to note that we did not change Coinbase maturity #1387, but that this also does not protect JoinSplits from becoming invalidated in the case of a block chain reorg #953
2016-10-13 23:52:37 -04:00
zkbot bb25bd4bc1 Auto merge of #1533 - bitcartel:master_1447_document_getfilterednotes, r=bitcartel
Document CWallet::GetFilteredNotes

Also fixes return type of method which should be void.

Part of #1447
2016-10-13 20:25:19 -04:00
zkbot 2b29970e28 Auto merge of #1531 - str4d:1447-document-findmynotes, r=bitcartel
Document CWalletTx::FindMyNotes

Part of #1447
2016-10-13 19:51:06 -04:00
zkbot 8eb672251b Auto merge of #1513 - bitcartel:master_1491_fix_help_message_rpc_z_importkey, r=daira
Fixes #1491 by updating help message for rpc call z_importkey
2016-10-13 19:05:08 -04:00
zkbot a9243e4f15 Auto merge of #1512 - arcalinea:cleanup-documentation, r=daira
Cleanup documentation

Start cleaning up unused/obsolete documentation. ref #1500
2016-10-13 18:24:57 -04:00
zkbot 49fc58b782 Auto merge of #1514 - bitcartel:master_1481_client_identifier, r=bitcartel
Rename client identifier from Satoshi to MagicBean (closes #1481)

@ageis seeder will have be to updated too.
2016-10-13 02:02:58 -04:00
zkbot 3fdca8a8ed Auto merge of #1511 - arcalinea:document-hidden-service-in-tor.md, r=bitcartel
Tor.md: change alpha to beta testnet, add new zcash hidden service address

Note: When @ageis and I checked this the other day, we were getting multiple peer connections. Think we said we'd change this before launch, so I opened issue #1510. Leaving documentation to expect a single peer.
2016-10-12 14:55:03 -04:00
zkbot 137d1f14eb Auto merge of #1507 - ageis:wget-retry, r=bitcartel
Set wget retry options for fetching parameters

This will retry upon refused connections and similar errors, wait 1 second before the next retry, time out after 10 seconds if no data is received or the connection times out, plus try an infinite number of times.

Resolves #1196.
2016-10-11 21:57:39 -04:00
zkbot 7dc49cbc6a Auto merge of #1490 - str4d:1454-deprecate-accounts, r=bitcartel
Throw an RPC error for all accounts except the default

Closes #1454
2016-10-10 23:55:02 -04:00
zkbot 4210e20c9c Auto merge of #1501 - ebfull:100kb-max-tx, r=ebfull
Make 100KB transaction size limit a consensus rule, rather than a standard rule

Closes #1475
2016-10-10 15:39:42 -04:00
zkbot bc0629230a Auto merge of #1493 - bitcartel:master_1446_gettransaction, r=bitcartel
Add vjoinsplit to JSON output of RPC call gettransaction

Closes #1446.
2016-10-08 02:41:18 -04:00
zkbot f2c99399b8 Auto merge of #1492 - arcalinea:document-wallet-reindex, r=bitcartel
Document wallet reindexing for z_importkey description in payment-api.md

Documents how to enable funds for imported keys  #1395
2016-10-07 12:13:53 -04:00
zkbot b4526f4d22 Auto merge of #1458 - str4d:1386-remove-findanddelete-and-codeseparator, r=ageis
Remove FindAndDelete and disable OP_CODESEPARATOR

Closes #1386
2016-10-04 21:51:29 -04:00
zkbot a1e7dda816 Auto merge of #1480 - ageis:update-release-process, r=str4d
Adds note about updating guide during testnet deployment
2016-10-04 19:40:50 -04:00
zkbot 1f4515a8c0 Auto merge of #1477 - zcash:812.change-address-prefixes.0, r=str4d
Update address prefixes

Closes #812 and #1450
2016-10-04 18:59:20 -04:00
zkbot d86218a52f Auto merge of #1476 - ebfull:update-parameters, r=str4d
Update to beta2 public parameters

Also gets rid of the `testnet3`/`regtest` subdirectories/symlinks and other such things.
2016-10-04 04:54:02 -04:00
zkbot ed3e736af0 Auto merge of #1474 - ageis:update-release-process, r=str4d
Inserts some notes related to testnet deployment

Should satisfy #959 for now. I don't want to get too detailed here, since the infrastructure automation is in a still non-public repository, but instead supply a basic overview. We can write more detailed documentation and attach it to that repo.
2016-10-04 04:22:00 -04:00
zkbot 4cfbe798bf Auto merge of #1429 - str4d:867-update-dependencies, r=str4d
Update all dependencies

Also re-enables disabled compiler warnings.

Closes #867, #944, #1241, #1255, #1348.
2016-10-04 03:48:42 -04:00
zkbot 4f49d32a28 Auto merge of #1427 - bitcartel:master_1345_getbalance, r=bitcartel
Fixes #1345 so that RPC getbalance star calculates balance of UTXOs correctly.
2016-10-04 01:20:12 -04:00
zkbot efe18f2e9b Auto merge of #1374 - str4d:1106-alert-safe-mode, r=str4d
Enable high-priority alerts to put the RPC into safe mode

This reverts the changes in 986b5e257e and adds a priority check.

Continuation of #1337
Closes #1106
2016-10-03 17:36:59 -04:00
zkbot fa632c1c91 Auto merge of #1468 - str4d:1138-change-versioning-scheme, r=str4d
Change versioning scheme

Closes #1138
2016-10-02 19:29:38 -04:00
zkbot 0df0ce05f0 Auto merge of #1467 - ageis:wget-cert-verify, r=str4d
Verify TLS certificates w/ wget in fetch-params.sh

Per NCC-2016-017, wget was being run with `--no-check-certificate`, which means that the connection can be man-in-the-middled, even if we are verifying the integrity of the parameters later via hash sums.
The rationale cited in the Bash comments does not stand up to scrutiny. There's really no persuasive reason not to verify certificates.

Fixes #1346.
2016-10-02 03:01:14 -04:00
zkbot d9da9d69ff Auto merge of #1398 - bitcartel:master_fr48, r=bitcartel
Add multiple founders' reward addresses

./zcash-gtest --gtest_filter="founders_reward_test.*"

Closes #1405.
2016-10-01 17:12:33 -04:00
zkbot d90ed0df93 Auto merge of #1433 - str4d:gtest-expected-failures, r=str4d
Add a make command for checking expected failures

With this merged, we can add gtests prefixed with `DISABLED_`, and then configure Buildbot to run those tests but not require they pass in order to merge.
2016-09-30 17:12:26 -04:00
zkbot d5dce9342b Auto merge of #1444 - str4d:1394-reindex-clear-witness-caches, r=str4d
Clear note witness caches on reindexing

This PR also fixes a test that was passing arguments in the wrong order.

Closes #1394
2016-09-30 02:30:01 -04:00
zkbot 71b2b66e26 Auto merge of #1370 - ageis:improve-fetch-params, r=daira
Improvements to fetch-params.sh

Two instances of the fetch-params.sh script running at once will result in corruption of the proving key and an error when the hashes are computed. This implements a lock to stop such a scenario from occurring.

We also terminate and don't create the symlinks if the downloaded parameters fail the checksum command.

Fixes #1306. This is the same as #1310 but now targeting master.
2016-09-29 20:22:07 -04:00
zkbot 07e425ac1c Auto merge of #1372 - str4d:1199-spending-key-wallet-encryption, r=str4d
Encrypt spending keys in the wallet

This is a continuation of #1210.
2016-09-29 19:42:30 -04:00
zkbot 2b83ac82ab Auto merge of #1451 - zcash:daira-update-CoC-email, r=str4d
Update my email address in the Code of Conduct.
2016-09-29 06:12:21 -04:00
zkbot 42941c9fd4 Auto merge of #1445 - bitcartel:master_fix_filtered_notes, r=str4d
Fix casting error in GetFilteredNotes

Use int for minDepth like upstream instead of size_t which can lead to casting problems if a wallet tx has a depth of -1.
Also don't use FindMyNotes as mapNoteData has already been set on wallet tx.

@str4d As dicussed. This should be merged before other PRs related to wallet.
2016-09-29 05:33:11 -04:00
zkbot 587f848482 Auto merge of #1384 - str4d:1378-atomic-witness-storage, r=ebfull
Write note witness cache atomically to disk to avoid corruption

Closes #1378
2016-09-27 21:27:11 -04:00
zkbot c470cdf70b Auto merge of #1376 - str4d:1191-improve-multithreaded-benchmark, r=daira
Measure multithreaded solveequihash time per-thread

Continuation of #1213
Closes #1191
2016-09-23 15:01:04 -04:00
zkbot 976479f824 Auto merge of #1411 - bitcartel:master_bitcoin_7106, r=daira
Upstream patch: Fix and improve relay from whitelisted peers

https://github.com/bitcoin/bitcoin/pull/7106
a9f3d3db5c0c8d1697998ed9b3e192ddbf9a31f4

An extra commit modifies the log message string, otherwise there are are a number of commits that need be to backported to add methods e.g. GetDebugMessage.  These commits modify the interface in consensus/validation.h so there are conflicts to be resolved. e.g.
9003c7c
a9ac95c
5f12263
fbf44e6
2016-09-20 19:41:00 -04:00
zkbot 5ef7fecf14 Auto merge of #1407 - bitcartel:master_bitcoin_7079, r=daira
Upstream patch: Prevent peer flooding inv request queue

https://github.com/bitcoin/bitcoin/pull/7079
5029698186445bf3cd69d0e720f019c472661bff
ebb25f4c23adbcb55796c402bafd6064a136f16f
2016-09-20 19:11:28 -04:00
zkbot 2271d3feda Auto merge of #1338 - str4d:147-tweak-difficulty-adjustment-algorithm, r=ebfull
Tweaks to difficulty adjustment algorithm

This PR changes the difficulty algorithm to adjust from the average difficulty over the
block window instead of from the last difficulty. It also removes the special rules for the
testnet, which are incompatible with difficulty averaging.

Closes #147 again.
2016-09-08 02:21:13 +00:00
zkbot 0372ce1f92 Auto merge of #1355 - bitcartel:zc.v0.11.2.latest_paymentapi, r=ebfull
Update payment API documentation for beta 1

Remove 'not in alpha 9' labels as RPC calls are now implemented.
2016-09-08 01:40:49 +00:00
zkbot 02932fc9cc Auto merge of #1341 - ebfull:fix-checktransaction-bug, r=ebfull
Fix CheckTransaction bugs.

Closes #1319.

Does not address the name of `vpub_old` or `vpub_new`.
2016-09-07 20:22:13 +00:00
zkbot c5b5d50004 Auto merge of #1342 - ebfull:remove-todo, r=ebfull
Remove TODO 808.

Closes #1309.
2016-09-07 16:55:23 +00:00
zkbot b181f7032b Auto merge of #1328 - bitcartel:zc.v0.11.2.latest_1298_rest_interface, r=ebfull
Update security-warnings.md about REST interface

Closes #1298
2016-09-02 03:43:16 +00:00
zkbot 485ace0a1b Auto merge of #1311 - ebfull:cleanup-pp, r=ebfull
Deallocate the public parameters during Shutdown.

This also has it deallocated in `GenerateParams` and `test_bitcoin`. The virtual destructor probably isn't necessary but I added it just in case we need it some other time.
2016-09-02 03:03:45 +00:00
zkbot 2640989d9a Auto merge of #1308 - str4d:1181-getmininginfo-testnet-difficulty-rules, r=ebfull
Separate concepts of block difficulty and network difficulty in RPC

"Block difficulty" is the difficulty listed in a block's header, which in the
testnet can sometimes be min-difficulty (if time-since-last-block is too large).

"Network difficulty" is the difficulty that the network was trying to satisfy
at a particular block height. In mainnet this is always equal to the difficulty
of the solved block for that height, but in testnet the network difficulty is
derived from the last non-min-difficulty block difficulty.

This commit fixes the RPC APIs that are intended to show network difficulty, so
that on testnet they don't sometimes drop to 1.0, confusing users.

Closes #1181
2016-09-01 18:12:46 +00:00
zkbot 8a620d507f Auto merge of #1326 - str4d:1185-remove-mainnet-dns-seeds, r=ebfull
Remove mainnet DNS seeds, set checkpoint to genesis

Closes #1185
2016-09-01 13:54:52 +00:00
zkbot a723794f81 Auto merge of #1233 - str4d:1199-note-tracking, r=str4d
Add Note tracking

This PR extends the existing transaction tracking in the wallet to track spendable Notes.

Closes #1199
2016-09-01 08:17:07 +00:00
zkbot 83ec5cb87b Auto merge of #1322 - bitcartel:zc.v0.11.2.z9_1316_getblocksubsidy, r=ebfull
Closes #1315 - change to RPC getblocksubsidy

For #1315
RPC getblocksubsidy height parameter is now optional
Returns result for future block
Test has been added to verify parameter input and results
2016-08-31 21:45:11 +00:00
zkbot 54ce3c46dd Auto merge of #1323 - bitcartel:zc.v0.11.2.latest_update_payment_api_doc, r=ebfull
Update payment-api.md

Add z_getoperationresult to documentation.

@ebfull This document might be updated again with a few notes, so let's merge closer to release.  Thanks.
2016-08-31 20:06:34 +00:00
zkbot f9c02827d4 Auto merge of #1300 - ThisIsNotOfficialCodeItsJustForks:t915-add-wformat-security.2, r=ebfull
Add -Wformat -Wformat-security

Closes #915. Supersedes #1267 (because of weird rebase/github/zkbot bug).
2016-08-30 22:31:48 +00:00
zkbot 835588a629 Auto merge of #1314 - str4d:fix-getblock-solution-output, r=ebfull
Output Equihash solution in RPC results as a hex string

When the Equihash solution was changed to a compact form in #1175, the block header changed from storing a vector of indices to a vector of chars. `blockToJSON()` was not updated, which meant that RPC calls like `getblock` returned the solution as a list of 1344 integers.

This PR changes `blockToJSON()` to output the Equihash solution as a hex string, identical to how it appears in the block header.
2016-08-30 18:40:19 +00:00
zkbot 6731665a12 Auto merge of #1313 - bitcartel:zc.v0.11.2.z9_1122, r=ebfull
Fixes #1122 where json_spirit could stack overflow

See #1122 for details.
2016-08-30 18:00:11 +00:00
zkbot e0fa312756 Auto merge of #1307 - str4d:remove-debug-pow-code, r=ebfull
Undo debugging change from 5be6abbf84

This was unintentionally committed, and caused Equihash verification of blocks
without parents to be skipped. This only affects the genesis block on the test
network, but also causes the "time verifyequihash" benchmark to incorrectly
appear instantaneous.
2016-08-29 22:09:17 +00:00
zkbot 77a99f4a2a Auto merge of #1285 - ralphtheninja:zc.v0.11.2.latest, r=daira
update FormatException()

changed module name from "bitcoin" to "Zcash" in FormatException()
2016-08-26 02:06:23 +00:00
zkbot 8b139c2441 Auto merge of #1303 - daira:z9-version-number, r=daira
Update version number and add release notes for z9.

refs #1290
2016-08-25 19:32:20 +00:00
zkbot f8b73015bc Auto merge of #1208 - bitcartel:z8_rpc_keys, r=daira
RPC calls to manage zkey creation, management and backup

Rebased on PR #1205 for keystore functionality.

For #1197, implements:
z_getnewaddress
z_importkey
z_exportkey

For #1198, spending key support added to:
z_exportwallet
z_importwallet

Example dump file containing zkeys:
https://gist.github.com/bitcartel/d7013b30b19419c6a550bc5d6ff6cc47

Also adds:
z_listaddresses

Tests in:
gtest/test_wallet_zkeys
test/rpc_wallet_tests
2016-08-25 13:49:05 +00:00
zkbot cca52f36df Auto merge of #1301 - bitcartel:zc.v0.11.2.latest_701_md_formatting, r=daira
Fix formatting of first paragraph of payment API document

The description of taddr and zaddr were bunched up one line.  This PR fixes the issue.

Self-ACK.  Please merge.
2016-08-25 10:09:56 +00:00
zkbot 2833fb14af Auto merge of #1291 - daira:decrease-max-headers-results, r=daira
Decrease MAX_HEADERS_RESULTS to 1000. fixes #1289

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-08-24 05:45:53 +00:00
zkbot cab581256f Auto merge of #1292 - bitcartel:zc.v0.11.2.latest_701_rpc_docs, r=daira
Closes #701 by adding documentation about the Payment RPC interface.

@daira Calls which might not make it into z9 are labelled (NOT IN Z9 ALPHA).
2016-08-24 05:05:11 +00:00
zkbot cd9d373987 Auto merge of #1260 - str4d:1175-byte-array-manipulation, r=ebfull
Update Equihash implementation to match the Zcash spec

Closes #1175
2016-08-24 03:01:13 +00:00
zkbot 27bd8e4129 Auto merge of #1270 - ThisIsNotOfficialCodeItsJustForks:t1168-fix-optimization-flags, r=daira
Fix inconsistent -O1/-O2, fix libzcash flags, add -fwrapv -fno-strict-aliasing

Closes #1168. In that ticket I decided the optimization flags for dependencies are out of scope, i.e. we go with whatever the upstream package maintainer chose.
2016-08-23 03:30:31 +00:00
zkbot fed866e212 Auto merge of #1262 - ebfull:compressed-proofs, r=ebfull
Implement zkSNARK compression

Implement zkSNARK compression.

The serialization format of zkSNARKs has now been specified in our protocol specification. G1/G2 elements are now compressed into 33 byte and 65 byte formats, repsectively. `MONTGOMERY_OUTPUT` is enabled everywhere to make proving/verifying keys load faster and be consistent with the MPC.

Proofs are now 296 bytes. This PR also updates the proving and verifying keys.

Closes #1103. Closes #471.

See also https://github.com/zcash/libsnark/pull/3 and https://github.com/zcash/libsnark/pull/4
2016-08-23 02:11:30 +00:00
zkbot 07b246988b Auto merge of #1261 - str4d:892-branch-coverage, r=daira
Coverage report improvements
2016-08-23 00:19:48 +00:00
zkbot 365845216b Auto merge of #1268 - ThisIsNotOfficialCodeItsJustForks:t1130-upgrade-libsodium, r=ebfull
Upgrade libsodium for AVX2-detection bugfix.

Upgrades libsodium to bring in an AVX2-detection bugfix (to help with #1130).
2016-08-22 02:34:30 +00:00
zkbot f4491c51e4 Auto merge of #1248 - rcseacord:rcseacord-patch-4, r=ebfull
Update uint256.h

Addresses load of misaligned address for type 'const uint32_t' #1246
2016-08-22 00:12:48 +00:00
zkbot 7e556172d9 Auto merge of #1236 - tomrittervg:tomrittervg-comments-1, r=ebfull
Clarify comment about nonce space for Note Encryption
2016-08-18 23:38:36 +00:00
zkbot 28a30f7801 Auto merge of #1254 - ebfull:tx-structure-changes, r=bitcartel
Change memo field size and relocate `ciphertexts` field of JoinSplit description

Closes #1190
Closes #1187
2016-08-18 16:49:47 +00:00
zkbot af9898eee5 Auto merge of #1258 - ThisIsNotOfficialCodeItsJustForks:t1251-upstream-anti-dos, r=daira
Pull in some DoS mitigations from upstream

Closes #1251.

**WARNING: I force pushed**
2016-08-18 16:08:25 +00:00
zkbot 3d28c86c8e Auto merge of #1205 - str4d:1199-key-management, r=str4d
Add support for spending keys to the basic key store

Prerequisite for #1197 and #1199.
2016-08-18 00:27:09 +00:00
zkbot 39af39fb85 Auto merge of #1231 - rcseacord:rcseacord-patch-3, r=str4d
Address incorrect use of shared_ptr in test_equihash.cpp

Closes #1228
2016-08-17 01:30:26 +00:00
zkbot cdc01fad17 Auto merge of #1230 - rcseacord:rcseacord-patch-1, r=str4d
Address incorrect use of shared_ptr in equihash.cpp

Closes #1214
2016-08-17 00:35:57 +00:00
zkbot d7da4ecc33 Auto merge of #1194 - bitcartel:zc.v0.11.2.z8_issue_1193_fixtest, r=ebfull
Improve speed and accuracy of zcbenchmark validatelargetx

The verification test, in a loop, passes `spending_tx` (a `CMutableTransaction`) to the constructor of `MutableTransactionSignatureChecker`, which immediately uses it to create a non-mutable `CTransaction` object, which is used for the actual verification process.

Since `spending_tx` is not mutated during the verification loop & process, we can instead convert it to a `CTransaction` just once, and use it with `TransactionSignatureChecker`.

This removes the time to create `CTransaction` objects from the benchmark itself.

Results show an improvement in running time to complete the verification phase of the test and consistent times across z7 and z8 releases.

```
Benchmarks on i3 processor:
z7 old 228.67205900 --> z7 new 49.27225200
z7 old 229.90048900 --> z7 new 48.38650700
z8 old 295.77963800 --> z8 new 48.37695100
z8 old 294.32640100 --> z8 new 49.93216100
```
2016-08-14 21:21:58 +00:00
zkbot 0822971120 Auto merge of #1183 - bitcartel:zc.v0.11.2.latest_txid_tests, r=bitcartel
Add gtest for non-malleable txids.

1. Test txid of normal transaction is double sha256 with sigscript input data removed
2. Test txid of coinbase transaction is double sha256 over whole tx

You can run a single test with:
./zcash-gtest --gtest_filter="txid_tests*"
2016-08-06 21:47:23 +00:00
zkbot 95277e0311 Auto merge of #1144 - bitcartel:zc.v0.11.2.z7_tx_malleability_gettxid, r=bitcartel
A fix for transaction malleability

This PR fixes transaction malleability by not including the sigscript of transaction inputs and joinsplit sigs when hashing the txid.

This PR supercedes PR #1101 which was a minimal solution based on a new serialization flag.

This PR introduces GetTxid() to distinguish between getting a transaction id and the double sha256 hash.

The key changes are:
- Adding GetTxid() method to CTransaction which makes a copy of the transaction, clearing out the sigscript and joinsplitsig fields, before hashing.
- Verifying that every call to GetHash() actually wants a txid, and replacing with GetTxid().
- Renaming GetHash() to GetSerializeHash()
  - Rationale: In future, upstream code we want to merge will use GetHash() but we don't know the intent.  We should check to see if the intent is to receive a txid (most likely) in which case we replace with GetTxid(), or if upstream actually wants a double hash of the transaction we can use GetSerializeHash().
- Updated genesis data in chainparams.cpp

Note that coinbase transactions are excluded as they need the sigscript hashed to help avoid duplicate txids per BIP34:
  - This modification is related to a question from @ebfull on PR #1101 - "Can we think of a way this change allows us to construct two transactions with the same txid which can simultaneously appear in the blockchain? My guess is it would be possible to construct a coinbase transaction of such a form... this surely breaks invariants."

This PR Passes all tests in test_bitcoin (test data was updated in bloom_tests, miner_tests and script_tests).
2016-08-05 19:31:52 +00:00
zkbot e5b57a1432 Auto merge of #1173 - str4d:1165-equihash-fix-large-k-ballooning, r=bitcartel
Eliminate some of the duplicates caused by truncating indices

Closes #1165
2016-08-05 17:35:35 +00:00
zkbot 76470978f4 Auto merge of #1172 - str4d:1148-remove-equihash-collision-length-assumption, r=bitcartel
Remove the assumption that n/(k+1) is a multiple of 8

This version works, but generates the initial rows in a way that is probably
not what we want to specify.

Closes #1148
2016-08-05 16:53:28 +00:00
zkbot 9cc43696ec Auto merge of #1086 - zcash:daira-simplify-readme-title, r=bitcartel
README.md: simplify the title, drop "Core"

We only have one public tree.
2016-08-04 01:33:43 +00:00
zkbot abd4c16ae9 Auto merge of #1064 - ThisIsNotOfficialCodeItsJustForks:t915-enable-security-hardening, r=bitcartel
Verify security hardening features are turned on
2016-08-03 23:57:05 +00:00
zkbot 1f7e1f68c6 Auto merge of #1157 - ThisIsNotOfficialCodeItsJustForks:t761-run-tests-under-valgrind, r=nathan-at-least
[WIP] Add more commands to run unit tests under valgrind.

This runs both zcash-gtest and test_bitcoin under valgrind. There's a corresponding PR to the buildbot config https://github.com/Electric-Coin-Company/bbotzc/pull/23. Closes #761.
2016-08-03 23:11:44 +00:00
zkbot a40d70f464 Auto merge of #1160 - str4d:1131-remove-hardfork, r=bitcartel
Remove hardfork from special testnet difficulty rules

Closes #1131
2016-08-03 17:56:32 +00:00
zkbot 19b49de082 Auto merge of #1158 - bitcartel:zc.v0.11.2.latest_1126_trycatch, r=ebfull
Extend try catch block around call to libsnark verifier

As discussed in #1126.

@daira Per your [comment](https://github.com/zcash/zcash/pull/1126#issuecomment-234714939):

> I would like assertion errors during tests to cause a test failure (unless the test explicitly expects them). Can we split this into verify and verify_internal, where the former does the try/catch around a call to verify_internal, and the latter is called by verification unit tests?

Did you mean move everything inside the extended try/catch to verify_internal, or just the call to r1cs_ppzksnark_verifier_strong_IC?
2016-08-01 21:16:53 +00:00
zkbot 4714ea145b Auto merge of #1146 - str4d:1143-equihash-solution-callback, r=ebfull
Equihash: Pass each obtained solution to a callback for immediate checking

Closes #1143
2016-07-30 02:59:12 +00:00
zkbot b2e956be01 Auto merge of #1137 - bitcartel:zc.v0.11.2.latest_deprecate_zcraw_api, r=ebfull
zcash-cli: Label zcraw... rpc commands as being deprecated

These RPC calls will be removed from 1.0, so let's mark them as deprecated.
2016-07-28 17:25:52 +00: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
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`](https://github.com/zcash/libsnark/commit/59adbefcc870c1e807a0378403b6a4022da71d03) removes a remote-DoS that can occur if proofs are not well-formed.

[`e3779f9`](https://github.com/zcash/libsnark/commit/e3779f90490905e88c3a08c7194ee948dd8a0da5) removes more files that we do not need from libsnark.

[`11242d8`](https://github.com/zcash/libsnark/commit/11242d8afe304c8bcc252baec483f04a110d1dd4) 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
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
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
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
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
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
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
zkbot 4d459f93a4 Auto merge of #1090 - ebfull:rename-pour-and-serial, r=ebfull
Rename things to match protocol specification

This is a pass through the code to eliminate usage of "pour" and "serial" and any other outdated terminology.

Closes #602
2016-07-18 19:58:25 +00:00
zkbot e613014526 Auto merge of #1104 - ebfull:libsnark-updates, r=ebfull
Update libsnark

We have now forked libsnark's current master and applied the following patches:

* [`9216072`: Remove code that we don't use.](https://github.com/zcash/libsnark/commit/9216072c3b20d65359f4d5f3982c8270dab422b6) (unblocks #69)
* [`dcb78b2`: Modify makefile to stop compiling things we removed.](https://github.com/zcash/libsnark/commit/dcb78b24d9de86522f7f976741111e9e66804889)
* [`a6b0ad0`: Use libsodium's PRNG](https://github.com/zcash/libsnark/commit/a6b0ad0c801fe96d0e12e5961279cdf306a412fa) (closes #780)
* [`4036716`: Don't (de)serialize the constraint system in the proving key.](https://github.com/zcash/libsnark/commit/403671675ada05caf7446f9676fa3c54d5830325) (closes #491)
* [`a703148`: Taylor's compilation patch](https://github.com/zcash/libsnark/commit/a7031481fd8d2360337321401fe8e24f0359317a) (@defuse can you submit this to upstream?)

This PR adopts those changes, and makes the requisite changes to Zcash to support them. I have decided to not bring libsnark in tree for the time being, though it should be incredibly easy to do later if we're *absolutely* sure we should.
2016-07-18 18:04:56 +00:00