forked from PIVX-Project/PIVX
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR #177 conflictions fix #197
Open
wqking
wants to merge
133
commits into
phoreproject:rel-1.9.0
Choose a base branch
from
wqking-misc:upstream-rel-1.9.0-pr177-fix-conflicts
base: rel-1.9.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
PR #177 conflictions fix #197
wqking
wants to merge
133
commits into
phoreproject:rel-1.9.0
from
wqking-misc:upstream-rel-1.9.0-pr177-fix-conflicts
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ight before print it.
This includes some improvements and fixes for the CMake build system. * Use explicit per-target includes instead of global includes for dependencies. * Don't assume the availability of optional dependencies. * Fix Ubuntu build issues relating to endian/byteswap. * Ignore the qt subdir for windows WSL based builds. * Add TravisCI stage to test CMake builds. Windows support is still a work in progress, with the qt subdir being ignored due to an issue with CMake linking against a static Qt library. CMake Builds on TravisCI are allowed to fail for the time being.
Requires VcXsrv for running of resulting builds.
These are available in sandboxes without access to files or devices. Also [they are safer and more straightforward](https://en.wikipedia.org/wiki/Entropy-supplying_system_calls) to use than `/dev/urandom` as reading from a file has quite a few edge cases: - Linux: `getrandom(buf, buflen, 0)`. [getrandom(2)](http://man7.org/linux/man-pages/man2/getrandom.2.html) was introduced in version 3.17 of the Linux kernel. - OpenBSD: `getentropy(buf, buflen)`. The [getentropy(2)](http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/getentropy.2) function appeared in OpenBSD 5.6. - FreeBSD and NetBSD: `sysctl(KERN_ARND)`. Not sure when this was added but it has existed for quite a while. Alternatives: - Linux has sysctl `CTL_KERN` / `KERN_RANDOM` / `RANDOM_UUID` which gives 16 bytes of randomness. This may be available on older kernels, however [sysctl is deprecated on Linux](https://lwn.net/Articles/605392/) and even removed in some distros so we shouldn't use it. Add tests for `GetOSRand()`: - Test that no error happens (otherwise `RandFailure()` which aborts) - Test that all 32 bytes are overwritten (initialize with zeros, try multiple times) Discussion: - When to use these? Currently they are always used when available. Another option would be to use them only when `/dev/urandom` is not available. But this would mean these code paths receive less testing, and I'm not sure there is any reason to prefer `/dev/urandom`. Closes: bitcoin#9676
Move the OS random test to a sanity check function that is called every time bitcoind is initialized. Keep `src/test/random_tests.cpp` for the case that later random tests are added, and keep a rudimentary test that just calls the sanity check.
If the code was compiled with newer (>=3.17) kernel headers but executed on a system without the system call, every use of random would crash the program. Add a fallback for that case.
There are only a few uses of `insecure_random` outside the tests. This PR replaces uses of insecure_random (and its accompanying global state) in the core code with an FastRandomContext that is automatically seeded on creation. This is meant to be used for inner loops. The FastRandomContext can be in the outer scope, or the class itself, then rand32() is used inside the loop. Useful e.g. for pushing addresses in CNode or the fee rounding, or randomization for coin selection. As a context is created per purpose, thus it gets rid of cross-thread unprotected shared usage of a single set of globals, this should also get rid of the potential race conditions. - I'd say TxMempool::check is not called enough to warrant using a special fast random context, this is switched to GetRand() (open for discussion...) - The use of `insecure_rand` in ConnectThroughProxy has been replaced by an atomic integer counter. The only goal here is to have a different credentials pair for each connection to go on a different Tor circuit, it does not need to be random nor unpredictable. - To avoid having a FastRandomContext on every CNode, the context is passed into PushAddress as appropriate. There remains an insecure_random for test usage in `test_random.h`.
FastRandomContext now provides all functionality that the real Rand* functions provide.
Move the two CMake build tests further up in the test order so we don't have to manually restart them due to caching/timeouts.
to check balances in a reorganization of PoS blocks, and verify that the input of an orphan block's coinstake is spendable after.
…mpool check code cleanup in IsTrusted method. Comes from bitcoin b2b3619
- qualify as constants the arguments of CWallet's functions: IsLockedCoin, LockCoin and UnlockCoin. - Diagnose unsuitable outputs in lockunspent (backports bitcoin/bitcoin bitcoin#11087)
… the tip, preventing possible multi-threading shared resource problem. Remove duplicated tip check.
When the build number (CLIENT_VERSION_BUILD) is non-zero, we want to include that in the package version number so the resulting binaries are named with the correct version.
# Conflicts: # src/Makefile.am # src/crypto/common.h # src/main.cpp # src/masternode.cpp # src/miner.cpp # src/primitives/block.h # src/qt/walletview.cpp # src/rpc/masternode-budget.cpp # src/spork.cpp # src/spork.h # src/test/benchmark_zerocoin.cpp # src/version.h # src/wallet/crypter.cpp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.