Dash - Reinventing Cryptocurrency
Go to file
MarcoFalke 2353920662
Merge #16878: Fix non-deterministic coverage of test DoS_mapOrphans
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
2022-09-03 10:43:14 -05:00
.github chore: switch to conventional commit style for PR titles (#4835) 2022-05-12 23:25:36 +03:00
.tx partial bitcoin#21694: Use XLIFF file to provide more context to Transifex translators 2022-04-26 20:36:54 +05:30
build-aux/m4 merge bitcoin#19558: split pthread flags out of ldflags and dont use when building libconsensus 2022-08-23 21:33:33 +05:30
ci Merge #17849: ci: Fix brew python link 2022-08-30 09:08:17 -05:00
contrib Merge #16878: Fix non-deterministic coverage of test DoS_mapOrphans 2022-09-03 10:43:14 -05:00
depends Merge bitcoin/bitcoin#24093: build: specify hosts for qrencode package 2022-06-27 11:37:04 -05:00
doc trivial: Fix trailing whitespaces in release notes (#4989) 2022-08-29 12:42:29 +03:00
share Merge #20449: build: Fix Windows installer build 2022-04-28 13:47:53 +03:00
src Merge #16878: Fix non-deterministic coverage of test DoS_mapOrphans 2022-09-03 10:43:14 -05:00
test Merge #18069: test: replace 'regtest' leftovers by self.chain 2022-08-30 09:08:17 -05:00
.cirrus.yml Merge #17233: travis: Run unit and functional tests on native arm 2022-05-31 12:06:32 -04:00
.dockerignore build: add dash minimal development environment container 2021-12-21 12:43:37 +05:30
.editorconfig Merge #21123: code style: Add EditorConfig file 2021-07-16 10:04:09 -05:00
.fuzzbuzz.yml Merge #20781: fuzz: remove no-longer-necessary packages from fuzzbuzz config 2021-09-18 21:41:40 -04:00
.gitattributes Separate protocol versioning from clientversion 2014-10-29 00:24:40 -04:00
.gitignore partial revert dash#2911: s/dash-config/bitcoin-config/g 2022-08-09 14:16:28 +05:30
.gitlab-ci.yml ci: reconcile differences between ci setups 2022-07-01 09:04:01 +05:30
.python-version bump .python-version (#4717) 2022-03-23 09:26:24 +03:00
.style.yapf Merge #15533: test: .style.yapf: Set column_limit=160 2021-07-10 12:10:51 -05:00
.travis.yml Merge #17635: ci: Add CentOS 7 build 2022-08-30 09:08:16 -05:00
autogen.sh Merge #17074: build: Added double quotes 2021-12-22 10:15:40 -06:00
CMakeLists.txt build: enhance CMakeLists to dynamically detect kernel version to utilize (#4828) 2022-05-09 14:13:49 +03:00
configure.ac merge bitcoin#19558: split pthread flags out of ldflags and dont use when building libconsensus 2022-08-23 21:33:33 +05:30
CONTRIBUTING.md chore: switch to conventional commit style for PR titles (#4835) 2022-05-12 23:25:36 +03:00
COPYING Bump copyright year to 2020 (#3290) 2020-01-17 15:42:55 +01:00
INSTALL.md Dashify INSTALL.md and build-unix.md 2018-01-12 16:12:54 +01:00
libdashconsensus.pc.in revert dash#1432: Rename consensus source library and API 2022-08-09 14:16:28 +05:30
Makefile.am revert dash#1432: Rename consensus source library and API 2022-08-09 14:16:28 +05:30
README.md chore: bump version in gitian-descriptors and README.md 2022-04-16 07:59:23 -06:00
release-notes-17743.md Merge #17743: doc: Add release note for RPC Whitelist 2022-06-13 14:35:18 +07:00
SECURITY.md Merge bitcoin/bitcoin#23466: doc: Suggest keys.openpgp.org as keyserver in SECURITY.md 2022-04-03 18:46:47 -05:00

Dash Core staging tree 18.0

CI master develop
Gitlab Build Status Build Status

https://www.dash.org

What is Dash?

Dash is an experimental digital currency that enables instant, private payments to anyone, anywhere in the world. Dash uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. Dash Core is the name of the open source software which enables the use of this currency.

Pre-Built Binary

For more information, as well as an immediately usable, binary version of the Dash Core software, see https://www.dash.org/downloads/.

License

Dash Core is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT.

Development Process

The master branch is meant to be stable. Development is normally done in separate branches. Tags are created to indicate new official, stable release versions of Dash Core.

The contribution workflow is described in CONTRIBUTING.md and useful hints for developers can be found in doc/developer-notes.md.

Testing

Testing and code review is the bottleneck for development; we get more pull requests than we can review and test on short notice. Please be patient and help out by testing other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money.

Automated Testing

Developers are strongly encouraged to write unit tests for new code, and to submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: make check. Further details on running and extending unit tests can be found in /src/test/README.md.

There are also regression and integration tests, written in Python, that are run automatically on the build server. These tests can be run (if the test dependencies are installed) with: test/functional/test_runner.py

The Travis CI system makes sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.

Manual Quality Assurance (QA) Testing

Changes should be tested by somebody other than the developer who wrote the code. This is especially important for large or high-risk changes. It is useful to add a test plan to the pull request description if testing the changes is not straightforward.

Translations

Changes to translations as well as new translations can be submitted to Dash Core's Transifex page.

Translations are periodically pulled from Transifex and merged into the git repository. See the translation process for details on how this works.

Important: We do not accept translation changes as GitHub pull requests because the next pull from Transifex would automatically overwrite them again.

Translators should also follow the forum.