Commit Graph

17370 Commits

Author SHA1 Message Date
Kris Nuttycombe 6ae749d4d9 make-release.py: Versioning changes for 5.4.0-rc4. 2023-02-01 17:35:05 -07:00
Kris Nuttycombe 582dc52b67 Add #6387 fix to v5.4.0 release notes. 2023-02-01 17:34:35 -07:00
Kris Nuttycombe 5fb4385c5a Postpone rustcxx and native_cxxbridge versions 1.0.89 2023-02-01 17:28:38 -07:00
Charlie O'Keefe e8ae3d97a1
Merge pull request #6394 from nuttycom/zmq_check_snprintf_return
Patch zeromq to check the return value of snprintf where necessary.
2023-02-01 17:19:45 -07:00
Kris Nuttycombe 141d7c29d3
Merge pull request #6236 from zcash/fix_tar_extractall
Adding tarfile member sanitization to extractall()
2023-02-01 16:33:34 -07:00
Kris Nuttycombe c6b1b98389 Apply suggestions from code review
Co-authored-by: Greg Pfeil <greg@technomadic.org>
2023-02-01 13:56:25 -07:00
Kris Nuttycombe 7024b7f5c0 Patch zeromq to check the return value of snprintf where necessary.
@daira identified an error in https://github.com/zeromq/libzmq/pull/4494
that we reproduced in zcash/zcash#6393. This adds @daira's patch from
https://github.com/zeromq/libzmq/pull/4507 to ensure we handle this
potential case of undefined behavior.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2023-02-01 12:31:13 -07:00
Kris Nuttycombe aef66f4845 Add a docker-compose.yml for prometheus/grafana metrics collection.
@str4d provided the zcashd-metrics dashboard.

Co-authored-by: Jack Grigg <jack@z.cash>
2023-02-01 08:51:23 -07:00
Kris Nuttycombe db0d0deef8
Merge pull request #6385 from rex4539/typos
Fix typo
2023-02-01 07:02:58 -07:00
Kris Nuttycombe 0fab09d46e
Merge pull request #6393 from nuttycom/fix/zeromq_macos_build
Patch uses of `sprintf` in `zeromq` that break the build on macOS
2023-01-31 21:26:33 -07:00
Kris Nuttycombe 9751b18207 Patch uses of `sprintf` in `zeromq` that break the build on macOS
Fixes #6006, #6296
2023-01-31 15:55:33 -07:00
Kris Nuttycombe 26dbee2c5f
Merge pull request #6387 from str4d/6004-orchard-reindex
Reset Orchard wallet state in `CWallet::ClearNoteWitnessCache`
2023-01-31 13:36:33 -07:00
str4d bb675d9799
Merge pull request #6390 from nuttycom/merge/version-5.4.0
Partial merge of v5.4.0 release content back to `master`.
2023-01-31 19:01:05 +00:00
Kris Nuttycombe 192804a081 Merge branch 'version-5.4.0' into 'master' 2023-01-30 21:19:54 -07:00
Jack Grigg 204950191c Reset Orchard wallet state in `CWallet::ClearNoteWitnessCache`
The general invariant in the wallet is that `CWallet::ChainTip` is only
called with sequential (either connecting or disconnecting) blocks. The
one exception to this is when starting `zcashd` with `-reindex`, which
creates a discontinuity: the node jumps back to the genesis block, and
`ThreadNotifyWallets` will similarly start notifying the wallet of the
entire chain again.

In Bitcoin Core, this behaviour was fine: there was no persistent cached
state that couldn't just be overwritten during the re-notification. For
Zcash however, wallets need to additionally maintain witnesses for notes
that are spendable, and these witnesses can generally only be amended by
sequential blocks.

For Sprout and Sapling, the discontinuity was handled by checking if a
reindex was occurring during `CWallet::InitLoadWallet`, and clearing the
witness caches in `CWallet::ClearNoteWitnessCache` if so. The witnesses
would then be rebuilt as the reindexed chain was re-connected during
`ActivateBestChain`.

The Orchard wallet stores its witnesses in a different structure on the
Rust side, so it wasn't being cleared at the same time. This meant that
when a full reindex was performed in one go, the sequentiality invariant
would be broken once `ThreadNotifyWallets` reached NU5 activation, and
the node would crash with a failed assertion (the issue at hand).

However, reindexing Zcash takes a long time, and has been historically
buggy for various reasons (e.g. crashing due to OOM). And due to a quirk
of how the `-rescan` behaviour is implemented, if a reindexing node is
restarted during its `ActivateBestChain` phase, on restart the node will
almost always trigger a rescan due to the wallet chain locator not
containing any hashes that match the on-start chain tip. And the first
thing that the rescan logic does is check whether the start of the
rescan is before NU5 activation, and reset the Orchard wallet if so.

We now reset the Orchard wallet unconditionally at the same time as we
clear the Sprout and Sapling witness caches. This additionally clears
spentness information that the Orchard wallet is storing, but that is
rebuilt during the reindex.

Closes zcash/zcash#5736.
Closes zcash/zcash#6004.
2023-01-31 00:28:30 +00:00
Jack Grigg 0d1e1ad438 Fix return type of `orchard_wallet_reset`
Part of zcash/zcash#6386.
2023-01-31 00:28:30 +00:00
Jack Grigg 51d62c652d qa: Add RPC test reproducing the Orchard reindex issue
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2023-01-31 00:28:30 +00:00
Kris Nuttycombe abda46722b
Merge pull request #6382 from nuttycom/defer_zbalance_deprecation
Defer z_getbalance and z_gettotalbalance disablement.
2023-01-30 16:57:07 -07:00
Dimitris Apostolou 4464f81061
Fix typo 2023-01-31 00:26:47 +02:00
Alex Morcos 05a1c41aac FIX: correctly measure size of priority block
(cherry picked from commit bitcoin/bitcoin@c2dd5a3c39)
2023-01-30 21:59:42 +00:00
Alex Morcos 43ce65399c FIX: Account for txs already added to block in addPriorityTxs
(cherry picked from commit bitcoin/bitcoin@a278764748)
2023-01-30 21:59:42 +00:00
Alex Morcos e6d4027888 Refactor CreateNewBlock to be a method of the BlockAssembler class
(cherry picked from commit bitcoin/bitcoin@4dc94d1036)

Zcash: Adapted to include our miner changes.
2023-01-30 21:59:42 +00:00
Kris Nuttycombe 70c9725cc3
Merge pull request #6365 from str4d/6333-cxx-orchard-frontier
rust: Migrate `OrchardMerkleFrontier` to `cxx`
2023-01-30 14:16:34 -07:00
Daira Hopwood 145f2c31ed Use a more recent URL format for GitHub release archives.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2023-01-30 20:29:04 +00:00
Kris Nuttycombe c9d6230e88 Defer z_getbalance and z_gettotalbalance disablement.
These disable-by-default changes need to be deferred until we
have a better replacement that provides a single source for
summary balance information.
2023-01-30 11:00:09 -07:00
Kris Nuttycombe f3b93f87f3
Merge pull request #6380 from zcash/release-v5.4.0-rc3
Release v5.4.0-rc3
2023-01-27 16:11:27 -07:00
Kris Nuttycombe d9a60c9d1e make-release.py: Updated release notes and changelog for 5.4.0-rc3. 2023-01-27 15:07:19 -07:00
Kris Nuttycombe 85440c7bf8 make-release.py: Updated manpages for 5.4.0-rc3. 2023-01-27 15:07:19 -07:00
Kris Nuttycombe 6e8404e9b3 make-release.py: Versioning changes for 5.4.0-rc3. 2023-01-27 15:03:29 -07:00
str4d 932475413a
Merge pull request #6379 from daira/postpone-deps-for-5.4.0
Postpone updates for 5.4.0.
2023-01-27 22:01:51 +00:00
Daira Hopwood 2afaa88c01 Postpone updates for 5.4.0.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2023-01-27 21:55:38 +00:00
Daira Hopwood 88a57f3617
Merge pull request #6368 from nuttycom/bug/slow_wallet_shutdown
Fetch recently conflicted transactions incrementally in ThreadNotifyWallet
2023-01-27 21:23:47 +00:00
Kris Nuttycombe 95e3447b96 Fix potential path or symlink traversal
Use `realpath` instead of `abspath` and remove unused `safe_extract` arguments & defaults.

Reviewed with @daira @str4d @sellout
2023-01-27 14:08:02 -07:00
TrellixVulnTeam 543df3797a Adding tarfile member sanitization to extractall() 2023-01-27 14:08:01 -07:00
Kris Nuttycombe 149ffb9582
Merge pull request #6374 from nuttycom/bug/wallet_rescan_escape
Allow rescan to exit in the case that Ctrl-C is pressed.
2023-01-27 13:54:57 -07:00
Kris Nuttycombe a4e6efa3ce
Merge pull request #6376 from sellout/fetch-params-macos
Support Bash 3.2 in fetch-params.sh
2023-01-27 11:32:20 -07:00
Kris Nuttycombe 29e65bf536 Tolerate missing cached conflict data in ThreadNotifyWallets 2023-01-26 16:51:23 -07:00
Greg Pfeil 81cc5b98e1
Support Bash 3.2 in fetch-params.sh
MacOS still ships with a 15-year-old version of Bash so this removes some usage of features that
require newer (only 10 years old) versions.

Fixes #6367.

Co-authored-by: Mohamed AlFalasi <2569171+edubai@users.noreply.github.com>
2023-01-26 15:33:57 -07:00
Kris Nuttycombe 887b2688df Remove unused DEFAULT_BATCHSCANNERMEMLIMIT constant. 2023-01-26 12:33:55 -07:00
Kris Nuttycombe aab58d308f Bound wallet batch scanner size to 1000 blocks instead of 100 MiB
1000 blocks was selected as a balance between limiting the likely
maximum memory usage of the batch scanner, and avoiding
artificially restricting scanning throughput of small/fast blocks
due to the second-boundary lock synchronization point.

This also removes the `zcashd.wallet.batchscanner.usage.bytes` gague
value that was previously made available when `-prometheusport` was
specified.

Co-authored-by: Jack Grigg <jack@z.cash>
2023-01-26 12:26:31 -07:00
Kris Nuttycombe ce694802d9 Fetch recently conflicted transactions incrementally in ThreadNotifyWallet.
We no longer fetch updates from the mempool unless we have fetched all
updates from the chain, as we would otherwise notify the wallet of
mempool changes for which they have not observed parent transactions
in the chain.

Co-authored-by: Jack Grigg <jack@z.cash>
2023-01-26 12:26:31 -07:00
Kris Nuttycombe 3b17b77f3d Allow rescan to exit in the case that Ctrl-C is pressed.
Wallet rescanning that happens on node startup was previously not
respecting Ctrl-C. We use an explicit check of `ShutdownRequested()`
instead of a `boost::interruption_point` because wallet startup does
not run in a separate thread.

Co-authored-by: Jack Grigg <jack@z.cash>
2023-01-26 11:43:54 -07:00
Kris Nuttycombe 069159b8c1 Merge commit '267ddf8efe36cc799c4c31772a8883ea332ef55b' into version-5.4.0 2023-01-26 09:30:33 -07:00
str4d cc068329d5
Merge pull request #6370 from nuttycom/bug/dumpwallet_help
Fixes an error in `zcash-cli help` following the removal of `dumpwallet`.
2023-01-26 00:48:52 +00:00
Kris Nuttycombe 25c62d804a Fixes an error in `zcash-cli help` following the removal of `dumpwallet`. 2023-01-25 16:57:29 -07:00
Kris Nuttycombe c9b63cc3e5
Merge pull request #6358 from str4d/rpc-tests-python-driver 2023-01-25 15:06:06 -07:00
Jack Grigg 817276c02f rust: Migrate `OrchardMerkleFrontier` to `cxx`
Closes zcash/zcash#6333.
2023-01-24 21:04:48 +00:00
Kris Nuttycombe a1589ac994
Merge pull request #6364 from str4d/release-v5.4.0-rc2
Release v5.4.0-rc2
2023-01-23 21:22:09 -07:00
Jack Grigg 908675b5b9 rust: Add `cxx` version of `RustStream` 2023-01-24 04:15:09 +00:00
Kris Nuttycombe 6d182d7ae7
Update doc/release-notes.md
Minor wording correction.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2023-01-23 19:15:35 -07:00