Bitcoin Core doesn't actually use tags for managing versions of their
forked dependencies, so we should separately rework this logic for all
of the subtree-managed dependencies. But this at least prevents false
positives.
Bitcoin 0.15 locking PRs
These are locking changes from upstream (bitcoin core) release 0.15, oldest to newest (when merged to the master branch).
Each commit also includes a reference both to the PR and the upstream commit.
- bitcoin/bitcoin#9497
(cherry picked from commit 1ad8ea2b73134bdd8d6b50704a019d47ad2191d8)
Zcash: Excluding change to src/test/fuzz/bloom_filter.cpp which we
don't have (we haven't backported upstream's fuzzing framework).
Co-authored-by: MarcoFalke <falke.marco@gmail.com>
(cherry picked from commit 69ffddc83e0f3e265bf6cf7ae31489ae629fe6be)
Zcash: Excluding change to src/test/fuzz/bloom_filter.cpp which we
don't have (we haven't backported upstream's fuzzing framework).
This commit removes the `CBloomFilter::CBloomFilter(const unsigned int, const double, const unsigned int)` constructor, which became obsolete with 086ee67.
(cherry picked from commit 265bd50884ac1984c08f0e5916256d5f12e655f5)
Replaces the slow modulo operation with a much faster 32bit multiplication & shift. This works
because the hash should be uniformly distributed between 0 and 2^32-1. This speeds up the benchmark
by a factor of about 1.3:
RollingBloom, 5, 1500000, 3.73733, 4.97569e-07, 4.99002e-07, 4.98372e-07 # before
RollingBloom, 5, 1500000, 2.86842, 3.81630e-07, 3.83730e-07, 3.82473e-07 # FastMod
Be aware that this changes the position of the bits that are toggled, so this should probably
not be used for CBloomFilter which is serialized.
(cherry picked from commit 9aac9f90d5e56752cc6cbfac48063ad29a01143c)
On msvc14, int literal '-2147483648' is invalid, because '2147483648' is unsigned type and cant't apply minus operator to unsigned type.
To define the int literal correctly, use '-2147483647 - 1' formula that is also used to define INT_MIN in limits.h.
(cherry picked from commit 8e0720bdb9141b00b4c00893b8139904c67ddacf)
On msvc14, the compiler error C4146 (unary minus operator applied to unsigned type, result still unsigned) had been occured.
Use '0 - x' styled formula instead of '-x' so as to fix the error.
(cherry picked from commit 292112f87ef1780fee6164063a60af9ee7bf3f86)
(cherry picked from commit b7b48c8bbdf7a90861610b035d8b0a247ef78c45)
Zcash: Excluding changes to code we haven't backported yet that cause
too many conflicts.
Output instances of "BloomFilter" changed to "Bloom filter", in accordance with Wikipedia standard notation:
https://en.wikipedia.org/wiki/Bloom_filter
also to sync with the majority of cases in the self-same file
(cherry picked from commit b7aa2902fd3c29487f585c264d8845899f4c1846)
Fixes newly initialized bloom filters being
constructed with isEmpty(false), which still
works but loses the possible speedup when
checking for key membership in an empty filter.
(cherry picked from commit cccf73db0483cc3945bf8389ce197df35e931e16)
This patch changes the implementation from one that stores 16 2-bit integers
in one uint32_t's, to one that stores the first bit of 64 2-bit integers in
one uint64_t and the second bit in another. This allows for 450x faster
refreshing and 2.2x faster average speed.
(cherry picked from commit 1953c40aa9589a03035fd294f3ba3549374a4826)
For each 'bit' in the filter we really maintain 2 bits, which store either:
0: not set
1-3: set in generation N
After (nElements / 2) insertions, we switch to a new generation, and wipe
entries which already had the new generation number, effectively switching
from the last 1.5 * nElements set to the last 1.0 * nElements set.
This is 25% more space efficient than the previous implementation, and can
(at peak) store 1.5 times the requested amount of history (though only
1.0 times the requested history is guaranteed).
The existing unit tests should be sufficient.
(cherry picked from commit 086ee67d839b33bf475177f680fcc848a0625266)
Bitcoin 0.14 locking PRs
These are locking changes from upstream (bitcoin core) release 0.14, oldest to newest (when merged to the master branch).
Each commit also includes a reference both to the PR and the upstream commit.
- bitcoin/bitcoin#8472
- bitcoin/bitcoin#8606
- Excludes a lock move because we don't have bitcoin/bitcoin#7840 which this move was partially-reverting.
- bitcoin/bitcoin#9230
- Only first commit (we don't have `LogTimestampStr` anymore).
- bitcoin/bitcoin#9243
- Only the sixth commit, excluding `IsArgSet` locking (we haven't pulled that function in yet).
- bitcoin/bitcoin#9626
- The cherry-picked commit does not match the upstream at all, but the resulting lock is useful.
- bitcoin/bitcoin#9679
- bitcoin/bitcoin#9227
- bitcoin/bitcoin#9698
- Excludes change to `CConnman::PushMessage` in second commit (which we don't have yet).
- bitcoin/bitcoin#9708
- bitcoin/bitcoin#9771
A new AssertLockHeld(cs_wallet) call was added in commit a58370e
"Dedup nTimeFirstKey update logic" (part of PR #9108).
The lock held assertion will fail when loading prexisting wallets files from
before the #9108 merge that have watch-only keys.
zcash: cherry picked from commit 07afcd6379bb46ace5856f6a47a9188cf9aed2ea
zcash: https://github.com/bitcoin/bitcoin/pull/9771
These are (afaik) all long-standing races or concurrent accesses. Going
forward, we can clean these up so that they're not all individual atomic
accesses.
- Reintroduce cs_vRecv to guard receive-specific vars
- Lock vRecv/vSend for CNodeStats
- Make some vars atomic.
- Only set the connection time in CNode's constructor so that it doesn't change
zcash: cherry picked from commit 321d0fc6b6624c65508f8b9059418cb936f0bbbe
zcash: https://github.com/bitcoin/bitcoin/pull/9708
This removes a "race" between Interrupt() and Run(), though it
should not effect any of our supported platforms.
zcash: cherry picked from commit 7b2d96b634f9fd283480caf3bece56138d0587e3
zcash: https://github.com/bitcoin/bitcoin/pull/9679
This makes sure that cs_filter is never held while taking cs_main
or CNode::cs_vSend.
zcash: cherry picked from commit 144ed76ea0b38b7c21b224501964f8a2c65c4bb6
zcash: https://github.com/bitcoin/bitcoin/pull/8606
Delete spare mainnet Founders' Reward addresses that will never be used
These addresses were originally intended as fallbacks if an FR address was compromised.
There is no need to retain them in the code given that the FR has ended.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>