Commit Graph

14951 Commits

Author SHA1 Message Date
Pavel Janík 27d328030c Do not shadow LOCK's criticalblock variable for LOCK inside LOCK
zcash: cherry picked from commit 33d15a3a76d073986337adcd62646d93e7ba223f
zcash: https://github.com/bitcoin/bitcoin/pull/8472
2021-04-01 14:29:40 -06:00
Homu e39441ff8b Auto merge of #5044 - daira:delete-spare-fr-addrs, r=daira
Delete spare mainnet Founders' Reward addresses that will never be used

These addresses were originally intended as fallbacks if an FR address was compromised.
There is no need to retain them in the code given that the FR has ended.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-04-01 13:02:48 +00:00
Daira Hopwood f5d53f953c Delete spare mainnet Founders' Reward addresses that will never be used.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-04-01 13:03:06 +01:00
Homu 2d3b58c993 Auto merge of #4999 - LarryRuane:upstream-locking-0.13, r=str4d
Bitcoin 0.13 locking PRs

These are locking changes from upstream (bitcoin core) release 0.13, oldest to newest (when they were merged to the master branch).
- https://github.com/bitcoin/bitcoin/pull/7846
- https://github.com/bitcoin/bitcoin/pull/7913
- https://github.com/bitcoin/bitcoin/pull/8016
  - second commit only; first commit, test changes, are already done
- https://github.com/bitcoin/bitcoin/pull/7942

This PR does not include:
 - https://github.com/bitcoin/bitcoin/pull/8244 27f8126ff3
   -  zcash requires locking `cs_main` in this instance (`getrawmempool()` calls `mempoolToJSON()`, which calls `chainActive.Height()`).
2021-04-01 05:46:27 +00:00
Homu 51ca3b955a Auto merge of #2939 - plutoforever:master, r=str4d
removed bashisms from build scripts

Closes https://github.com/zcash/zcash/issues/2677
2021-04-01 01:37:37 +00:00
Jack Grigg fb38cf0d90 lint: Fix false positive
shellcheck interprets the single-quoted string as arguments to echo, not
the string that echo echos. Switching to double quotes fixes the lint.
2021-04-01 14:30:35 +13:00
Jack Grigg a1903d2644 Remove usage of local from fetch-params.sh 2021-04-01 14:28:41 +13:00
Homu 057fa9a335 Auto merge of #5043 - daira:no-rust-docs, r=str4d
native_rust: don't install Rust docs

This speeds up builds, especially native builds on macOS. fixes #5042

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-03-31 22:20:18 +00:00
Kris Nuttycombe da3eb82e96 Ensure that Sapling version range checks are always guarded by SAPLING_VERSION_GROUP_ID 2021-03-31 16:17:32 -06:00
Daira Hopwood c80ddb36f1 native_rust: don't install Rust docs. This speeds up builds, especially native builds on macOS.
fixes #5042

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-03-31 19:26:45 +01:00
Homu ba4eb241e7 Auto merge of #4996 - str4d:2074-net-blocksonly, r=str4d
Add -blocksonly option

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6993
- bitcoin/bitcoin#7046
- bitcoin/bitcoin#6780
  - The third commit (we backported the rest in #2390).
- bitcoin/bitcoin#7126
- bitcoin/bitcoin#7439
- bitcoin/bitcoin#15990
  - Only the `-blocksonly` documentation changes.
- bitcoin/bitcoin#16555
- bitcoin/bitcoin#18391
  - Only the `-blocksonly` documentation changes.

Part of #2074.
2021-03-31 11:27:22 +00:00
glowang 49d420f808 Update -blocksonly documentation
When -blocksonly is set to 1, it interacts with the -walletbroadcast
parameter and sets it to 0 if it has not been set already.This behavior
is not captured by the current documentation, which claims that -blocksonly
does not impact any wallet transactions.

(cherry picked from commit 621e86ee8d0102e2bf41f7656a368083b89b2f83)

Zcash: Excludes max-peer doc changes, since we don't have
block-relay-only peers yet.
2021-04-01 00:24:19 +13:00
Sjors Provoost c6fbc477dd [doc] mention whitelist is inbound, and applies to blocksonly
(cherry picked from commit 20ea9ef6ce9228a5258b99eeeeb40e6dfae2299f)
2021-04-01 00:17:02 +13:00
MarcoFalke 8dd2c02a3a doc: Mention blocksonly in reduce-traffic.md, unhide option
(cherry picked from commit fa8ced32a60dea37ac169241cf9a1f708ef46c4b)

Zcash: Only the documentation changes.
2021-04-01 00:13:49 +13:00
plutoforever 762f643613 removed bashisms from build scripts
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-03-31 19:24:36 +13:00
Homu 49d76cf3f6 Auto merge of #4947 - str4d:rust-metrics, r=str4d
Add metrics collection and a Prometheus exporter

This adds an FFI wrapper around the `metrics` crate, and exposes CPP macros for collecting metrics in the C++ codebase. With this, we can collect metrics from both C++ and Rust.

The following metrics are included in this PR:
- Chain metrics:
  - (counter) `zcash.chain.verified.block.total`
  - (gauge) `zcash.chain.verified.block.height`
  - (histogram) `zcash.chain.verified.block.seconds`
- Value pool metrics:
  - (gauge) `zcash.pool.notes.created[name]`
  - (gauge) `zcash.pool.notes.spent[name]` (currently not measured)
  - (gauge) `zcash.pool.notes.unspent[name]` (currently not measured)
  - (gauge) `zcash.pool.value.zatoshis[name]`
- P2P network metrics:
  - (gauge) `zcash.net.peers`
  - (counter) `zcash.net.in.bytes.total`
  - (counter) `zcash.net.in.bytes[command]`
  - (counter) `zcash.net.in.messages[command]`
  - (counter) `zcash.net.out.bytes.total`
  - (counter) `zcash.net.out.bytes[command]`
  - (counter) `zcash.net.out.messages[command]`
- Node metrics:
  - (gauge) `zcash.mempool.size.transactions`
  - (gauge) `zcash.mempool.size.bytes`
  - (gauge) `zcash.mempool.usage.bytes`
  - (informational) `zcashd.build.info`

Collection of metrics is conditional on enabling an exporter. This PR adds a Prometheus exporter that can be enabled with `-prometheusport=<port>`. Metrics names have `.` replaced by `_` for compatibility with Prometheus.

By default, metrics are only exposed to localhost. This can be expanded with `-metricsallowip=<ip>`.
2021-03-31 02:49:42 +00:00
Jack Grigg b845868e2a metrics: Don't assert that the Sprout tree is accessible
RewindBlockIndex calls DisconnectTip in a way that can potentially cause
a Sprout tree to not exist (the rewind_index RPC test reliably triggers
this). We only need to access the tree during disconnection for metrics
purposes, and we will never encounter this rewind situation on either
mainnet or testnet, so if we can't access the Sprout tree we default to
zero.
2021-03-31 12:45:38 +13:00
Jack Grigg c940fd302b book: Fix typo in metrics documentation 2021-03-31 09:21:28 +13:00
Jack Grigg 83eef40f4c rust: Add license header to metrics_ffi::prometheus 2021-03-31 09:19:17 +13:00
Jack Grigg 3030df906d net: Clear CNode::strSendCommand if a message is aborted 2021-03-31 09:08:55 +13:00
Jack Grigg f8d63a83fc metrics: Rework pool metrics in anticipation of transparent pool
notes.created and notes.spent can be collected for the transparent pool
as well as the shielded pools. notes.unspent can only be collected for
the transparent pool, by design.
2021-03-30 15:12:36 +13:00
Jack Grigg 0cab2e7094 metrics: Remove zcash.sync.* metrics
- zcash.sync.block.downloaded.total is redundant, and can be replaced by
  zcash.net.in.messages[command=block].
- zcash.sync.block.verified.total and zcash.chain.verified.block.total
  are identical for us, because we verify blocks synchronously.
2021-03-30 15:12:36 +13:00
Jack Grigg e2e5df28a9 metrics: Rename metrics with consistent naming scheme
- Add zcash. prefix to common metrics.
- Use .total suffix for accumulating counters instead of .count.
- Group names where possible.
- Shorten names where possible (and still clear).
2021-03-30 15:12:36 +13:00
Jack Grigg 0f9e4b9472 metrics: Use labels for pool statistics
It's very likely that you'll want to operate over common pool statistics
together.
2021-03-30 15:12:36 +13:00
Jack Grigg 78b83fd6e9 metrics: Enable gauges with fully-static labels 2021-03-30 15:12:36 +13:00
Jack Grigg 958ffeafd3 metrics: Move documentation into zcashd book 2021-03-30 15:12:36 +13:00
Jack Grigg c9e3d03320 rust: Pin hyper 0.14.2
hyper 0.14.3 added an unstable C API, but the changes to enable it
require us to configure cargo with a linker for cross-compilation.
We'll need to figure this out eventually, but for now let's just
pin hyper to a version that doesn't require it.
2021-03-30 15:12:35 +13:00
Jack Grigg d08cdbe5f7 metrics: Implement IP access control on Prometheus scrape endpoint 2021-03-30 15:12:08 +13:00
Jack Grigg 59da774f22 Mention in release notes that metrics names may still change 2021-03-30 15:12:08 +13:00
Jack Grigg 34d2edb619 Add -prometheusmetrics to release notes 2021-03-30 15:12:08 +13:00
Jack Grigg 1e5f9284c0 rust: Check for invalid UTF-8 in -prometheusmetrics argument 2021-03-30 15:12:08 +13:00
str4d dde7546091 Clean up comment
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-03-30 15:12:08 +13:00
str4d d0f468e1ce Add security warnings for -prometheusmetrics option
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-03-30 15:12:08 +13:00
Jack Grigg 523f969654 rust: Use consistent include guards in header files 2021-03-30 15:12:08 +13:00
Jack Grigg ab3196c1df Add more detailed metrics
- Sprout and Sapling pool metrics (commitments, values)
- Block verification time histogram (as a summary, not bucketed)
- Mempool stats (same as getmempoolinfo returns)
- Inbound and outbound bytes labelled by command
- Added command labels to message counters
2021-03-30 15:12:08 +13:00
Jack Grigg 1c2c8fed2e metrics: Expose binary metadata 2021-03-30 15:12:08 +13:00
Jack Grigg 92e75de46f metrics: Add support for labels
Given that label values may be dynamic, any metrics callsite with labels
can't be stored statically. Instead, we contruct a fresh metrics Key each
time we hit a metric with labels (if a metrics recorder is installed).
2021-03-30 15:12:08 +13:00
Jack Grigg 7a96af8260 rust: Move helper macros into rust/helpers.h 2021-03-30 15:12:08 +13:00
Jack Grigg 37b42d8a41 tracing: Merge TracingSpanFields macro into TracingSpan
Leverages the VA_OPT macro library, which is a polyfill for __VA_OPT__
on non-C++20 platforms, to enable TracingSpan to support optional fields.

Source: https://github.com/willwray/VA_OPT
License: Boost Software License, Version 1.0
2021-03-30 15:12:08 +13:00
Jack Grigg e5a5bc5b83 metrics: Add documentation and example configs 2021-03-30 15:12:08 +13:00
Jack Grigg 90f4d48307 Add some metrics that match existing zebrad metrics
The metric names match those used in zebrad, so the same visualisers can
be used for both nodes.

See https://github.com/ZcashFoundation/zebra/issues/1381 for discussion
about potential naming changes.
2021-03-30 15:12:08 +13:00
Jack Grigg a79ffa3b50 rust: Add a Prometheus metrics exporter
The -prometheusmetrics=host_name:port config option enables the metrics
exporter.
2021-03-30 15:12:07 +13:00
Jack Grigg 8482ed6356 rust: Implement FFI interface to metrics crate 2021-03-30 15:11:17 +13:00
Homu ccb26821df Auto merge of #5036 - str4d:rust-bump, r=str4d
Rust 1.51.0 and zcash_* 0.5.0
2021-03-28 20:01:03 +00:00
Jack Grigg f7c7e0ee13 qa: Update BerkeleyDB downloads page URL 2021-03-27 11:47:34 +13:00
Jack Grigg 2e12078cfc depends: Update Rust to 1.51.0 2021-03-27 11:47:34 +13:00
Jack Grigg 8393b3da88 rust: zcash_{primitives, proofs} 0.5.0 2021-03-27 11:47:25 +13:00
Jack Grigg 5ffcb198a7 cargo update 2021-03-27 10:42:04 +13:00
Kris Nuttycombe 766abede57
Document UPGRADE_ZFUTURE
Co-authored-by: str4d <thestr4d@gmail.com>
2021-03-24 08:17:32 -06:00
Kris Nuttycombe dd914fcdcf Document FeatureSet type. 2021-03-23 19:42:45 -06:00