The current code does not have a bug, but is implicitly casting -1 to
65535 and the sanitizer has no way to know whether we intend that or
not.
```
FUZZ=bitset src/test/fuzz/fuzz /tmp/fuz
error: implicit conversion from type 'int' of value -1 (32-bit, signed)
to type 'value_type' (aka 'unsigned short') changed the value to 65535
(16-bit, unsigned)
Base64: Qv7bX/8=
```
Github-Pull: bitcoin/bitcoin#31431
Rebased-From: edb41e4814
Same as https://github.com/llvm/llvm-project/pull/113951.
Avoids compile failures under clang-20 &
`D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES`:
```bash
In file included from /bitcoin/src/test/fuzz/addition_overflow.cpp:5:
/bitcoin/src/test/fuzz/FuzzedDataProvider.h:209:5: error: use of undeclared identifier 'abort'
209 | abort();
| ^
/bitcoin/src/test/fuzz/FuzzedDataProvider.h:250:5: error: use of undeclared identifier 'abort'
250 | abort();
```
Github-Pull: bitcoin/bitcoin#31448
Rebased-From: bb7e686341
In the presence of smaller transactions on the network, blocks can sustain a
higher relay rate than 7tx/second. In this event, the per-peer inventory queues
can grow too large.
This commit bumps the rate up to 14 tx/s (for inbound peers), increasing the
safety margin by a factor of 2.
Outbound peers continue to receive relayed transactions at 2.5x the rate of
inbound peers, for a rate of 35tx/second.
Co-Authored-By: Suhas Daftuar <sdaftuar@gmail.com>
Github-Pull: #28592
Rebased-From: b81f37031c8f2ccad9346f1b65ee0f8083c44796
8fef83a0a0 doc: update manual pages for 28.1rc1 (fanquake)
df7764621e build: bump version to 28.1rc1 (fanquake)
9add853b65 doc: update release notes for 28.1rc1 (fanquake)
1025090fbe build: disable compiling fuzz/utxo_snapshot.cpp with MSVC (fanquake)
446f5d20d6 refactor: Drop deprecated space in operator""_mst (MarcoFalke)
9976162a0e addrman: change nid_type from int to int64_t (Martin Zumsande)
1d0411dc8f addrman, refactor: introduce user-defined type for internal nId (Martin Zumsande)
7fec638222 depends: For mingw cross compile use -gcc-posix to prevent library conflict (laanwj)
f998ac6286 key: clear out secret data in `DecodeExtKey` (Sebastian Falbesoner)
0773560abf ci: add LLVM_SYMBOLIZER_PATH to Valgrind fuzz job (fanquake)
b917334208 test: add missing sync to feature_fee_estimation.py (Martin Zumsande)
f072721181 doc: add testnet4 section header for config file (Marnix)
6643fd2145 doc: Archive 28.0 release notes (Ava Chow)
Pull request description:
Backports:
* #30568
* #31007
* #31013
* #31016
* #31035
* #31166
Contains:
* A commit to do the same as #31307.
ACKs for top commit:
willcl-ark:
ACK 8fef83a0a0
Tree-SHA512: 58f0c6cb9e5b7ac17ad20141acdc5423dbe8e79cc3a2cf1c4e503d289b75940632c9838c64e3ac733b1a55e65723fc1071ccdd9a860a710256cc88e29f42ccdb
- Reserving space avoid reallocation, this provide noticeable
performance increase in verbosity level 1, 2.
Github-Pull: #31179
Rebased-From: 28e3392d11355b1160dc1a7a5557081728a02840
- Ensured that the proxy IP is displayed correctly in the UI when using an IPv6 address.
No functionality impact; changes only affect UI display.
Github-Pull: gui#836
Rebased-From: fee4cba484
This primarily affects blocks when bitcoin is launched with -reindex, as
that causes the block files to be loaded as CBufferedFile objects one at
a time as the reindex progresses.
Co-Authored-By: Luke Dashjr <luke-jr+git@utopios.org>
Github-Pull: #14485
Rebased-From: 289e88b3133107f8a54184d8316559c7cf8ddb12
RegQueryValueExA(HKEY_PERFORMANCE_DATA, ...) sometimes hangs bitcoind.exe on Windows during startup, at least on CI.
We have other sources of entropy to seed randomness with on Windows, so should be alright removing this. Might resurrect if less drastic fix is found.
Github-Pull: #31124
Based-on: 9bb92c0e7f
The chainstate caches are currently re-balanced on startup
even in the non-assumeutxo case, leading to the database being
needlessly re-opened and its cache re-allocated.
Similar to `InitCoinsCache` and `m_coinstip_cache_size_bytes` the
`m_coinsdb_cache_size_bytes` should be set in `InitCoinsDB`.
Together with only conservatively setting the cache values when a
assumeutxo chainstate is present, this allows for skipping the cache
re-balance during initialization in the normal non-assumeutxo case.
Github-Pull: #31064
Rebased-From: 3a4a788ee0
In the context of an a descriptor import during assumeutxo background sync, the progress can not be estimated due to m_chain_tx_count being set to 0.
Github-Pull: #30909
Rebased-From: 8e1efa10df1d9edbe766cbdbdfcd7e262b4f2464 (diff-minimised)
There is no way to report a close error from `AutoFile` destructor.
Such an error could be serious if the file has been written to because
it may mean the file is now corrupted (same as if write fails).
So, change all users of `AutoFile` that use it to write data to
explicitly close the file and handle a possible error.
Github-Pull: #29307
Rebased-From: dba783538683cfc6af209c640c2d019648493f31
This makes it easier to track which spots refer to an nId
(as opposed to, for example, bucket index etc. which also use int)
Co-authored-by: Pieter Wuille <pieter@wuille.net>
Github-Pull: #30568
Rebased-From: 051ba3290e
CMake parses some paths from the spec of the C compiler, assuming it
will be the linker, resulting in the link to end up with
`-L/usr/lib/gcc/x86_64-w64-mingw32/12-win32` on debian bookworm if both
-win32 and -posix variants are installed, and -win32 is the default
alternative.
This results in the wrong C++ library being linked, missing
std::threads::hardware_concurrency and other threading functions.
To fix this, use the -posix variant of gcc as well when available. This
fixes a regression compared to autotools, where this scenario worked.
Github-Pull: #31013
Rebased-From: ae56b3230b
Same as in `DecodeSecret`, we should also clear out the secret data from
the vector resulting from the Base58Check parsing for xprv keys. Note
that the if condition is needed in order to avoid UB, see #14242 (commit
d855e4cac8).
Github-Pull: #31166
Rebased-From: 559a8dd9c0
Fixes a race between node 1 catching up with the chain and mining a
new block in the sanity_check_rbf_estimates subtest.
Github-Pull: #31016
Rebased-From: a1576edab3
89d34cffed doc: Sync 28.0 release notes with website (Ava Chow)
Pull request description:
Since there were some changes to the release notes after the tagging, update the in branch release notes to match those that ended up on the website.
ACKs for top commit:
tdb3:
ACK 89d34cffed
Tree-SHA512: 1feeafb0f604d36c1817e8bf38cbaef5d41f958dd823c99a19a1a9f7f1f1d38f917872c84b536dd784d7a672904ed2399369693f200a2837cd5707a686d3e634
The comparison of m_best_invalid with the tip of the respective chainstate
makes no sense for the background chainstate, and can lead to incorrect
error messages.
Github-Pull: bitcoin/bitcoin#30962
Rebased-From: c0a0c72b4d