dash/contrib
pasta 251f16b82b
Merge #6267: feat(stats): split off transmission to RawSender, implement batching and queueing support, add streamlined prefix and suffix support
cc1a75ab3a docs: add release notes (Kittywhiskers Van Gogh)
39625f16f0 stats: drop copyright notice from `stats/client.cpp` (Kittywhiskers Van Gogh)
18a2e48eb9 stats: rename `statsns` to clearer `statsprefix` (Kittywhiskers Van Gogh)
42918c2cdc stats: rename `statshostname` to more appropriate `statssuffix` (Kittywhiskers Van Gogh)
f3a4844b0a stats: implicitly treat stats as enabled if `statshost` is specified (Kittywhiskers Van Gogh)
69603a83fa stats: miscellaneous changes and housekeeping (Kittywhiskers Van Gogh)
3e12ac0e09 stats: deduplicate `send` and `sendDouble` logic (Kittywhiskers Van Gogh)
bf44fc3bf6 feat(stats): introduce support for batching messages (Kittywhiskers Van Gogh)
38b1643fe6 feat(stats): introduce support for queuing messages (Kittywhiskers Van Gogh)
fc4a736e2a stats: move message sending logic to `RawSender` (Kittywhiskers Van Gogh)
92690685be stats: move `statsd_client` to `stats` directory (Kittywhiskers Van Gogh)
f782dfd562 stats: remove double indentation in header file (Kittywhiskers Van Gogh)

Pull request description:

  ## Motivation

  This pull request achieves the goal originally set out in [dash#5167](https://github.com/dashpay/dash/pull/5167), to migrate the base of our Statsd client implementation to one that is actively maintained. Statoshi ([source](54c3ffdcf0/src/statsd_client.cpp)) utilizes [talebook/statsd-client-cpp](https://github.com/talebook/statsd-client-cpp), which in turn is inherited by Dash.

  As Statsd is the only cross-platform reporting mechanism available (USDT requires a Linux host with superuser privileges and RPCs don't provide as much flexibility as desired), emphasis is placed on using Statsd as the primary way for the Dash daemon to report metrics related to node and network health.

  As part of maintaining our Statsd client, this PR aims to migrate the base of our implementation to [vthiery/cpp-statsd-client](https://github.com/vthiery/cpp-statsd-client), a streamlined implementation that embraces C++11 with a thread-safe implementation of queueing and batching, which reduces the number of packets used to transmit stats.

  These capabilities are optional and users can opt not to use them by setting `-statsduration=0` to disable queueing (which will also disable batching) or `-statsbatchsize=0`, which will disable batching (but will not disable queueing unless requested explicitly).

  ## Additional Information

  * Dependent on https://github.com/dashpay/dash/pull/5167
  * `RawSender` (and by extension, `RawMessage`) strive to remain as unopinionated as possible, moving the responsibility to construct valid Statsd messages onto `StatsdClient`. This is to ensure that  `RawSender` can be reused down the line or independently extended without impacting the Statsd client.
    * `RawMessage` exists to provide extensions to `std::vector<uint8_t>` that make it easier to abstract away strings while also implementing some of its semantics like `append()` (and its alias, `+=`).
  * `InitStatsClient()` was introduced to keep `StatsdClient` indifferent to _how_ arguments are obtained and sanitized before they're supplied to the constructor. This is to keep it indifferent to all the backwards-compatibility code for deprecated arguments still work.
  * When constructing the Statsd message, we can use `%f` without having to specify a precision as tinyformat automatically assumes a precision of 6 ([source](17110f50b3/src/tinyformat.h (L673))) and problems don't seem to be observed when using `%f` with integers ([source](https://github.com/dashpay/dash/pull/6267#issuecomment-2345592051)).
    * As a guardrail, there is a `static_assert` to ensure that a specialization of `send()` involving a non-arithmetic type will raise alarm when compiling ([source](a0ce720207/src/stats/client.cpp (L145))).

  ## Breaking changes

  * `-statsenabled` (replaced with specifying `-statshost`), `-statshostname` (replaced by `-statssuffix`) and `-statsns` (replaced by `-statsprefix`) have been deprecated and will be removed in a future release.

  ## Checklist:

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)**
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  knst:
    utACK cc1a75ab3a
  UdjinM6:
    utACK cc1a75ab3a

Tree-SHA512: b038419f2b6d807dac40a04d23c5046fbaa95beedb88f5a9e4c06a7042c2f5da7e01c72c4a2744bce10878cafc747136d6599dcd86ae1be0782ad4194d5b7bec
2024-10-04 14:07:13 -05:00
..
auto_gdb refactor: s/sporkManager/sporkman/g 2024-03-14 03:29:06 +00:00
builder-keys chore: update pasta gpg key to reflect new subkeys 2024-09-27 12:54:58 -05:00
containers fix: group the ENV in quotations 2024-08-12 11:58:20 +07:00
debian Merge bitcoin-core/gui#266: Doc: Copyright: Fix embedded font file location 2024-06-11 08:39:08 -05:00
devtools stats: drop copyright notice from stats/client.cpp 2024-10-04 08:48:30 +00:00
guix Merge bitcoin/bitcoin#29725: depends: build libqrencode with CMake 2024-09-29 10:54:41 +03:00
init Merge #21418: contrib: Make systemd invoke dependencies only when ready 2024-04-22 09:42:16 -05:00
linearize merge bitcoin#22633: Replace remaining binascii method calls 2024-07-23 17:45:24 +00:00
macdeploy Merge bitcoin/bitcoin#22418: release: Remove gitian 2023-12-06 12:40:58 -06:00
message-capture fix: check if message can be handled before attempting to deserialize 2024-03-12 15:17:16 -05:00
qos Merge bitcoin/bitcoin#21740: test: add new python linter to check file names and permissions 2024-05-16 02:09:37 +07:00
seeds chore: update seeds 2024-07-25 02:00:25 +07:00
shell feat: Set client version for non-release binaries and version in guix based on git tags (#5653) 2024-01-11 21:43:42 -06:00
testgen Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
tracing merge bitcoin#23907: utxocache tracepoints follow up 2024-09-04 18:46:14 +00:00
verify-commits chore: drop travis mentioning in docs and comments 2024-03-27 00:48:27 +07:00
verifybinaries fix: adjust verify-binaries script to properly handle RCs 2024-02-24 11:07:44 -06:00
windeploy feat: migrate to a CA issued certificate 2024-02-24 10:44:55 -06:00
zmq merge bitcoin#19572: Create "sequence" notifier, enabling client-side mempool tracking 2024-08-26 15:35:12 +00:00
dash-cli.bash-completion Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
dash-tx.bash-completion Merge #8289: bash-completion: Adapt for 0.12 and 0.13 2017-12-28 11:44:59 +01:00
dashd.bash-completion Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
filter-lcov.py Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
install_db4.sh Merge bitcoin/bitcoin#26772: contrib: fix sha256 check in install_db4.sh for FreeBSD 2024-08-12 11:52:39 +07:00
README.md Merge bitcoin/bitcoin#22418: release: Remove gitian 2023-12-06 12:40:58 -06:00
valgrind.supp merge bitcoin#20744: Use std::filesystem. Remove Boost Filesystem & System 2024-08-06 18:00:39 +00:00

Repository Tools

Developer tools

Specific tools for developers working on this repository. Contains the script github-merge.py for merging GitHub pull requests securely and signing them using GPG.

Verify-Commits

Tool to verify that every merge commit was signed by a developer using the above github-merge.py script.

Linearize

Construct a linear, no-fork, best version of the blockchain.

Qos

A Linux bash script that will set up traffic control (tc) to limit the outgoing bandwidth for connections to the Dash network. This means one can have an always-on dashd instance running, and another local dashd/dash-qt instance which connects to this node and receives blocks from it.

Seeds

Utility to generate the pnSeed[] array that is compiled into the client.

Build Tools and Keys

Debian

Contains files used to package dashd/dash-qt for Debian-based Linux systems. If you compile dashd/dash-qt yourself, there are some useful files here.

Builder keys

PGP keys used for signing Dash Core release results.

MacDeploy

Scripts and notes for Mac builds.

Test and Verify Tools

TestGen

Utilities to generate test vectors for the data-driven Dash tests.

Verify Binaries

This script attempts to download and verify the signature file SHA256SUMS.asc from bitcoin.org.