Commit graph

44022 commits

Author SHA1 Message Date
Fabian Jahr
37346489b3
CI: Use without embedded asmap build option in one ci job 2025-03-03 18:56:59 +01:00
Fabian Jahr
eab0331957
refactor: Add AutoFile::size 2025-03-03 18:09:54 +01:00
Fabian Jahr
514d06fc24
doc: Expand documentation on asmap feature and tooling 2025-03-03 18:09:54 +01:00
Fabian Jahr
8dd781c0f9
init, net: Implement usage of binary-embedded asmap data 2025-03-03 18:09:53 +01:00
Fabian Jahr
780533e4f3
common: Use fallback in GetPathArg if the path is 1
Otherwise -asmap=1, for example, would be interpreted as a path "1".
2025-03-03 18:07:19 +01:00
Fabian Jahr
877a62e76a
build: Generate ip_asn.dat.h during build process
This can be disabled with -DWITH_EMBEDDED_ASMAP=OFF.
2025-03-03 18:07:19 +01:00
Fabian Jahr
0930654e1c
build: Add embedded asmap data
The data embedded is from the latest ASMap file from the asmap-data
repository: https://github.com/fjahr/asmap-data/blob/main/1724248800_asmap.dat
2025-03-03 18:07:19 +01:00
Fabian Jahr
6e97b04d19
refactor: Use span of bytes for asmap
This prevents holding the asmap data in memory twice.

Also modernizes the logging in util/asmap.cpp (LogPrintf -> LogInfo).
2025-03-03 18:07:15 +01:00
merge-script
79bbb381a1
Merge bitcoin/bitcoin#30901: cmake: Revamp handling of data files
ecf54a32ed cmake: Add support for builtin `codegen` target (Hennadii Stepanov)
a8c78a0574 cmake: Revamp handling of data files (Hennadii Stepanov)

Pull request description:

  This PR leverages the approach from the https://github.com/chaincodelabs/libmultiprocess project and introduces a new functions `target_json_data_sources()` and `target_raw_data_sources()`, which minimize the amount of code required to assign to assign a `*.json` or `*.raw` data file to the `test_bitcoin`,  `bench_bitcoin` or `unitester` targets.

  As requested in https://github.com/bitcoin/bitcoin/pull/30901#issuecomment-2654622689, the `codegen` build target is now supported, if available:
  ```
  $ cmake --version
  cmake version 3.31.5

  CMake suite maintained and supported by Kitware (kitware.com/cmake).
  $ cmake -G "Ninja" -B build
  $ cmake --build build --target codegen
  ```

ACKs for top commit:
  fjahr:
    re-ACK ecf54a32ed
  Sjors:
    re-tACK ecf54a32ed
  theuni:
    ACK ecf54a32ed

Tree-SHA512: bab92df6b81c47d9d97ba8db37470a6d7aa435d5578afe40df7154885eda55afc59f0bf20dc9db3b2fd88ceb9a0319b9678f9e9af01e7afd4851ec3a79f3f402
2025-03-03 14:41:05 +00:00
merge-script
3c1f72a367
Merge bitcoin/bitcoin#31930: doc: Update translation generation instructions
75d5d235a6 doc: Update translation generation instructions (pablomartin4btc)

Pull request description:

  This is a follow-up of #31731.

  Technically this change [fixes](https://github.com/bitcoin/bitcoin/pull/31731#discussion_r1928888001) the preset configuration execution failure as it needs multiprocess to be enabled, so we disable it using `-DWITH_MULTIPROCESS=OFF`.

  This code will need to be updated by removing `-DWITH_MULTIPROCESS=OFF` in https://github.com/bitcoin/bitcoin/pull/31741.

ACKs for top commit:
  ryanofsky:
    Code review ACK 75d5d235a6. Looks good as a temporary fix and I think after #31741 we should be able to drop the extra argument.

Tree-SHA512: 793e095aa277ab0ea864b49542cc6fe458f9a16123e244f92a77de84fe141837dc7bcc06f543539ad23aaa207c0ea49a47f3afb4493f13fcefb3af87ad7c7c4f
2025-02-27 09:05:28 -05:00
pablomartin4btc
75d5d235a6 doc: Update translation generation instructions
This is a follow-up of #31731.

Technically this change fixes the preset configuration
execution failure as it needs multiprocess to be enabled,
so we disable it using -DWITH_MULTIPROCESS=OFF.

This code will need to be updated in PRs #31741 and #31802.
2025-02-26 14:24:10 -03:00
merge-script
6876e5076e
Merge bitcoin/bitcoin#31943: test: add coverage for abandoning unconfirmed transaction
073a017016 test: add coverage for abandoning unconfirmed transaction (rkrux)

Pull request description:

  Previous discussion: https://github.com/bitcoin/bitcoin/pull/31794#pullrequestreview-2605174936
  Current Coverage: https://maflcko.github.io/b-c-cov/total.coverage/src/wallet/wallet.cpp.gcov.html#L1326

ACKs for top commit:
  Eunovo:
    Tested ACK 073a017016
  janb84:
    Tested ACK [073a017](073a017016)
  maflcko:
    lgtm ACK 073a017016
  Prabhat1308:
    Concept ACK [`073a017`](073a017016)
  brunoerg:
    utACK 073a017016

Tree-SHA512: be9b3d2e1cf65b20369be44d333aa2244b3af588f4a90374ad9562c3ea336669ba8f98a5fb88d616ba1f1f1b7dc0ad9bb47e7167aa03a52f2e0601525e156345
2025-02-26 09:36:34 -05:00
merge-script
0bb8a01810
Merge bitcoin/bitcoin#31880: cmake: Add optional sources to minisketch library directly
9919e92022 cmake: Add optional sources to `minisketch` library directly (Hennadii Stepanov)

Pull request description:

  This PR is a continuation of https://github.com/bitcoin/bitcoin/pull/31268 and applies similar changes to the `minisketch` library, which addresses [this comment](https://github.com/bitcoin/bitcoin/pull/30911#discussion_r1953081930).

  Additionally, a [workaround](db36a92c02/cmake/minisketch.cmake (L77-L78)) for a CMake bug has been removed.

ACKs for top commit:
  theuni:
    utACK 9919e92022

Tree-SHA512: e41618ad6420d3e81960a4691d28b6c143c335e10edcae207cfc1e7743cf85aeab46ae495a5434469f45518db65cd8c18dc4d7815993e6d35aaf2abdcdb43f6b
2025-02-25 14:11:58 -05:00
merge-script
3bb679e5de
Merge bitcoin/bitcoin#31952: chore: remove redundant word
d9ba427f9d chore: remove redundant word (costcould)

Pull request description:

  remove redundant word

ACKs for top commit:
  maflcko:
    lgtm ACK d9ba427f9d

Tree-SHA512: cdcd36a589c1463bdd18f4272d1b8ede4726598ae41d3f84d366ba9a584a95846aff328471b4632abcf173c1d822f5bb7d08b3a02b2de231dd1a8b5176b2b9aa
2025-02-25 11:34:23 -05:00
costcould
d9ba427f9d chore: remove redundant word
Signed-off-by: costcould <fliter@myyahoo.com>
2025-02-25 23:39:23 +08:00
merge-script
c12a2528ce
Merge bitcoin/bitcoin#31415: test: fix TestShell initialization and reset()
303f8cca05 test: fix TestShell initialization and reset() (Brandon Odiwuor)

Pull request description:

  Fixes TestShell initialization issues caused by resolving symlinks and looking for config.ini in the source path instead of the build path after migration to CMake (see https://github.com/bitcoin/bitcoin/issues/31131#issuecomment-2433056070)

  ebe4cac38b/test/functional/test_framework/test_shell.py (L77)
  also fixes https://github.com/bitcoin/bitcoin/issues/31131

  **How to test:**
  ```
  $ python3
  >>> import sys
  >>> sys.path.insert(0, "./path/to/bitcoin/build/test/functional")
  >>> from test_framework.test_shell import TestShell
  >>> TestShell().setup(num_nodes=2, setup_clean_chain=True)
  >>> TestShell().shutdown()
  >>> TestShell.reset()
  ```

ACKs for top commit:
  pinheadmz:
    ACK 303f8cca05
  theStack:
    Tested ACK 303f8cca05
  pablomartin4btc:
    re-ACK 303f8cca05

Tree-SHA512: 25396eb2f7e4bf14426399b1eb3d2c988903ab1f3d38a58f1044b67dd7200c11c01686578fb49b0f2943864166c5c9ccbf122b45202a1e723bf3dbf0c90020fa
2025-02-25 09:54:21 -05:00
merge-script
ba0a4391ff
Merge bitcoin/bitcoin#31945: depends: Update libmultiprocess library to fix CI failures
01f7715766 depends: Update libmultiprocess library to fix CI failure (Ryan Ofsky)

Pull request description:

  Bump libmultiprocess library to include bugfix https://github.com/chaincodelabs/libmultiprocess/pull/159 which should fix intermittent CI failures reported in https://github.com/bitcoin/bitcoin/issues/31921

  This change is bumping the libmultiprocess version instead of cherry picking the bugfix. It could cherry-pick the bugfix instead, but there are reasons to prefer bumping the version:

  - Bugfix might interact with earlier PRs, and the latest version is better tested with testing done in many CI configurations in [#30975](https://github.com/bitcoin/bitcoin/pull/30975) and [#31802](https://github.com/bitcoin/bitcoin/pull/31802)

  - Even though we are in feature freeze for a release, the MULTIPROCESS=1 option is currently not enabled for release, so this PR only affect CI builds and local builds, not the release build.

  This update brings in the following changes:

  https://github.com/chaincodelabs/libmultiprocess/pull/140 build: don't clobber user/superproject c++ version
  https://github.com/chaincodelabs/libmultiprocess/pull/142 build: add option for external mpgen binary
  https://github.com/chaincodelabs/libmultiprocess/pull/143 cleanup: initialize vars in the EventLoop constructor in the correct order
  https://github.com/chaincodelabs/libmultiprocess/pull/146 cmake: Suppress compiler warnings from capnproto headers
  https://github.com/chaincodelabs/libmultiprocess/pull/147 cmake: EXTERNAL_MPGEN cleanups
  https://github.com/chaincodelabs/libmultiprocess/pull/148 util: fix -Wpessimizing-move warning
  https://github.com/chaincodelabs/libmultiprocess/pull/145 CTest: Module must be included at the top level
  https://github.com/chaincodelabs/libmultiprocess/pull/149 Avoid `-Wundef` compiler warnings
  https://github.com/chaincodelabs/libmultiprocess/pull/152 refactor: Fix compiler and clang-tidy warnings
  https://github.com/chaincodelabs/libmultiprocess/pull/155 scripted-diff: s/Libmultiprocess_EXTERNAL_MPGEN/MPGEN_EXECUTABLE/g
  https://github.com/chaincodelabs/libmultiprocess/pull/156 refactor: Remove locale-dependent function calls
  https://github.com/chaincodelabs/libmultiprocess/pull/157 refactor: Avoid using std::format
  https://github.com/chaincodelabs/libmultiprocess/pull/159 bugfix: Do not lock EventLoop::mutex after EventLoop is done
  https://github.com/chaincodelabs/libmultiprocess/pull/161 cmake: Avoid including CTest if not top level project
  https://github.com/chaincodelabs/libmultiprocess/pull/164 Bump minimum required cmake to 3.12

  ---

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/issues/28722).

ACKs for top commit:
  fanquake:
    ACK 01f7715766

Tree-SHA512: a6a795e4d4e13e9d35c9346f3c83d5da817f1452bdc4a9412aeadc4c652ad6e5047f4c77756570594a70ec9095cc786772a0469e306dc19bb5a508fd515c37f4
2025-02-25 09:46:46 -05:00
rkrux
073a017016
test: add coverage for abandoning unconfirmed transaction
Co-authored-by: Eunovo <eunovo9@gmail.com>
2025-02-24 15:44:39 +05:30
merge-script
e486597f9a
Merge bitcoin/bitcoin#31918: fuzz: add basic TxOrphanage::EraseForBlock cov
8400b742fa fuzz: add basic TxOrphanage::EraseForBlock cov (Greg Sanders)

Pull request description:

  Currently uncovered

ACKs for top commit:
  dergoegge:
    utACK 8400b742fa
  marcofleon:
    ACK 8400b742fa

Tree-SHA512: 8c032ffa15ccce73ee1e0b2425d9c303acd4ec87c43f05de0cb96f4d831faeb5651175a32a7fc3ed81bf9400ee4416ca826999777326c29d06e3bd67cb06068c
2025-02-21 11:05:17 -05:00
Ryan Ofsky
01f7715766 depends: Update libmultiprocess library to fix CI failure
Bump libmultiprocess library to include bugfix
https://github.com/chaincodelabs/libmultiprocess/pull/159 which should fix
intermittent CI failures reported in
https://github.com/bitcoin/bitcoin/issues/31921

This change is bumping the libmultiprocess version instead of cherry picking
the bugfix. It could cherry-pick the bugfix instead, but there are reasons to
prefer bumping the version:

- Bugfix might interact with earlier PRs, and the latest version is better
  tested with testing done in many CI configurations in #30975 and #31802

- Even though we are in feature freeze for a release, the MULTIPROCESS=1 option
  is currently not enabled for release, so this PR only affect CI builds and
  local builds, not the release build.

This update brings in the following changes:

https://github.com/chaincodelabs/libmultiprocess/pull/140 build: don't clobber user/superproject c++ version
https://github.com/chaincodelabs/libmultiprocess/pull/142 build: add option for external mpgen binary
https://github.com/chaincodelabs/libmultiprocess/pull/143 cleanup: initialize vars in the EventLoop constructor in the correct order
https://github.com/chaincodelabs/libmultiprocess/pull/146 cmake: Suppress compiler warnings from capnproto headers
https://github.com/chaincodelabs/libmultiprocess/pull/147 cmake: EXTERNAL_MPGEN cleanups
https://github.com/chaincodelabs/libmultiprocess/pull/148 util: fix -Wpessimizing-move warning
https://github.com/chaincodelabs/libmultiprocess/pull/145 CTest: Module must be included at the top level
https://github.com/chaincodelabs/libmultiprocess/pull/149 Avoid `-Wundef` compiler warnings
https://github.com/chaincodelabs/libmultiprocess/pull/152 refactor: Fix compiler and clang-tidy warnings
https://github.com/chaincodelabs/libmultiprocess/pull/155 scripted-diff: s/Libmultiprocess_EXTERNAL_MPGEN/MPGEN_EXECUTABLE/g
https://github.com/chaincodelabs/libmultiprocess/pull/156 refactor: Remove locale-dependent function calls
https://github.com/chaincodelabs/libmultiprocess/pull/157 refactor: Avoid using std::format
https://github.com/chaincodelabs/libmultiprocess/pull/159 bugfix: Do not lock EventLoop::mutex after EventLoop is done
https://github.com/chaincodelabs/libmultiprocess/pull/161 cmake: Avoid including CTest if not top level project
https://github.com/chaincodelabs/libmultiprocess/pull/164 Bump minimum required cmake to 3.12
2025-02-21 11:05:17 -05:00
merge-script
279ab20bbd
Merge bitcoin/bitcoin#31925: contrib: update utxo_to_sqlite tool documentation and comment
e747ed989e contrib: fix read metadata related comment (rkrux)
d3095ac35a contrib: update `dumptxoutset` command in utxo_to_sqlite doc (rkrux)

Pull request description:

  I noticed couple discrepancies in the documentation and comments of `utxo_to_sqlite` tool while using it, this PR fixes them. More details in the commit messages.

ACKs for top commit:
  theStack:
    lgtm ACK e747ed989e

Tree-SHA512: c5dab25d97c50a203ba008acfc5c93baf20cf24261a5a5127bdacc41eeeeae1c9d7b129710c2997e9fd1536ec000186e7f6395efc0188e1111b47868b7d9745a
2025-02-21 11:02:40 -05:00
merge-script
f0ac24846f
Merge bitcoin/bitcoin#31928: ci: Fix filtering out Qt-generated files from compile_commands.json
d82dc10415 ci: Fix filtering out Qt generated files from `compile_commands.json` (Hennadii Stepanov)

Pull request description:

  This PR:
  1. Adjusts the regex for Qt-generated files to match the CMake build directory structure.
  2. Moves the filtering command to run before `clang-tidy`, ensuring that Qt-generated files are not needlessly processed.

  Fixes https://github.com/bitcoin/bitcoin/issues/31801.

ACKs for top commit:
  maflcko:
    ACK d82dc10415 🚂

Tree-SHA512: 12ff40ffb134c56d848976e73aef7a8f895b856992b37b09ce27a1dcf6adef2cf148ba7e7d32b52ce1866c9bbeb165f9b6e6106c6c23b774d00d61bf379e13c9
2025-02-21 10:57:43 -05:00
merge-script
44bd315924
Merge bitcoin/bitcoin#31676: fuzz: add targets for PCP and NAT-PMP port mapping requests
c73b59d47f fuzz: implement targets for PCP and NAT-PMP port mapping requests (Antoine Poinsot)
1695c8ab5b fuzz: in FuzzedSock::GetSockName(), return a random-length name (Antoine Poinsot)
0d472c1953 fuzz: never return an uninitialized sockaddr in FuzzedSock::GetSockName (Antoine Poinsot)
39b7e2b590 fuzz: add steady clock mocking to FuzzedSock (Antoine Poinsot)
6fe1c35c05 pcp: make NAT-PMP error codes uint16_t (Antoine Poinsot)
01906ce912 pcp: make the ToString method const (Antoine Poinsot)

Pull request description:

  Based on https://github.com/bitcoin/bitcoin/pull/31022, this introduces a fuzz target for `PCPRequestPortMap` and `NATPMPRequestPortMap`.

  Like in #31022 we set `CreateSock` to return a `Sock` which mocks the responses from the server and uses a mocked steady clock for the `Wait`s. Except here we simply respond with fuzzer-provided data until the client stop sending requests. We also sometimes inject errors and connection failures based on fuzzer-provided data.

  We reuse the existing `FuzzedSock`, so a preparatory commit is included that adds steady clock mocking to it. This may be useful for other harnesses as well.

ACKs for top commit:
  laanwj:
    re-ACK c73b59d47f
  marcofleon:
    ACK c73b59d47f
  dergoegge:
    utACK c73b59d47f

Tree-SHA512: 24cd4d958a0999946a0c3d164a242fc3f0a0b66770630252b881423ad0065d29fdaab765014d193b705d3eff397f201d51a88a3ca80c63fd3867745e6f21bb2b
2025-02-21 10:57:09 -05:00
Hennadii Stepanov
d82dc10415
ci: Fix filtering out Qt generated files from compile_commands.json 2025-02-21 13:27:18 +00:00
rkrux
e747ed989e
contrib: fix read metadata related comment
The utxo snapshot metadata doesn't seem to contain any block height as per the
CPP code and no such value is read few lines down by the tool code as well.

Related CPP code: bitcoin/bitcoin/blob/28.x/src/node/utxo_snapshot.h#L60-L66
2025-02-21 16:55:30 +05:30
rkrux
d3095ac35a
contrib: update dumptxoutset command in utxo_to_sqlite doc
Running the `dumptxoutset` command without a `type` parameter leads
to the following error. Update the tool documentation to make it
easier to follow.

`Invalid snapshot type "" specified. Please specify "rollback" or "latest"`
2025-02-21 16:55:23 +05:30
Hennadii Stepanov
ecf54a32ed
cmake: Add support for builtin codegen target
Additionally, this change removes unnecessary braces in the `if()`
command for improved robustness, readability and consistency with CMake
guidelines.
2025-02-21 11:11:30 +00:00
Hennadii Stepanov
a8c78a0574
cmake: Revamp handling of data files
This change introduces new functions `target_json_data_sources()` and
`target_raw_data_sources()`.
2025-02-21 11:11:29 +00:00
Hennadii Stepanov
5b8fd7c3a6
Merge bitcoin-core/gui#854: qt: Update src/qt/locale/bitcoin_en.xlf after string freeze
7267ed0518 qt: Update `src/qt/locale/bitcoin_en.xlf` after string freeze (Hennadii Stepanov)

Pull request description:

  This PR follows our [Release Process](864386a744/doc/release-process.md) and implements the ["Translation string freeze"](https://github.com/bitcoin/bitcoin/issues/31029) step.

  Steps to reproduce the diff on Ubuntu:
  ```
  $ cmake --preset dev-mode -DWITH_USDT=OFF -DWITH_MULTIPROCESS=OFF
  $ cmake --build build_dev_mode --target translate
  ```

  At the moment, the multiprocess-specific code does not introduce any new translatable strings. Therefore, there is no need to build depends with `MULTIPROCESS=1` to review this PR.

ACKs for top commit:
  stickies-v:
    ACK 7267ed0518 - I get the same results when building the `translate` target.
  pablomartin4btc:
    tACK 7267ed0518

Tree-SHA512: dc3641d3288c00cb7802714680508de517e56c615716e52181555634ad489fbed676229063995170edb8efeaa4e900ef2d3d5a0f1b8ce7cec143ef364c96e1c0
2025-02-20 22:42:15 +00:00
merge-script
db63bfbe7c
Merge bitcoin/bitcoin#31580: test: Remove non-portable IPv6 test
d871d77825 test: Remove non-portable IPv6 test (Hennadii Stepanov)

Pull request description:

  On Illumos-based systems, such as OpenIndiana and OmniOS, the assumption that "the default zone ID of 0 can be omitted for the default scope" is incorrect. As a result, `getaddrinfo("fe80::1%0", ...)` returns the `EAI_NONAME` error instead of resolving to "fe80::1".

  See: https://www.illumos.org/man/3SOCKET/getaddrinfo.

  This PR removes the problematic code introduced in https://github.com/bitcoin/bitcoin/pull/19951.

ACKs for top commit:
  fanquake:
    ACK d871d77825

Tree-SHA512: 2ef5c22f826d16661deb1d6d005cbda64179e8b83be43d3d6ac51caff02187cf224355c9da144ff110a6ae2cb68f0338ea9b62af8e0f9f1014a518cf9dad6ab5
2025-02-20 16:02:31 -05:00
merge-script
da3ed8b970
Merge bitcoin/bitcoin#31662: cmake: Do not modify CMAKE_TRY_COMPILE_TARGET_TYPE globally
2c4b229c90 cmake: Introduce `FUZZ_LIBS` (Hennadii Stepanov)
ea929c0848 scripted-diff: Rename CMake helper module (Hennadii Stepanov)
8d238c1dfd cmake: Delete `check_cxx_source_links*` macros (Hennadii Stepanov)
71bf8294a9 cmake: Convert `check_cxx_source_compiles_with_flags` to a function (Hennadii Stepanov)
88ee6800c9 cmake: Delete `check_cxx_source_links_with_flags` macro (Hennadii Stepanov)
09e8fd25b1 build: Don't override CMake's default try_compile target (Hennadii Stepanov)

Pull request description:

  This was requested in https://github.com/bitcoin/bitcoin/pull/31359#issuecomment-2515287092.

  From https://github.com/bitcoin/bitcoin/pull/31359#issuecomment-2511246212:
  > (Almost?) every CMake check internally uses the [`try_compile()`](https://cmake.org/cmake/help/latest/command/try_compile.html) command, whose behaviour, in turn, depends on the [`CMAKE_TRY_COMPILE_TARGET_TYPE`](https://cmake.org/cmake/help/latest/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.html) variable:
  >
  >    1. The default value, `EXECUTABLE`, enables both compiler and linker checks.
  >
  >    2. The `STATIC_LIBRARY` value enables only compiler checks.
  >
  >
  > To mimic Autotools' behaviour, we [disabled](d3f42fa08f/cmake/module/CheckSourceCompilesAndLinks.cmake (L9-L10)) linker checks by setting `CMAKE_TRY_COMPILE_TARGET_TYPE` to `STATIC_LIBRARY` globally (perhaps not the best design). This effectively separates the entire CMake script into regions where `CMAKE_TRY_COMPILE_TARGET_TYPE` is:
  >
  >    * unset
  >
  >    * set to `STATIC_LIBRARY`
  >
  >    * set to `EXECUTABLE`

  From https://github.com/bitcoin/bitcoin/pull/31359#issuecomment-2515287092:
  > > This seems very fragile and unintuitive, and the fact that this could silently break at any point is not documented in any way. I don't think other bad design decisions should lead to us having to write even more boilerplate code to fix things that should "just work" (minus the upstream bugs).
  >
  > Agreed. I forgot that we set `CMAKE_TRY_COMPILE_TARGET_TYPE` globally. And even worse, it's buried in a module. If that upsets CMake internal tests, I think we should undo that.

  This PR ensures that `CMAKE_TRY_COMPILE_TARGET_TYPE` is modified only within local scopes.

  Additionally, the `FUZZ_LIBS` variable has been introduced to handle additional libraries required for linking, rather than link options, in certain build environment, such as OSS-Fuzz.

ACKs for top commit:
  TheCharlatan:
    Re-ACK 2c4b229c90
  theuni:
    utACK 2c4b229c90

Tree-SHA512: f72ffa8f50f216fc1a2f8027ba8ddfd4acd42b94ff6c1cb2138f2da51eb8f945660e97d3c247d7f3f7ec8dfebbccec3ab84347d6ae2e3f8a40f3d7aa8b14cde9
2025-02-20 15:07:03 -05:00
Ava Chow
9d7672bbca
Merge bitcoin/bitcoin#31742: contrib: fix BUILDDIR in gen-bitcoin-conf script and gen-manpages.py
63a8791e15 contrib: fix BUILDDIR in gen-bitcoin-conf script and gen-manpages.py (jurraca)

Pull request description:

  The `gen-bitcoin-conf.sh` and `gen-manpages.py` scripts assume a top level `src/` build dir, but in-tree builds are no longer allowed, nor recommended in the build steps. If a user builds `bitcoind` as recommended, these scripts fail. To fix it, we update the `BUILDDIR` env var and update the README accordingly.
  Follows up on initial work and discussion in #31332 .

ACKs for top commit:
  fjahr:
    Code review ACK 63a8791e15
  achow101:
    ACK 63a8791e15

Tree-SHA512: cf4d5b0d2e8b1f5db759bec01e131d8a0c511a2fd183389d2a0488d5fe4a906db2579d944f408b5c966f619edc6b2534023c3521f1fa5f8edd0216d29f3e48db
2025-02-20 11:54:10 -08:00
Ava Chow
77bf99012a
Merge bitcoin/bitcoin#30302: doc: clarify loadwallet path loading for wallets
ca6aa0b9be doc: loadwallet loads from relative walletdir (am-sq)

Pull request description:

  ## Why this change?

  https://github.com/bitcoin/bitcoin/issues/30269 describes a need for documentation improvement with the `loadwallet` RPC. Namely, [some users have found](https://bitcoin.stackexchange.com/questions/123331/how-do-you-load-a-regtest-wallet) the usage description confusing when it comes to loading wallets that are not in the normal case of being in the default wallet directory.

  The default wallet directory, depending on the machine OS, has the base directory defined here: 9c5cdf07f3/src/common/args.cpp (L699) which is then appended with `/wallets`. So for example, for MacOS, it would be `~/Library/Application Support/Bitcoin/wallets`.

  ## The changes implemented
  1. Change the help text to indicate that the filename (or directory) passed in to `loadwallet` is relative to the base wallet directory
  2. Adds additional examples to the help page showing how to fetch a wallet within a subdirectory of the base data directory for wallets, or from an absolute path

ACKs for top commit:
  achow101:
    ACK ca6aa0b9be
  maflcko:
    lgtm ACK ca6aa0b9be
  rkrux:
    ACK ca6aa0b9be
  jonatack:
    ACK ca6aa0b9be

Tree-SHA512: 123ae118c79ee1843ed65861e7a008658a53e47d4d14f2b7612561bba1b1dbdb6744f9aaac1587aac231c62d0c1804de848a6d732f1382788b437d9fe6474012
2025-02-20 11:40:59 -08:00
Greg Sanders
8400b742fa fuzz: add basic TxOrphanage::EraseForBlock cov 2025-02-20 14:00:21 -05:00
merge-script
46a9c73083
Merge bitcoin/bitcoin#31906: ci: Switch to gcr.io mirror to avoid rate limits
fa8de4706a ci: Switch to gcr.io mirror to avoid rate limits (MarcoFalke)

Pull request description:

  dockerhub seems to have recently started to increase their rate limits further, beyond what is documented, even to the extent where pulling the same image twice at the same time results in a ban. See https://github.com/bitcoin/bitcoin/issues/31797#issuecomment-2656374222

  Fix all issues by just using another mirror, as documented in https://cloud.google.com/artifact-registry/docs/pull-cached-dockerhub-images

  Fixes https://github.com/bitcoin/bitcoin/issues/31797

ACKs for top commit:
  0xB10C:
    ACK fa8de4706a

Tree-SHA512: 83d021059772adf473bd6c01443b53f787259e873016238869d716992a2451e18ab98f034e1ac9cd05f2ddbe45eba86cb9ea690be8e16b69c87dd8649d7ac7d4
2025-02-20 13:42:19 -05:00
merge-script
82ba925715
Merge bitcoin/bitcoin#31366: cmake: Check -Wno-* compiler options for leveldb target
9e4a4b4832 cmake: Check `-Wno-*` compiler options for `leveldb` target (Hennadii Stepanov)

Pull request description:

  Otherwise, https://cirrus-ci.com/task/4830737755537408:
  ```
  At global scope:
  cc1plus: note: unrecognized command-line option ‘-Wno-conditional-uninitialized’ may have been intended to silence earlier diagnostics
  ```

ACKs for top commit:
  TheCharlatan:
    ACK 9e4a4b4832

Tree-SHA512: 05553c80399180e01d45c3f02074ca0ce620011b29b03bef5433b87c9d88fd281fb6bf0203fc6fff590f3780c182a3fab8307002536b6350e03748420c346602
2025-02-20 12:22:20 -05:00
merge-script
f236854a5b
Merge bitcoin/bitcoin#31731: doc: update translation generation cmake example
758a93d621 doc: update translation generation cmake example (Lőrinc)

Pull request description:

  While investigating https://github.com/bitcoin/bitcoin/pull/31730 I noticed that
  * the `dev-mode` preset already contained [`-DWITH_BDB=ON`](https://github.com/bitcoin/bitcoin/blob/master/CMakePresets.json#L83) and [`-DBUILD_GUI=ON`](https://github.com/bitcoin/bitcoin/blob/master/CMakePresets.json#L70);
  * the preset already contained a [default binary dir](https://github.com/bitcoin/bitcoin/blob/master/CMakePresets.json#L64) which we could use;
  * the command only runs on my Mac if we disable `USDT`, and `MULTIPROCESS` and on Linux also without `MULTIPROCESS`.

ACKs for top commit:
  hebasto:
    ACK 758a93d621.

Tree-SHA512: f5bef99bff090f53dae04018f17e60655698fea23084f6a3d38affd830ca041d5c56466633206b63ae01e85c55b784d003e323b2de7c59028b595d4e8f50783c
2025-02-20 12:18:34 -05:00
merge-script
eb51963d87
Merge bitcoin/bitcoin#31884: cmake: Make implicit libbitcoinkernel dependencies explicit
3b42e05aa9 cmake: Make implicit `libbitcoinkernel` dependencies explicit (Hennadii Stepanov)
3fd64efb43 cmake: Avoid using `OBJECT` libraries (Hennadii Stepanov)

Pull request description:

  This PR fixes two regressions introduced in https://github.com/bitcoin/bitcoin/pull/30911.

  For example, on the master branch @ 28dec6c5f8:
  - first regression:
  ```
  $ cmake -B build -G "Ninja" -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/home/hebasto/INSTALL
  $ cmake --build build -j $(nproc) -t libbitcoinkernel
  $ cmake --install build --component libbitcoinkernel
  - Install configuration: "RelWithDebInfo"
  CMake Error at build/src/kernel/cmake_install.cmake:46 (file):
    file INSTALL cannot find
    "/home/hebasto/dev/bitcoin/build/src/crypto/libbitcoin_crypto.a": No such
    file or directory.
  Call Stack (most recent call first):
    build/src/cmake_install.cmake:172 (include)
    build/cmake_install.cmake:57 (include)

  ```

  - second regression:
  ```
  $ cmake -B build -G "Unix Makefiles" -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/home/hebasto/INSTALL
  $ cmake --build build -j $(nproc) -t libbitcoinkernel
  ...
  gmake[3]: *** No rule to make target 'src/CMakeFiles/bitcoin_clientversion.dir/clientversion.cpp.o', needed by 'src/kernel/libbitcoinkernel.a'.  Stop.
  gmake[2]: *** [CMakeFiles/Makefile2:1360: src/kernel/CMakeFiles/bitcoinkernel.dir/all] Error 2
  gmake[1]: *** [CMakeFiles/Makefile2:1367: src/kernel/CMakeFiles/bitcoinkernel.dir/rule] Error 2
  gmake: *** [Makefile:647: bitcoinkernel] Error 2
  ```

  With this PR:
  ```
  $ cmake -B build -G "Ninja" -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/home/hebasto/INSTALL
  $ cmake --build build -j $(nproc) -t libbitcoinkernel
  $ cmake --install build --component libbitcoinkernel
  ```
  and
  ```
  $ cmake -B build -G "Unix Makefiles" -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/home/hebasto/INSTALL
  $ cmake --build build -j $(nproc) -t libbitcoinkernel
  $ cmake --install build --component libbitcoinkernel
  ```

  ---

  **A note for reviewers:** An alternative approach would be to disable the `OPTIMIZE_DEPENDENCIES` property for the `bitcoinkernel` target. However, I contend that this PR is preferable because (1) it preserves parallel builds for the `libbitcoinkernel` target, and (2) the resulting code has one less workaround for a CMake bug.

ACKs for top commit:
  TheCharlatan:
    ACK 3b42e05aa9
  theuni:
    utACK 3b42e05aa9

Tree-SHA512: 73e9da845688a02e5d61770b7cfd5e1a17440182eb524c7329a47df8f1daa6fe0f9cbde5274832bf43f52e17de86473881dc876dee4276c9c06b173b1b78b7a2
2025-02-20 12:08:35 -05:00
Hennadii Stepanov
7267ed0518
qt: Update src/qt/locale/bitcoin_en.xlf after string freeze
Steps to reproduce the diff on Ubuntu:
```
$ cmake --preset dev-mode -DWITH_USDT=OFF -DWITH_MULTIPROCESS=OFF
$ cmake --build build_dev_mode --target translate
```
2025-02-20 17:04:16 +00:00
merge-script
58f15d4b21
Merge bitcoin/bitcoin#31379: cmake: Fix passing APPEND_*FLAGS to secp256k1 subtree
c4c5cf1748 cmake: Fix passing `APPEND_*FLAGS` to `secp256k1` subtree (Hennadii Stepanov)
eb540a2629 cmake: Remove `core_sanitizer_{cxx,linker}_flags` helper variables (Hennadii Stepanov)

Pull request description:

  On the master branch @ 70e20ea024, the `APPEND_CPPFLAGS`, `APPEND_CFLAGS`  and `APPEND_LDFLAGS` are not correctly applied when building C code in the  `secp256k1` subtree, as intended.

  This behaviour occurs due to two issues:
  1. The command here: 70e20ea024/src/CMakeLists.txt (L77)
  does not affect the code in `add_subdirectory(secp256k1)` above it.

  2.  `APPEND_LDFLAGS`  is not passed to the subtree's build system at all.

  This PR fixes both issues.

  Additionally, the helper variables `core_sanitizer_cxx_flags` and `core_sanitizer_linker_flags` have been removed.

ACKs for top commit:
  theuni:
    utACK c4c5cf1748.
  TheCharlatan:
    ACK c4c5cf1748

Tree-SHA512: 707acfa623f0436e34e9e6ba8ce2979e0fde5e196e2242fd1cde4c50f433938549781193d8a06419a0866bbe6d69d76f8383d973afbd87d944407963b318c5c9
2025-02-20 09:36:48 -05:00
Hennadii Stepanov
2c4b229c90
cmake: Introduce FUZZ_LIBS
CMake distinguishes recommended methods for handling (1) linker options
and (2) libraries used during linking. Therefore, it is both reasonable
and consistent to introduce a dedicated variable for the latter,
particularly when a build environment, such as OSS-Fuzz, requires
linking against additional libraries.
2025-02-20 12:41:44 +00:00
Hennadii Stepanov
ea929c0848
scripted-diff: Rename CMake helper module
-BEGIN VERIFY SCRIPT-
git mv cmake/module/CheckSourceCompilesAndLinks.cmake cmake/module/CheckSourceCompilesWithFlags.cmake
sed -i 's|\<CheckSourceCompilesAndLinks\>|CheckSourceCompilesWithFlags|g' $(git grep -l 'CheckSourceCompilesAndLinks')
-END VERIFY SCRIPT-
2025-02-20 12:39:20 +00:00
Hennadii Stepanov
8d238c1dfd
cmake: Delete check_cxx_source_links* macros 2025-02-20 12:39:12 +00:00
Hennadii Stepanov
71bf8294a9
cmake: Convert check_cxx_source_compiles_with_flags to a function 2025-02-20 12:39:03 +00:00
Hennadii Stepanov
88ee6800c9
cmake: Delete check_cxx_source_links_with_flags macro 2025-02-20 12:38:55 +00:00
Hennadii Stepanov
09e8fd25b1
build: Don't override CMake's default try_compile target
CMake assumes the default value internally, so overriding this causes
problems. The minimal speedup of skipping the linker isn't worth the
complexity of setting it to static.
2025-02-20 12:38:35 +00:00
Brandon Odiwuor
303f8cca05 test: fix TestShell initialization and reset() 2025-02-20 15:25:43 +03:00
merge-script
e606c577cb
Merge bitcoin/bitcoin#31899: cmake: Exclude generated sources from translation
ff4ddd3d2e Revert "cmake: Ensure generated sources are up to date for `translate` target" (Hennadii Stepanov)
03b3166aac cmake: Exclude generated sources from translation (Hennadii Stepanov)

Pull request description:

  This PR fixes an error encountered when building the `translate` target:
  ```
  $ gmake -j $(nproc) -C depends MULTIPROCESS=1
  $ cmake -G "Unix Makefiles" --preset dev-mode --toolchain depends/x86_64-pc-linux-gnu/toolchain.cmake -DWITH_USDT=OFF
  $ cmake --build build_dev_mode -t translate
  gmake[3]: *** No rule to make target 'src/test/ipc_test.capnp.c++', needed by 'src/qt/CMakeFiles/translate'. Stop.
  gmake[2]: *** [CMakeFiles/Makefile2:1646: src/qt/CMakeFiles/translate.dir/all] Error 2
  gmake[1]: *** [CMakeFiles/Makefile2:1653: src/qt/CMakeFiles/translate.dir/rule] Error 2
  gmake: *** [Makefile:699: translate] Error 2
  ```

  The previous [attempt](864386a744) to address this issue worked only with Ninja generators and has been reverted.

  Essentially, this PR modifies the `translate` target so that it ignores generated sources rather than attempting to update them.

  At present, multiprocess-specific sources do not contain any translatable strings. Nonetheless, it is prudent to maintain a general approach.

ACKs for top commit:
  TheCharlatan:
    ACK ff4ddd3d2e
  pablomartin4btc:
    tACK ff4ddd3d2e

Tree-SHA512: 6471498a33b145e073f76bd007591b0449e5d520f141c3e3afeca02a09c160fd0f572ec7172dd84703cdc2a1175ad8f3c91e8b0bf705d671338d760786765f56
2025-02-19 16:11:22 -05:00
Lőrinc
758a93d621 doc: update translation generation cmake example
The command only runs on my Mac if we disable USDT which won't affect translation
2025-02-19 20:46:43 +01:00
Ava Chow
fd14995b6a
Merge bitcoin/bitcoin#31908: Revert merge of PR #31826
3e9b12b3e0 Revert "Merge bitcoin/bitcoin#31826: random: Check `GetRNDRRS` is supported in `InitHardwareRand` to avoid infinite loop" (Antoine Poinsot)

Pull request description:

  PR #31826 was merged [despite the code not compiling](https://github.com/bitcoin/bitcoin/pull/31826#discussion_r1961315638).

  #31902 was opened to fix the code but since this code is only targeting a not officially supported platform, we don't have a CI in place to compile and run tests on this platform, neither apparently reviewers do (nor does the author?), don't take more risk right before 29 and revert the original broken PR.

ACKs for top commit:
  sipa:
    ACK 3e9b12b3e0
  achow101:
    ACK 3e9b12b3e0
  TheCharlatan:
    ACK 3e9b12b3e0
  eval-exec:
    ACK 3e9b12b3e0
  laanwj:
    ACK 3e9b12b3e0

Tree-SHA512: e90f8ffb2eebe77e5b6f1c273fbeb29dd5bd6a76698d9a6048c33f3349033c56ea984dd9b64704698da01ecad4c47f98acac1a30312bf2499dbdd1931596953f
2025-02-19 10:03:26 -08:00