Commit graph

42190 commits

Author SHA1 Message Date
Ava Chow
6a68ef9bfb build: bump to 28.1 2025-01-02 20:53:02 +01:00
Hennadii Stepanov
5b368f88a9 depends: Fix CXXFLAGS on NetBSD
This change corrects an issue where CXXFLAGS were mistakenly overridden
by CFLAGS.

Github-Pull: 31502
Rebased-From: a10bb400e8
2025-01-02 14:18:28 +01:00
MarcoFalke
05cd448e33 test: generateblocks called by multiple threads
Co-Authored-By: David Gumberg <davidzgumberg@gmail.com>

Github-Pull: 31563
Rebased-From: fa63b8232f
2025-01-02 14:17:02 +01:00
MarcoFalke
621c634b7f rpc: Extend scope of validation mutex in generateblock
The mutex (required by TestBlockValidity) must be held after creating
the block, until TestBlockValidity is called. Otherwise, it is possible
that the chain advances in the meantime and leads to a crash in
TestBlockValidity:

 Assertion failed: pindexPrev && pindexPrev == chainstate.m_chain.Tip() (validation.cpp: TestBlockValidity: 4338)

The diff can be reviewed with the git options
--ignore-all-space --function-context

Github-Pull: 31563
Rebased-From: fa62c8b1f0
2025-01-02 14:16:50 +01:00
Ava Chow
6db725662d
Merge bitcoin/bitcoin#31469: [28.x] 28.1rc2 backports
Some checks failed
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Has been cancelled
CI / test each commit (push) Has been cancelled
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Has been cancelled
CI / Win64 native, VS 2022 (push) Has been cancelled
5576618152 doc: update release notes for 28.1rc2 (Ava Chow)
01fe07a2ce examples: Generate example bitcoin.conf (Ava Chow)
7ddfcf32da doc: Generate manpages (Ava Chow)
e0b27b234c build: Bump to 28.1rc2 (Ava Chow)
bdc6b3e531 Add release note for #31223 (Martin Zumsande)
a0585b6087 test: add functional test for -port behavior (Martin Zumsande)
bbde830b97 net, init: derive default onion port if a user specified a -port (Martin Zumsande)
227642d5af test: fix MIN macro-redefinition (0xb10c)
b8112cf422 util: use explicit cast in MultiIntBitSet::Fill() (Vasil Dimov)
2835158be0 fuzz: add cstdlib to FuzzedDataProvider (fanquake)

Pull request description:

  Backports:

  * #31223
  * #31448
  * #31431
  * #31419

ACKs for top commit:
  hodlinator:
    re-ACK 5576618152

Tree-SHA512: f99f3c5960f18f6894832c5f9a827f97fd3c6e086670341760ce1b77c304d53136492371c59148f3b4bbcfe2d5428c835fe632c61b229b40f1f6f6cf2b72cdca
2024-12-17 13:06:08 -05:00
Ava Chow
5576618152 doc: update release notes for 28.1rc2 2024-12-13 21:27:57 -05:00
Ava Chow
01fe07a2ce examples: Generate example bitcoin.conf 2024-12-13 21:20:23 -05:00
Ava Chow
7ddfcf32da doc: Generate manpages 2024-12-13 21:19:41 -05:00
Ava Chow
e0b27b234c build: Bump to 28.1rc2 2024-12-13 21:16:24 -05:00
Martin Zumsande
bdc6b3e531
Add release note for #31223
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>

Github-Pull: bitcoin/bitcoin#31223
Rebased-From: 1dd3af8fbc
2024-12-13 21:15:29 -05:00
Martin Zumsande
a0585b6087
test: add functional test for -port behavior
Github-Pull: bitcoin/bitcoin#31223
Rebased-From: 997757dd2b
2024-12-13 21:15:26 -05:00
Martin Zumsande
bbde830b97
net, init: derive default onion port if a user specified a -port
After port collisions are no longer tolerated but lead to
a startup failure in v28.0, local setups of multiple nodes,
each with a different -port value would not be possible anymore
due to collision of the onion default port - even if the nodes
were using tor or not interested in receiving onion inbound connections.

Fix this by deriving the onion listening port to be -port + 1.
(idea by vasild / laanwj)

Co-authored-by: Vasil Dimov <vd@FreeBSD.org>

Github-Pull: bitcoin/bitcoin#31223
Rebased-From: 0e2b12b92a
2024-12-13 21:15:23 -05:00
0xb10c
227642d5af
test: fix MIN macro-redefinition
Renames the `MIN` macro to `_TRACEPOINT_TEST_MIN`.

From #31418:

```
stderr:
/virtual/main.c:70:9: warning: 'MIN' macro redefined [-Wmacro-redefined]
   70 | #define MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
      |         ^
include/linux/minmax.h:329:9: note: previous definition is here
  329 | #define MIN(a,b) __cmp(min,a,b)
      |         ^
1 warning generated.
```

fixes: https://github.com/bitcoin/bitcoin/issues/31418

Github-Pull: bitcoin/bitcoin#31419
Rebased-From: 00c1dbd26d
2024-12-11 11:41:49 -05:00
Vasil Dimov
b8112cf422
util: use explicit cast in MultiIntBitSet::Fill()
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
2024-12-11 11:41:39 -05:00
fanquake
2835158be0
fuzz: add cstdlib to FuzzedDataProvider
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
2024-12-11 11:41:27 -05:00
merge-script
d6b225f165
Merge bitcoin/bitcoin#31104: [28.x] Backports & 28.1rc1
Some checks failed
CI / test each commit (push) Has been cancelled
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Has been cancelled
CI / Win64 native, VS 2022 (push) Has been cancelled
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Has been cancelled
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
2024-12-04 13:36:28 +00:00
fanquake
8fef83a0a0
doc: update manual pages for 28.1rc1 2024-12-02 14:20:15 +00:00
fanquake
df7764621e
build: bump version to 28.1rc1 2024-12-02 14:20:15 +00:00
fanquake
9add853b65
doc: update release notes for 28.1rc1 2024-12-02 14:20:15 +00:00
fanquake
1025090fbe
build: disable compiling fuzz/utxo_snapshot.cpp with MSVC
This is a backport of #31307 / b2d5361002
for 28.x.
2024-12-02 14:20:15 +00:00
MarcoFalke
446f5d20d6
refactor: Drop deprecated space in operator""_mst
Github-Pull: #31267
Rebased-From: faf2162565
2024-12-02 14:20:14 +00:00
Martin Zumsande
9976162a0e
addrman: change nid_type from int to int64_t
With nId being incremented for each addr received,
an attacker could cause an overflow in the past.
(https://bitcoincore.org/en/2024/07/31/disclose-addrman-int-overflow/)
Even though that attack was made infeasible by
rate-limiting (PR #22387), to be on the safe side change the
type to an int64_t.

Github-Pull: #30568
Rebased-From: 51f7668d31
2024-12-02 14:19:59 +00:00
Martin Zumsande
1d0411dc8f
addrman, refactor: introduce user-defined type for internal nId
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
2024-11-04 16:27:06 +00:00
laanwj
7fec638222
depends: For mingw cross compile use -gcc-posix to prevent library conflict
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
2024-10-31 15:07:51 +00:00
Sebastian Falbesoner
f998ac6286
key: clear out secret data in DecodeExtKey
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
2024-10-31 14:48:56 +00:00
fanquake
0773560abf
ci: add LLVM_SYMBOLIZER_PATH to Valgrind fuzz job
Otherwise:
```bash
	NEW_FUNC[1/23]: ==4710==WARNING: invalid path to external symbolizer!
==4710==WARNING: Failed to use and restart external symbolizer!
0xb72010  (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0xa6a010) (BuildId: 2087ad415cb752eea259ed750f3b78a7fcb0b43b)
	NEW_FUNC[2/23]: 0xb72240  (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0xa6a240) (BuildId: 2087ad415cb752eea259ed750f3b78a7fcb0b43b)

```

Github-Pull: #30961
Rebased-From: c1832584bf
2024-10-22 16:06:06 +01:00
Martin Zumsande
b917334208
test: add missing sync to feature_fee_estimation.py
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
2024-10-22 16:04:14 +01:00
Marnix
f072721181
doc: add testnet4 section header for config file
Github-Pull: #31007
Rebased-From: 61cdb1c9d8
2024-10-22 16:04:04 +01:00
Ava Chow
6643fd2145
doc: Archive 28.0 release notes
Github-Pull: #31035
Rebased-From: f019fcec41
2024-10-16 16:25:33 +01:00
Ava Chow
89522379d1
Merge bitcoin/bitcoin#31034: [28.x] doc: Sync 28.0 release notes with website
Some checks failed
CI / test each commit (push) Has been cancelled
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Has been cancelled
CI / Win64 native, VS 2022 (push) Has been cancelled
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Has been cancelled
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
2024-10-05 11:17:41 -04:00
Ava Chow
89d34cffed doc: Sync 28.0 release notes with website 2024-10-04 19:25:24 -04:00
Ava Chow
1101837461
Merge bitcoin/bitcoin#30959: [28.x] backports and finalize
Some checks failed
CI / test each commit (push) Has been cancelled
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Has been cancelled
CI / Win64 native, VS 2022 (push) Has been cancelled
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Has been cancelled
5de225f5c1 doc: 28.0 Release Notes (Ava Chow)
98745e03ff doc: generate manpages (Ava Chow)
5feef9ce7e build: Bump to 28.0 (Ava Chow)
7fcd7b85c6 validation: Disable CheckForkWarningConditions for background chainstate (Martin Zumsande)
e24a25d882 test: Use shell builtins in run_command test case (Ava Chow)

Pull request description:

  * #30952
  * #30962
  * Finalize 28.0 (or rc3 if additional backports are needed)

ACKs for top commit:
  sipa:
    utACK 5de225f5c1

Tree-SHA512: b42948a04d4250f2c9ef3331a39a4c3d7de9ceb9f4f294dd283599d08f3e2b7147297ef9ec1c4276e291a015fc2daa5a72c1f1c33fb517e8ea5c740c4459bf32
2024-10-01 13:30:02 -04:00
Ava Chow
5de225f5c1 doc: 28.0 Release Notes 2024-09-30 17:13:20 -04:00
Ava Chow
98745e03ff
doc: generate manpages 2024-09-25 14:34:31 -04:00
Ava Chow
5feef9ce7e
build: Bump to 28.0 2024-09-25 14:34:29 -04:00
Martin Zumsande
7fcd7b85c6
validation: Disable CheckForkWarningConditions for background chainstate
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
2024-09-25 14:34:26 -04:00
Ava Chow
e24a25d882
test: Use shell builtins in run_command test case
Github-Pull: bitcoin/bitcoin#30952
Rebased-From: 7bd3ee62f6
2024-09-24 11:40:27 -04:00
merge-script
1147e72953
Merge bitcoin/bitcoin#30827: [28.x] Further backports and rc2
Some checks failed
CI / test each commit (push) Has been cancelled
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Has been cancelled
CI / Win64 native, VS 2022 (push) Has been cancelled
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Has been cancelled
06a7df70df doc: Generate manpages (Ava Chow)
5315886bf5 build: Bump to 28.0rc2 (Ava Chow)
ff95cb31da streams: remove AutoFile::Get() entirely (Pieter Wuille)
8229e98116 streams: cache file position within AutoFile (Pieter Wuille)
1b853fdb0a qt: Translations update (Hennadii Stepanov)
674dded875 gui: fix crash when closing wallet (furszy)
d39262e5d4 test: Wait for local services to update in feature_assumeutxo (Fabian Jahr)
b329ed739b test: add coverage for assumeUTXO honest peers disconnection (furszy)
c6b5db1d59 assumeUTXO: fix peers disconnection during sync (furszy)
598415bcc1 test: Work around boost compilation error (MarcoFalke)

Pull request description:

  * #30834
  * #30807
  * #30880
  * https://github.com/bitcoin-core/gui/pull/835
  * #30899
  * #30884

ACKs for top commit:
  stickies-v:
    ACK 06a7df70df
  hebasto:
    ACK 06a7df70df, I've backported the listed PRs locally. The only merge conflict I faced was in https://github.com/bitcoin/bitcoin/pull/30807. It was trivial to resolve.

Tree-SHA512: 779d734b50fdce379a20865ba30c969def028963ba51da0f497ddf1b5375e1f6166365295f226c1a07bab8be0c1aa0a6a3296fc6acd9fcf17bcc4874aac980a6
2024-09-17 17:14:28 +01:00
Ava Chow
06a7df70df
doc: Generate manpages 2024-09-16 23:10:20 -04:00
Ava Chow
5315886bf5
build: Bump to 28.0rc2 2024-09-16 23:10:18 -04:00
Pieter Wuille
ff95cb31da
streams: remove AutoFile::Get() entirely
Co-Authored-By: David Gumberg <davidzgumberg@gmail.com>

Github-Pull: bitcoin/bitcoin#30884
Rebased-From: a240e150e8
2024-09-16 23:10:17 -04:00
Pieter Wuille
8229e98116
streams: cache file position within AutoFile
Github-Pull: bitcoin/bitcoin#30884
Rebased-From: e624a9bef1
2024-09-16 23:10:14 -04:00
Hennadii Stepanov
1b853fdb0a
qt: Translations update
The recent translations from Transifex.com 28.x fetched with the
bitcoin-maintainer-tools/update-translations.py tool.

Github-Pull: bitcoin/bitcoin#30899
Rebased-From: ae05295761
2024-09-16 11:57:21 -04:00
furszy
674dded875
gui: fix crash when closing wallet
The crash occurs because 'WalletController::removeAndDeleteWallet' is called
twice for the same wallet model: first in the GUI's button connected function
'WalletController::closeWallet', and then again when the backend emits the
'WalletModel::unload' signal.

This causes the issue because 'removeAndDeleteWallet' inlines an
erase(std::remove()). So, if 'std::remove' returns an iterator to the end
(indicating the element wasn't found because it was already erased), the
subsequent call to 'erase' leads to an undefined behavior.

Github-Pull: bitcoin-core/gui#835
Rebased-From: a965f2bc07
2024-09-13 11:32:55 -04:00
Fabian Jahr
d39262e5d4
test: Wait for local services to update in feature_assumeutxo
Github-Pull: bitcoin/bitcoin#30880
Rebased-From: 19f4a7c95a
2024-09-12 15:02:05 -04:00
furszy
b329ed739b
test: add coverage for assumeUTXO honest peers disconnection
Exercising and verifying the following points:

1. An IBD node can sync headers from an AssumeUTXO node at
   any time.

2. IBD nodes do not request historical blocks from AssumeUTXO
   nodes while they are syncing the background-chain.

3. The assumeUTXO node dynamically adjusts the network services
   it offers according to its state.

4. IBD nodes can fully sync from AssumeUTXO nodes after they
   finish the background-chain sync.

Github-Pull: bitcoin/bitcoin#30807
Rebased-From: 992f83bb6f
2024-09-11 13:42:54 -04:00
furszy
c6b5db1d59
assumeUTXO: fix peers disconnection during sync
Because AssumeUTXO nodes prioritize tip synchronization, they relay their local
address through the network before completing the background chain sync.
This, combined with the advertising of full-node service (NODE_NETWORK), can
result in an honest peer in IBD connecting to the AssumeUTXO node (while syncing)
and requesting an historical block the node does not have. This behavior leads to
an abrupt disconnection due to perceived unresponsiveness (lack of response)
from the AssumeUTXO node.

This lack of response occurs because nodes ignore getdata requests when they do
not have the block data available (further discussion can be found in PR 30385).

Fix this by refraining from signaling full-node service support while the
background chain is being synced. During this period, the node will only
signal 'NODE_NETWORK_LIMITED' support. Then, full-node ('NODE_NETWORK')
support will be re-enabled once the background chain sync is completed.

Github-Pull: bitcoin/bitcoin#30807
Rebased-From: 6d5812e5c8
2024-09-11 13:42:51 -04:00
MarcoFalke
598415bcc1
test: Work around boost compilation error
Github-Pull: bitcoin/bitcoin#30834
Rebased-From: fa9d7d5d20
2024-09-06 11:31:19 -04:00
Ava Chow
fa46088440
Merge bitcoin/bitcoin#30762: [28.x] rc backports
Some checks failed
CI / test each commit (push) Has been cancelled
CI / macOS 13 native, x86_64, no depends, sqlite only, gui (push) Has been cancelled
CI / Win64 native, VS 2022 (push) Has been cancelled
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Has been cancelled
b2a137929a depends: build libevent with -D_GNU_SOURCE (fanquake)
199bb09d88 test: fixing failing system_tests/run_command under some Locales (Jadi)
342baabaff test: Avoid intermittent timeout in p2p_headers_sync_with_minchainwork.py (MarcoFalke)
5577d5a3c0 test: fix `TestShell` initialization (late follow-up for #30463) (Sebastian Falbesoner)

Pull request description:

  Backports:
  * https://github.com/bitcoin/bitcoin/pull/30714
  * https://github.com/bitcoin/bitcoin/pull/30743
  * https://github.com/bitcoin/bitcoin/pull/30761
  * https://github.com/bitcoin/bitcoin/pull/30788

ACKs for top commit:
  willcl-ark:
    ACK b2a137929a
  achow101:
    ACK b2a137929a
  stickies-v:
    ACK b2a137929a

Tree-SHA512: bf08ac0c613395def974a1b287345d4a64edc066c14f8c9f0184478b0e33e48333760eeb6e96b6b5fbafbb21b40d01875e3f526213a2734e226b2e111d71f3a3
2024-09-05 18:29:25 -04:00
fanquake
b2a137929a
depends: build libevent with -D_GNU_SOURCE
Currently, builds of libevent in depends, using CMake, fail on some
systems, like Alpine, with the following:
```bash
/bitcoin/depends/work/build/aarch64-unknown-linux-musl/libevent/2.1.12-stable-1516ed47ea8/evmap.c: In function 'evmap_signal_add_':
/bitcoin/depends/work/build/aarch64-unknown-linux-musl/libevent/2.1.12-stable-1516ed47ea8/evmap.c:456:31: error: 'NSIG' undeclared (first use in this function)
  456 |         if (sig < 0 || sig >= NSIG)
```

From what I can tell the `_GNU_SOURCE` "detection" in libevents CMake build
system, never? really worked, and it's not clear what a nice fix is.

For now, always use `_GNU_SOURCE` when building libevent in depends.

Github-Pull: #30743
Rebased-From: 5567754087
2024-09-05 10:37:40 +01:00