ce8094246erandom: replace construct/assign with explicit Reseed() (Pieter Wuille)2ae392d561random: use LogError for init failure (Pieter Wuille)97e16f5704tests: make fuzz tests (mostly) deterministic with fixed seed (Pieter Wuille)2c91330dd6random: cleanup order, comments, static (Pieter Wuille)8e31cf9c9bnet, net_processing: use existing RNG objects more (Pieter Wuille)d5fcbe966brandom: improve precision of MakeExponentiallyDistributed (Pieter Wuille)cfb0dfe2cfrandom: convert GetExponentialRand into rand_exp_duration (Pieter Wuille)4eaa239dc3random: convert GetRand{Micros,Millis} into randrange (Pieter Wuille)82de1b80d9net: use GetRandMicros for cache expiration (Pieter Wuille)ddc184d999random: get rid of GetRand by inlining (Pieter Wuille)e2d1f84858random: make GetRand() support entire range (incl. max) (Pieter Wuille)810cdf6b4etests: overhaul deterministic test randomness (Pieter Wuille)6cfdc5b104random: convert XoRoShiRo128PlusPlus into full RNG (Pieter Wuille)8cc2f45065random: move XoRoShiRo128PlusPlus into random module (Pieter Wuille)8f5ac0d0b6xoroshiro128plusplus: drop comment about nonexisting copy() (Pieter Wuille)8924f5120frandom: modernize XoRoShiRo128PlusPlus a bit (Pieter Wuille)ddb7d26cfdrandom: add RandomMixin::randbits with compile-known bits (Pieter Wuille)21ce9d8658random: Improve RandomMixin::randbits (Pieter Wuille)9b14d3d2darandom: refactor: move rand* utilities to RandomMixin (Pieter Wuille)40dd86fc3brandom: use BasicByte concept in randbytes (Pieter Wuille)27cefc7fd6random: add a few noexcepts to FastRandomContext (Pieter Wuille)b3b382dde2random: move rand256() and randbytes() to .h file (Pieter Wuille)493a2e024erandom: write rand256() in function of fillrand() (Pieter Wuille) Pull request description: This PR contains a number of vaguely-related improvements to the random module. The specific changes and more detailed rationale is in the commit messages, but the highlights are: * `XoRoShiRo128PlusPlus` (previously a test-only RNG) moves to random.h and becomes `InsecureRandomContext`, which is even faster than `FastRandomContext` but non-cryptographic. It also gets all helper randomness functions (`randrange`, `fillrand`, ...), making it a lot more succinct to use. * During tests, **all** randomness is made deterministic (except for `GetStrongRandBytes`) but non-repeating (like `GetRand()` used to be when `g_mock_deterministic_tests` was used), either fixed, or from a random seed (overridden by env var). * Several infrequently used top-level functions (`GetRandMillis`, `GetRandMicros`, `GetExponentialRand`) are converted into member functions of `FastRandomContext` (and `InsecureRandomContext`). * `GetRand<T>()` (without argument) can now return the maximum value of the type (previously e.g. `GetRand<uint32_t>()` would never return 0xffffffff). ACKs for top commit: achow101: ACKce8094246emaflcko: re-ACKce8094246e🐈 hodlinator: ACKce8094246edergoegge: utACKce8094246eTree-SHA512: 79bc0cbafaf27e95012c1ce2947a8ca6f9a3c78af5f1f16e69354b6fc9b987a28858adf4cd356dc5baf21163e9af8dcc24e70f8d7173be870e8a3ddcdd47c02c
Bitcoin Core integration/staging tree
For an immediately usable, binary version of the Bitcoin Core software, see https://bitcoincore.org/en/download/.
What is Bitcoin Core?
Bitcoin Core connects to the Bitcoin peer-to-peer network to download and fully validate blocks and transactions. It also includes a wallet and graphical user interface, which can be optionally built.
Further information about Bitcoin Core is available in the doc folder.
License
Bitcoin 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 regularly built (see doc/build-*.md for instructions) and tested, but it is not guaranteed to be
completely stable. Tags are created
regularly from release branches to indicate new official, stable release versions of Bitcoin Core.
The https://github.com/bitcoin-core/gui repository is used exclusively for the development of the GUI. Its master branch is identical in all monotree repositories. Release branches and tags do not exist, so please do not fork that repository unless it is for development reasons.
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.
These tests can be run (if the test dependencies are installed) with: test/functional/test_runner.py
The CI (Continuous Integration) systems make 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 Bitcoin 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.