dash/test/lint
UdjinM6 b559a8f904
Backporting Statoshi and bitcoin#16728 (#2515)
* Backport Statoshi

This backports some of https://github.com/jlopp/statoshi.

Missing stuff: README.md and client name changes, segwit and fee estimation stats.

Fix RejectCodeToString

Fix copy-paste mistake s/InvalidBlockFound/InvalidChainFound/

* Merge #16728: move-only: move coins statistics utils out of RPC

8a3b2eb17572ca2131778d52cc25ec359470a90f move-only: move coins statistics utils out of RPC (James O'Beirne)

Pull request description:

  This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11):

  Parent PR: #15606
  Issue: #15605
  Specification: https://github.com/jamesob/assumeutxo-docs/tree/master/proposal

  ---

  In the short-term, this move-only commit will help with fuzzing (https://github.com/bitcoin/bitcoin/pull/15606#issuecomment-524482297). Later, these procedures will be used to compute statistics (particularly a content hash) for UTXO sets coming in from snapshots.

  Most easily reviewed with `git ... --color-moved=dimmed_zebra`. A nice follow-up would be adding unittests, which I'll do if nobody else gets around to it.

ACKs for top commit:
  MarcoFalke:
    ACK 8a3b2eb17572ca2131778d52cc25ec359470a90f, checked --color-moved=dimmed-zebra

Tree-SHA512: a187d2f7590ad2450b8e8fa3d038c80a04fc3d903618c24222d7e3172250ce51badea35860c86101f2ba266eb4354e6efb8d7d508b353f29276e4665a1efdf74

* Fix 16728

* Modernize StatsdClient

- Reuse some functionality from netbase
- Switch from GetRand to FastRandomContext
- Drop `using namespace std` and add `// namespace statsd`

* Introduce PeriodicStats and make StatsdClient configurable via -stats<smth> (enabled/host/port/ns/period)

* Move/rename tip stats from CheckBlock to ConnectBlock

* Add new false positives to lint-format-strings.py

* Add snprintf in statsd_client to the list of known violations in lint-locale-dependence.sh

* Fix incorrect include guard

* Use bracket syntax includes

* Replace magic numbers with defaults

* Move connection stats calculation into its own function

And bail out early if stats are disabled

* assert in PeriodicStats

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2020-12-15 10:22:23 -06:00
..
check-doc.py Merge #13281: test: Move linters to test/lint, add readme 2020-07-29 10:59:04 -05:00
check-rpc-mappings.py Merge #13281: test: Move linters to test/lint, add readme 2020-07-29 10:59:04 -05:00
commit-script-check.sh Merge #13281: test: Move linters to test/lint, add readme 2020-07-29 10:59:04 -05:00
git-subtree-check.sh Make shellcheck happy 2020-07-29 11:20:12 -05:00
lint-all.sh Merge #13281: test: Move linters to test/lint, add readme 2020-07-29 10:59:04 -05:00
lint-filenames.sh Merge #13496: Test: Harden lint-filenames.sh 2020-07-08 18:32:04 -05:00
lint-format-strings.py Backporting Statoshi and bitcoin#16728 (#2515) 2020-12-15 10:22:23 -06:00
lint-format-strings.sh Fix warnings introduced in shellcheck v0.6.0 (Partial Merge: #15166) 2020-07-29 11:02:55 -05:00
lint-include-guards.sh Merge #13281: test: Move linters to test/lint, add readme 2020-07-29 10:59:04 -05:00
lint-includes.sh test: Add boost/signals2/connection.hpp to lint-inlcudes.sh 2020-10-14 12:10:11 +01:00
lint-locale-dependence.sh Backporting Statoshi and bitcoin#16728 (#2515) 2020-12-15 10:22:23 -06:00
lint-logs.sh Merge #13281: test: Move linters to test/lint, add readme 2020-07-29 10:59:04 -05:00
lint-python-shebang.sh Merge #13281: test: Move linters to test/lint, add readme 2020-07-29 10:59:04 -05:00
lint-python-utf8-encoding.sh Merge #13494: Follow-up to #13454: Fix broken build by exporting LC_ALL=C 2020-07-28 21:35:31 -05:00
lint-python.sh Merge #12284: Remove assigned but never used local variables. Enable Travis checking for unused local variables. 2020-10-26 20:35:28 -04:00
lint-shell-locale.sh Merge #14115: lint: Make all linters work under the default macOS dev environment (build-osx.md) 2020-07-29 10:59:39 -05:00
lint-shell.sh Merge #14115: lint: Make all linters work under the default macOS dev environment (build-osx.md) 2020-07-29 10:59:39 -05:00
lint-tests.sh Merge #13281: test: Move linters to test/lint, add readme 2020-07-29 10:59:04 -05:00
lint-whitespace.sh Fix warnings introduced in shellcheck v0.6.0 (Partial Merge: #15166) 2020-07-29 11:02:55 -05:00
README.md Merge #13281: test: Move linters to test/lint, add readme 2020-07-29 10:59:04 -05:00

This folder contains lint scripts.

check-doc.py

Check for missing documentation of command line options.

commit-script-check.sh

Verification of scripted diffs.

git-subtree-check.sh

Run this script from the root of the repository to verify that a subtree matches the contents of the commit it claims to have been updated to.

To use, make sure that you have fetched the upstream repository branch in which the subtree is maintained:

Usage: git-subtree-check.sh DIR (COMMIT)

COMMIT may be omitted, in which case HEAD is used.

lint-all.sh

Calls other scripts with the lint- prefix.