Commit Graph

13788 Commits

Author SHA1 Message Date
Jack Grigg 6a4ff45e8a Use BOOST_SCOPE_EXIT_TPL to clean and free datValue in CDB::Read 2020-05-01 10:57:24 +12:00
Homu 29ad02eda3 Auto merge of #4483 - nuttycom:update_cargo_lockfile, r=ebfull
Update cargo lockfile to V2 version.
2020-04-30 19:35:01 +00:00
Kris Nuttycombe 12ad13d2d8 Update to the Cargo V2 lockfile format.
The following crates required explicit downgrades:
    arrayvec v0.4.12 -> v0.4.11
    autocfg v0.1.7 -> v0.1.6
    c2-chacha v0.2.3 -> v0.2.2
    ppv-lite86 v0.2.6 -> v0.2.5
    proc-macro2 v1.0.10 -> v1.0.3
error: no matching package named `quote` found
location searched: registry `https://github.com/rust-lang/crates.io-index`
required by package `ff_derive v0.6.0`
    ... which is depended on by `ff v0.6.0`
    ... which is depended on by `bellman v0.6.0`
    ... which is depended on by `librustzcash v0.2.0 (/home/nuttycom/work/zcash)`
2020-04-30 13:26:31 -06:00
Kris Nuttycombe 2bb5e2d175 Update all crates. 2020-04-30 13:16:18 -06:00
Tim Ruffing 1ccdb5734d Improve documentation of memory_cleanse()
So far, the documentation of memory_cleanse() is a verbatim copy of
the commit message in BoringSSL, where this code was originally
written. However, our code evolved since then, and the commit message
is not particularly helpful in the code but is rather of historical
interested in BoringSSL only.

This commit improves improves the comments around memory_cleanse()
and gives a better rationale for the method that we use. This commit
touches only comments.
2020-04-30 17:40:26 +12:00
Tim Ruffing f27ff314e6 Clean up logic in memory_cleanse() for MSVC
Commit fbf327b13868861c2877c5754caf5a9816f2603c ("Minimal code
changes to allow msvc compilation.") was indeed minimal in terms
of lines touched. But as a result of that minimalism it changed the
logic in memory_cleanse() to first call std::memset() and then
additionally the MSVC-specific SecureZeroMemory() function, and it
also moved a comment to the wrong location.

This commit removes the superfluous call to std::memset() on MSVC
and ensures that the comment is in the right position again.
2020-04-30 17:40:26 +12:00
Aaron Clauson 2fcc466273 Minimal code changes to allow msvc compilation.
Zcash: Only changes that did not conflict.
2020-04-30 17:40:26 +12:00
Adam Langley c502acc7c4 Switch memory_cleanse implementation to BoringSSL's to ensure memory clearing even with link-time optimization.
The implementation we currently use from OpenSSL prevents the compiler from optimizing away clensing operations on blocks of memory that are about to be released, but this protection is not extended to link-time optimization. This commit copies the solution cooked up by Google compiler engineers which uses inline assembly directives to instruct the compiler not to optimize out the call under any circumstances. As the code is in-lined, this has the added advantage of removing one more OpenSSL dependency.

Regarding license compatibility, Google's contributions to BoringSSL library, including this code, is made available under the ISC license, which is MIT compatible.

BoringSSL git commit: ad1907fe73334d6c696c8539646c21b11178f20f
2020-04-30 17:40:26 +12:00
Thomas Snider 0a2d4756e1 [wallet] Securely erase potentially sensitive keys/values 2020-04-30 17:40:26 +12:00
Homu 0dbb2d05d3 Auto merge of #4465 - oxarbitrage:issue4463, r=str4d
Add z_getnotescount API

Implement new API call to count notes in wallet.

Closes https://github.com/zcash/zcash/issues/4463
2020-04-30 01:35:59 +00:00
Homu 9e86cc2d82 Auto merge of #4427 - nuttycom:simplify_connect_tip, r=daira
Remove option to load new blocks from ConnectTip

A minor refactoring to move file IO out of ConnectTip, which has only a single caller.
2020-04-25 19:06:55 +00:00
Alfredo Garcia 4c40f9f514 implement z_getnotescount api call 2020-04-25 11:17:20 -03:00
Homu c2a8beadec Auto merge of #4462 - rex4539:fix-typos, r=str4d
Fix typos
2020-04-25 06:51:08 +00:00
Homu 0ad52ca9b1 Auto merge of #4249 - oxarbitrage:issue_3724, r=str4d
Add confirmations, blockheight, blockindex and blocktime to z_listreceivedbyaddress

Fixes https://github.com/zcash/zcash/issues/3724

1- There was a PR to add confirmations to this call at https://github.com/zcash/zcash/pull/3836
I ported the commit from there and fixed test case by incrementing the confirmations as suggested at: https://github.com/zcash/zcash/pull/3836#issuecomment-499927807

2- Then added `blockheight`, `blockindex` and `blocktime`. To avoid some duplicated code (Sprout/Sapling) created a structure `trxblock`.

3- Original issue requests only time and blockindex however i think height is also important; if `blockindex` is the position of the transaction in the block then you are going to need also `height` to find it.
2020-04-25 05:28:16 +00:00
Kris Nuttycombe 5a8f6f8058 Merge remote-tracking branch 'upstream/master' into bug/4119-rewind_detection 2020-04-22 14:58:11 -06:00
Kris Nuttycombe 368a7c5a9d Ensure that we don't pass a null block pointer to ConnectTip. 2020-04-22 13:17:05 -06:00
Kris Nuttycombe db65d92df4 Make condition closer to original, Fix incorrect comment. 2020-04-22 13:17:05 -06:00
Kris Nuttycombe 2013b35e3e Remove option to load new blocks from ConnectTip 2020-04-22 13:17:05 -06:00
Homu ff1e8ebe2f Auto merge of #4469 - ebfull:release-v2.1.2, r=ebfull
Release v2.1.2

Includes **testnet** activation of Heartwood (NU3) on block `903800` -- approx May 6th, 4pm MST. Does **not** include mainnet activation, that's planned for `3.0.0`. See release notes for other cool changes.
2020-04-22 19:13:38 +00:00
Sean Bowe fdf34cefac
make-release.py: Updated release notes and changelog for 2.1.2. 2020-04-22 10:46:06 -06:00
Sean Bowe bfb0e4d985
make-release.py: Updated manpages for 2.1.2. 2020-04-22 10:46:06 -06:00
Sean Bowe 9eadd525a5
make-release.py: Versioning changes for 2.1.2. 2020-04-22 10:43:50 -06:00
Homu caea54013e Auto merge of #4468 - ebfull:heartwood-testnet, r=ebfull
Set Heartwood activation height for testnet to 903800.

Should activate on testnet approx 4PM MST on May 6th, 2020.
2020-04-22 00:50:15 +00:00
Daira Hopwood f7208c19c5 Clarify definition of NETWORK_UPGRADE_PEER_PREFERENCE_BLOCK_PERIOD.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-04-22 01:15:06 +01:00
Sean Bowe b42af16553
Set Heartwood activation height for testnet to 903800. 2020-04-21 16:13:33 -06:00
Homu ee00d28907 Auto merge of #4466 - ebfull:fix-gitian, r=str4d
Add rust resources to distribution.

These were added in 90f7234136 but aren't currently being included by `make dist`.
2020-04-21 17:52:00 +00:00
Sean Bowe 08e6ed154c
Add test_random.h to distribution tarball. 2020-04-20 14:53:48 -06:00
Sean Bowe 37fa94e01d
Add Rust resources to distribution tarball. 2020-04-20 13:44:06 -06:00
Alfredo Garcia 766e0b8f09 add a test case 2020-04-19 09:52:38 -03:00
Dimitris Apostolou 8403e04db9
Fix typos 2020-04-17 17:46:15 +03:00
Ben Wilson 299887486c Fixed Docker README grammar 2020-04-16 09:02:13 -04:00
Homu 659ac40ad1 Auto merge of #4457 - ebfull:release-v2.1.2-rc1, r=str4d
Release v2.1.2-rc1
2020-04-16 10:50:28 +00:00
Jack Grigg 51af936f19 Set hashFinalSaplingRoot and hashChainHistoryRoot in AddToBlockIndex
- hashFinalSaplingRoot is now always set to hashLightClientRoot before
  Heartwood activation (regardless of whether or not that is the correct
  Sapling root), and set to the Sapling root after Heartwood activation
  only for blocks that have been passed to ConnectBlock() at least once.

- hashChainHistoryRoot is now always set "correctly" (either null, or
  identical to hashLightClientRoot).

We rely on the fact that block headers are downloaded in order, and we
therefore always know the height of a block header, in order to check
whether Heartwood is active for a particular header.
2020-04-16 20:48:20 +12:00
Sean Bowe 3da600ee3a
make-release.py: Updated release notes and changelog for 2.1.2-rc1. 2020-04-15 17:47:45 -06:00
Sean Bowe 8f0655b841
make-release.py: Updated manpages for 2.1.2-rc1. 2020-04-15 17:47:45 -06:00
Sean Bowe 2386046941
make-release.py: Versioning changes for 2.1.2-rc1. 2020-04-15 17:45:34 -06:00
Homu 215c74ec3f Auto merge of #4454 - defuse:cscriptnum-serialization-fix, r=daira
Fix undefined behavior in CScriptNum

Fixes #4432
2020-04-15 22:36:33 +00:00
Kris Nuttycombe 7629560a26 Trivial comment. 2020-04-15 16:09:19 -06:00
Kris Nuttycombe a4e80ae1ab Restart node in a chain split state to allow the test to complete. 2020-04-15 15:58:48 -06:00
Homu e7e5a61f2b Auto merge of #4453 - str4d:release-notes-v2.1.2, r=ebfull
Update release notes for v2.1.2
2020-04-15 21:35:14 +00:00
Kris Nuttycombe 9fc94cc372 The last valid height condition reads better flipped. 2020-04-15 14:33:41 -06:00
Homu 9307eab1ab Auto merge of #4452 - rex4539:fix-typo, r=str4d
Fix typos in test framework
2020-04-15 20:25:14 +00:00
Kris Nuttycombe 40b5d5e3ea Fix #4119. 2020-04-15 14:19:09 -06:00
Kris Nuttycombe 5030e73afc Make the test reproduce the actual off-by-one error in rewind length. 2020-04-15 14:19:05 -06:00
Homu 4fad49d802 Auto merge of #4416 - daira:sa_restart, r=daira
Use SA_RESTART in sa_flags when setting up signal handlers

Explanation: if a signal interrupts certain syscalls such as `open`, `read`, or `write`,
then the library function will by default fail with `errno` `EINTR`. But we [almost](https://github.com/zcash/zcash/search?q=WSAEINTR) [never](https://github.com/zcash/zcash/search?q=EINTR)
check for `EINTR`, so this is likely to cause spurious errors. We want to restart the syscall
instead, which is what `SA_RESTART` is intended to do. Since our signal handlers (defined
in init.cpp) only set a flag, restarting the syscall is safe and is always the Right Thing.

See <https://www.gnu.org/software/libc/manual/html_node/Flags-for-Sigaction.html> and
<https://www.gnu.org/software/libc/manual/html_node/Interrupted-Primitives.html> for
further information.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-04-15 19:23:14 +00:00
Alfredo Garcia a1c37b7b79
Fix typo
Co-Authored-By: Dimitris Apostolou <dimitris.apostolou@icloud.com>
2020-04-15 15:46:49 -03:00
Ben Wilson c3fe9e9850 Fixed README grammar, reuse Dockerfile vars 2020-04-15 13:41:05 -04:00
Homu 1f5de9cae2 Auto merge of #4306 - oxarbitrage:issue4224, r=daira
Compute more structures in CTxMemPool::DynamicMemoryUsage()

Closes https://github.com/zcash/zcash/issues/4224

Added more structures to the computation of the mempool memory size as indicated in the issue. RPC call `getmempoolinfo` is the only place where this is used to get the `usage` result.
2020-04-15 17:03:31 +00:00
Ben Wilson 416d6c9880 Added Dockerfile to contrib with README 2020-04-15 11:51:20 -04:00
Homu 8a2ab9fbda Auto merge of #4450 - str4d:make-release-py3, r=daira
Updates to zcutil/make-release.py

Finishes its migration to Python 3, and adds release process dependency checks.
2020-04-15 15:36:42 +00:00