2353920662
4455949d6f0218b40d33d7fe6de6555f8f62192f Make test DoS_mapOrphans deterministic (David Reikher) Pull request description: This pull request proposes a solution to make the test `DoS_mapOrphans` in denialofservice_tests.cpp have deterministic coverage. The `RandomOrphan` function in denialofservice_tests.cpp and the implicitly called function `ecdsa_signature_parse_der_lax` in pubkey.cpp were causing the non-deterministic test coverage. In the former, if a random orphan was selected the index of which is bigger than the max. orphan index in `mapOrphanTransactions`, the last orphan was returned from `RandomOrphan`. If the random number generated was never large enough, this condition would not be fulfilled and the corresponding branch wouldn't run. The proposed solution is to force one of the 50 dependant orphans to depend on the last orphan in `mapOrphanTransactions` using the newly introduced function `OrphanByIndex` (and passing it a large uint256), forcing this branch to run at least once. In the latter, if values for ECDSA `R` or `S` (or both) had no leading zeros, some code would not be executed. The solution was to find a constant signature that would be comprised of `R` and `S` values with leading zeros and calling `CPubKey::Verify` at the end of the test with this signature forcing this code to always run at least once at the end even if it hadn't throughout the test. To test that the coverage is (at least highly likely) deterministic, I ran `contrib/devtools/test_deterministic_coverage.sh denialofservice_tests/DoS_mapOrphans 1000` and the result was deterministic coverage across 1000 runs. Also - removed denialofservice_tests test entry from the list of non-deterministic tests in the coverage script. ACKs for top commit: MarcoFalke: ACK 4455949d6f0218b40d33d7fe6de6555f8f62192f Tree-SHA512: 987eb1f94b80d5bec4d4944e91ef43b9b8603055750362d4b4665b7f011be27045808aa9f4c6ccf8ae009b61405f9a1b8671d65a843c3328e5b8acce1f1c00a6 |
||
---|---|---|
.. | ||
auto_gdb | ||
containers | ||
debian | ||
devtools | ||
gitian-descriptors | ||
gitian-keys | ||
init | ||
linearize | ||
macdeploy | ||
qos | ||
seeds | ||
testgen | ||
verify-commits | ||
verifybinaries | ||
windeploy | ||
zmq | ||
dash-cli.bash-completion | ||
dash-qt.pro | ||
dash-tx.bash-completion | ||
dashd.bash-completion | ||
filter-lcov.py | ||
gitian-build.py | ||
README.md | ||
valgrind.supp |
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.
Gitian-descriptors
Notes on getting Gitian builds up and running using KVM.
Gitian-keys
PGP keys used for signing Dash Core Gitian release results.
MacDeploy
Scripts and notes for Mac builds.
Gitian-build
Script for running full Gitian 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.