Commit Graph

13826 Commits

Author SHA1 Message Date
Jack Grigg c87205e5e0 tracing: Log field values that aren't valid UTF-8
This ensures that we retain as much logged information as possible,
while still enabling us to identify field values that cause problems.
2020-08-07 15:26:28 +01:00
Jack Grigg ba831f814a rpc: Throw error in setlogfilter if filter reloading fails 2020-08-07 15:26:28 +01:00
Jack Grigg 58c410974d init: Place additional constraints on pathDebug 2020-08-07 15:26:28 +01:00
Jack Grigg 92f18661d8 FFI: Add missing <stddef.h> includes 2020-08-07 15:26:28 +01:00
Jack Grigg ba1f455e5d wallet: Fix logging to satisfy constexpr requirements 2020-08-07 15:26:28 +01:00
Jack Grigg f57f1c17a2 tracing: Use 'static constexpr' hack in macros
This enables us to enforce that the requisite macro parameters are
compile-time constants with static storage duration.
2020-08-07 15:26:28 +01:00
Jack Grigg cb294bbda0 FFI: Extract common codeunit types into a rust/types.h header 2020-08-07 15:26:28 +01:00
Jack Grigg 253ea6db38 Add some spans to the Zcash codebase 2020-08-07 15:26:28 +01:00
Jack Grigg aae7583cdb Add support for tracing spans 2020-08-07 15:26:28 +01:00
Jack Grigg f89ea3fc33 Add an RPC method for setting the tracing filter directives 2020-08-07 15:26:28 +01:00
Jack Grigg 3f81f9be80 Add support for reloading the tracing filter
Due to tracing's extensive use of the Rust type system, we have to Box
the handle in order to pass it back across the FFI. We define a
ReloadHandle trait which exposes the necessary Handle APIs.
2020-08-07 15:08:10 +01:00
Jack Grigg 2b7d824714 Use a tracing EnvFilter directive for -debug flags 2020-08-07 15:08:10 +01:00
Jack Grigg d5de95f170 Replace C++ logging with tracing logging
Does not yet handle SIGHUP log-reopening.
2020-08-07 15:08:10 +01:00
Jack Grigg e04da74957 FFI wrapper around tracing crate
The tracing crate is initialized with an optional log path, and will
either start a background thread for non-blocking log writing, or write
directly to standard output with ANSI encoding.

C preprocessor macros are used to emulate the Rust macros natively
provided by the tracing crate. They handle the creation of static
tracing callsites, and ensure that the correct file and line number
information is used for each logging site.
2020-08-07 15:07:44 +01:00
Jack Grigg e6a52fa9c8 Add tracing to librustzcash dependencies 2020-08-07 15:07:44 +01:00
Homu b6547929c9 Auto merge of #4593 - str4d:proofverifier-refactor, r=str4d
Refactor ProofVerifier

`ProofVerifier` was previously used to conditionally verify pre-Sapling Sprout
proofs (based on `ProofVerifier::Strict` or `ProofVerifier::Disabled` being
used), but hybrid Sprout proofs bypassed it (so were being verified multiple
times during block verification), and once `libsnark` was removed in
zcash/zcash#4060 `ProofVerifier::check` was doing nothing.

This PR refactors `ProofVerifier`, moving it out of the `libzcash` compilation
unit (so that it can depend on `primitives/transaction.h`), and moving Sprout
verification from `JSDescription::Verify` to `ProofVerifier::VerifySprout`.
Verification-skipping for Sprout proofs is re-introduced.

Additionally, the `ZCJoinSplit` global is removed from the codebase, and
`ZCJoinSplit::prove` is converted into a static function. We load the hybrid
Sprout parameters dynamically at proving time within the Rust code, and no
longer require a C++ global for any proving parameters.

As a side-effect, `libzcashconsensus.la` building with `--with-libs` is fixed,
as `primitives/transaction.cpp` no longer depends on `librustzcash.h`.
2020-08-07 12:16:59 +00:00
Jack Grigg 3855cf8be7 test: Remove obsolete TransactionBuilder test
We no longer pass Sprout parameters into the transaction builder, so
there's no error to test for.
2020-08-07 12:37:10 +01:00
Homu 022c3a4c6d Auto merge of #4567 - oxarbitrage:issue4537, r=daira
Build BDB utilities

To install the binaries we need to build with just `install` instead of `install_lib` and `install_include`, this will install everything.

Then the binaries will be moved to a folder in `zcutil` directory. We can just leave them in staging however the user might have a hard time to find them there.

Closes https://github.com/zcash/zcash/issues/4537
2020-08-07 11:11:47 +00:00
Daira Hopwood 45b2a612eb
Update Makefile.am
zcutil/bin should be cleaned by `make distclean`, not `make clean`.

Co-authored-by: str4d <thestr4d@gmail.com>
2020-08-07 11:03:55 +01:00
Homu d6f527a88f Auto merge of #4650 - teor2345:patch-1, r=daira
Fix a comment typo in pow.cpp

*Documentation and testing not required: comment-only change.*
2020-08-06 10:32:11 +00:00
teor 5919464919
Fix a comment typo in pow.cpp 2020-08-06 19:03:52 +10:00
Homu 67ab09ae43 Auto merge of #4646 - defuse:bump-dependency-update-deadlines, r=str4d
Add new dependencies to updatecheck.py; extend the postponement deadline by a month
2020-08-04 13:06:13 +00:00
Taylor Hornby 902bf838af Add new dependencies to updatecheck.py, add a flag we can use to have our CI test it. 2020-08-03 15:01:01 -06:00
Taylor Hornby 88082c4a56 Extend deadline for postponing dependency updates 2020-08-03 15:00:22 -06:00
Homu 4e3c04c876 Auto merge of #4588 - nuttycom:remove_amqp, r=str4d
Remove AMQP code and Proton library dependencies & flags
2020-07-31 21:47:52 +00:00
Kris Nuttycombe 4dd0647c1c Remove Proton license from contrib/debian/copyright 2020-07-31 13:08:19 -06:00
Kris Nuttycombe 0391809da1 Remove amqp code and Proton library depenencies & flags. 2020-07-31 13:08:18 -06:00
Homu bded4ca502 Auto merge of #4583 - oxarbitrage:issue4495, r=str4d
Check for config options that may be duplicated in the config file

`ReadConfigFile()` now enforces that only a subset of config options may be duplicated. CLI behaviour is unaltered.

Closes https://github.com/zcash/zcash/issues/4495
2020-07-31 15:59:13 +00:00
Homu 2589b2fcc5 Auto merge of #4614 - str4d:ctaes, r=str4d
Replace OpenSSL AES with ctaes-based version

Backported from upstream PR https://github.com/bitcoin/bitcoin/pull/7689.

This is backported primarily to remove merge conflicts for a subsequent
backport, and also helps us towards removing OpenSSL. Its actual usage
in wallet encryption would be replaced by a more modern construction
before we make wallet encryption a supported feature, but for now this
does not affect anyone using the experimental feature.
2020-07-31 00:14:40 +00:00
Jack Grigg fb2edcc352 Debian: Add copyright entries for ctaes and secp256k1 2020-07-30 05:57:00 +01:00
Daira Hopwood 63bfdad106 Fix a return status issue.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-29 14:28:54 +01:00
Homu f39e4dbaf1 Auto merge of #4627 - LarryRuane:issue4596-flush-wallet-db, r=str4d
flush witness cache (SetBestChain()) on clean shutdown

Closes #4596, follow-on to #4573. In addition to flushing witness data on shutdown, fix the RPC test that was preventing this change from being part of #4573.
2020-07-29 13:12:04 +00:00
Daira Hopwood 454fd23a90 Update .gitignore.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-29 13:31:19 +01:00
Daira Hopwood 499d9c222c zcutil/distclean.sh: remove BDB utility programs.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-29 13:31:19 +01:00
Alfredo Garcia 6abcf40a3e
add more allowed duplicates
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-07-29 08:45:02 -03:00
Homu 615efd2a52 Auto merge of #4584 - defuse:update-ignore, r=str4d
Block release when we haven't checked dependency updates for security fixes
2020-07-29 10:45:44 +00:00
Homu 24f3bcf275 Auto merge of #4623 - str4d:metrics-locking, r=str4d
metrics: Collect general stats before clearing screen

This prevents the metrics screen from flashing if locks are being held
by long-running processes, specifically cs_main during block validation.

We split up locking on cs_main and cs_vNodes to make obtaining the locks
easier, at the expense of potentially having slightly out-of-sync
statistics (which doesn't really matter, as all we are fetching from the
latter lock is the number of connected peers).
2020-07-29 09:33:07 +00:00
Homu 91cb52adc5 Auto merge of #4606 - str4d:safe-mode-alert-for-pre-heartwood-nodes, r=str4d
Send alert to put pre-Heartwood nodes into safe mode.

The alert targets nodes running protocol version <= 170010.
Heartwood-compatible nodes run protocol version >= 170011.
2020-07-29 07:59:59 +00:00
Homu b1b65121ae Auto merge of #4590 - cwsaunders:master, r=str4d
Update two dev tool files from Python 2 to Python 3
2020-07-29 06:45:45 +00:00
Homu e789632c32 Auto merge of #4640 - therealyingtong:v3.1.0-release-notes-update, r=str4d
Add Debian8 deprecation to release notes
2020-07-29 05:39:22 +00:00
ying tong f7b3a55505
Update doc/release-notes/release-notes-3.1.0.md
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-07-29 07:21:25 +08:00
therealyingtong b5ee15b781
Add Debian8 deprecation to release notes 2020-07-29 05:42:12 +08:00
Homu 65f0a4736a Auto merge of #4638 - therealyingtong:release-v3.1.0, r=daira
Release v3.1.0
2020-07-28 12:11:27 +00:00
therealyingtong 369c16ef44
Set APPROX_RELEASE_HEIGHT to 917000 and update release-notes-3.1.0.md 2020-07-28 07:57:58 +08:00
therealyingtong 228b17c9e0
make-release.py: Updated release notes and changelog for 3.1.0. 2020-07-28 07:02:06 +08:00
therealyingtong f25e86a460
make-release.py: Updated manpages for 3.1.0. 2020-07-28 07:02:06 +08:00
therealyingtong e4963385a4
make-release.py: Versioning changes for 3.1.0. 2020-07-28 06:54:02 +08:00
Homu d08883263f Auto merge of #4636 - daira:disable-mining-regression, r=daira
Fix "--disable-mining" build regression

closes #4634

Test by building with:
* `CONFIGURE_FLAGS="--disable-tests --disable-mining --disable-bench" zcutil/build.sh`
* `zcutil/distclean.sh`
* `CONFIGURE_FLAGS="--disable-mining" zcutil/build.sh`

After the second build, run `qa/zcash/full-test-suite.py`. Stop when it gets to the RPC tests, which will hang. The preceding parts of the test suite are all expected to pass.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-27 21:41:25 +00:00
Homu 162d5a50ee Auto merge of #4610 - ebfull:testnet-dev-fund, r=str4d
Add dev fund addresses and set activation height for testnet NU4 activation.
2020-07-27 09:05:53 +00:00
Daira Hopwood 40b9cbf0b1 Allow Equihash validation tests to be compiled with --disable-mining.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-25 16:33:02 +01:00