44157 Commits

Author SHA1 Message Date
glozow
0683b8ebf3 [kernel] update assumed blockchain and chainstate sizes for v29 2025-03-04 14:23:17 -05:00
glozow
e13c18f6ce
Merge bitcoin/bitcoin#31969: Add mainnet assumeutxo param at height 880,000
14f16748557faf57cf4b0f4c91c162592557434c chainparams: add mainnet assumeutxo param at height 880_000 (Sjors Provoost)

Pull request description:

  #31940 suggests adding a snapshot at every major release.

  This snapshot should be suitable for v29. I picked the most recent multiple of 10K blocks.

  You can either download this torrent:

  ```
  magnet:?xt=urn:btih:559bd78170502971e15e97d7572e4c824f033492&dn=utxo-880000.dat&tr=udp%3A%2F%2Ftracker.bitcoin.sprovoost.nl%3A6969
  ```

  Or generate the snapshot yourself:

  ```sh
  bitcoin-cli -rpcclienttimeout=0 -named dumptxoutset utxo-880000.dat rollback=880000
  ```

  The SHA-256 hash should be:

  ```
  shasum -a 256 utxo-880000.dat
  43b3b1ad6e1005ffc0ff49514d0ffcc3e3ce671cc8d02da7fa7bac5405f89de4
  ```

  And then load it on a fresh node during IBD with:

  ```
  bitcoin-cli -rpcclienttimeout=0 loadtxoutset utxo-880000.dat
  ```

  Note that it's more performant to turn off networking while the snapshot is loading, see #29993:

  ```sh
  bitcoin-cli setnetworkactive false
  ```

  Once the snapshot is loaded:

  ```sh
  bitcoin-cli setnetworkactive true
  ```

  And enjoy a speedy ride to the tip.

ACKs for top commit:
  achow101:
    ACK 14f16748557faf57cf4b0f4c91c162592557434c
  fjahr:
    tACK 14f16748557faf57cf4b0f4c91c162592557434c
  hodlinator:
    ACK 14f16748557faf57cf4b0f4c91c162592557434c
  rkrux:
    Concept ACK 14f16748557faf57cf4b0f4c91c162592557434c
  polespinasa:
    ACK 14f1674855

Tree-SHA512: e7ed3e8ce3a247614545ecd3254a91814d7f87b3ca1be46df3b9a4c1e6353b46c82ab97d9fc9c5bed8938f28a6a61e6b70baa7c9649fe5da0f2f390b7932f15e
2025-03-04 14:14:50 -05:00
Antoine Poinsot
e5ff4e416e qa: use a clearer and documented amount error in malleated snapshot
In the assumeutxo functional tests, the final test case with alternated UTxO data tests the error
raised when deserializing a snapshot that contains a coin with an amount not in range (<0 or
>MAX_MONEY).

The current malleation uses an undocumented byte string and offset which makes it hard to maintain.
In addition, the undocumented offset is set surprisingly high (39 bytes is well into the
serialization of the amount which starts at offset 36). Similarly the value is surprisingly small,
presumably one was adjusted for the other. But there is no comment explaining how they were chosen,
why not in a clearer manner and what they are supposed to represent.

Instead replace this seemingly magic value with a clear one, MAX_MONEY + 1, serialize the whole
value for the amount field at the correct offset, and document the whole thing for the next person
around.
2025-03-04 12:50:17 -05:00
Sebastian Falbesoner
b34fdb5ade test: introduce output amount (de)compression routines 2025-03-04 12:50:17 -05:00
Hennadii Stepanov
18e83534ac
wallet: Replace "non-0" with "non-zero" in translatable error message
Transifex interprets the "-0" substring as a number in translatable
strings. Since not all translations preserve "-0," this triggers a
corresponding warning. While this warning could be disabled globally, it
is more reasonable to adjust the original string instead.
2025-03-04 16:29:43 +00:00
Sebastian Falbesoner
a7911ed101 test: introduce VARINT (de)serialization routines 2025-03-04 10:08:12 -05:00
fanquake
c718bffc36
build: don't use ccache with MSVC
Set WITH_CCACHE to OFF for MSVC, so it doesn't show as ON in the
configure summary.

Fixes #31771.
2025-03-04 14:53:06 +00:00
laanwj
fff4f93dff doc: Bring reduce-memory.md up to date
Update default number of RPC threads to 16 (#31215) and remove reference
to very old version of bitcoin core.
2025-03-04 15:37:59 +01:00
Max Edwards
75486c8ed8 doc: update fuzz instructions when on macOS
Default linker on macOS does not work with recent versions of LLVM. Updated the instructions for fuzzing to use lld instead.
2025-03-04 13:18:52 +00:00
fanquake
18749efb07
scripted-diff: rename libmultiprocess repository
-BEGIN VERIFY SCRIPT-

sed -i -e "s/chaincodelabs\/libmultiprocess/bitcoin-core\/libmultiprocess/g" $(git grep -l "chaincodelabs/libmultiprocess")

-END VERIFY SCRIPT-
2025-03-04 11:16:17 +00:00
willcl-ark
02fae33635
doc: add assumeutxo chainparams to release proc
This should be bumped every major release to avoid falling too far
behind, therefore making this feature as useful as it can be.

Document this in release-process.md to avoid forgetting to add a new
hardcoded height during release.
2025-03-04 09:47:01 +00:00
Ava Chow
15717f0ef3
Merge bitcoin/bitcoin#31916: init: Handle dropped UPnP support more gracefully
44041ae0eca9d2034b7c2bdef24724809cc35e90 init: Handle dropped UPnP support more gracefully (laanwj)

Pull request description:

  Closes bitcoin-core/gui#843.

  In that issue it was brought up that users likely don't care what kind of port forwarding is used, and that the setting is opportunistic anyway, so instead of showing an extensive warning, we can simply "upgrade" from UPNP to NAT-PMP+PCP.

  - Change the logic for removed runtime setting `-upnp` to set `-natpmp` instead, and log a message.

  - Also remove any lingering `upnp` from `settings.json` and replace it with `natpmp`, when it makes sense (this is important so that the UI shows the right values in the settings):

  ```json
  {
      "upnp": true
  }
  ```
  becomes
  ```json
  {
      "natpmp": true
  }
  ```

  and

  ```json
  {
      "upnp": false
  }
  ```
  becomes
  ```json
  {
      "natpmp": false
  }
  ```

ACKs for top commit:
  darosior:
    tACK 44041ae0eca9d2034b7c2bdef24724809cc35e90
  davidgumberg:
    lightly reviewed code, tested ACK 44041ae0ec
  achow101:
    ACK 44041ae0eca9d2034b7c2bdef24724809cc35e90
  ryanofsky:
    Code review ACK 44041ae0eca9d2034b7c2bdef24724809cc35e90. Code changes look good. Could potentially add test coverage for this, though I don't think it is too important.
  hodlinator:
    cr-ACK 44041ae0eca9d2034b7c2bdef24724809cc35e90

Tree-SHA512: ca822f7160529e59973bab6a7cc31753ffa3caaa806887b5073b42c4ae5c918a5ea2cf93c666e5125ea70d10c6954709a535a264b04c2fd4cf916b3c59ab9964
2025-03-03 16:40:26 -08:00
Ava Chow
afde95b460
Merge bitcoin/bitcoin#31976: delete release note fragments for v29
ae92bd8e1b2c144697662ba0358c27f5c1892bb2 delete release note fragments for v29 (glozow)

Pull request description:

  Delete release note fragments in preparation for 29.x branch-off.
  Everything here has been copied over to the draft release notes at https://github.com/bitcoin-core/bitcoin-devwiki/wiki/29.0-Release-Notes-draft

ACKs for top commit:
  laanwj:
    ACK ae92bd8e1b2c144697662ba0358c27f5c1892bb2
  achow101:
    ACK ae92bd8e1b2c144697662ba0358c27f5c1892bb2

Tree-SHA512: adc4d34dfaf1cbbe4c7eddf4d220664e327c450de126040ab8565fc5f20696aaed2d58438aad76e4e343f0abf1b4f28fe1a21d09d957e606403c200858072682
2025-03-03 15:15:57 -08:00
glozow
ae92bd8e1b delete release note fragments for v29 2025-03-03 13:42:26 -05:00
merge-script
79bbb381a1
Merge bitcoin/bitcoin#30901: cmake: Revamp handling of data files
ecf54a32ed26a50e861fca559e43ec1f9dee93b7 cmake: Add support for builtin `codegen` target (Hennadii Stepanov)
a8c78a0574d394d6a46edc0924a85180087dc9fa 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 ecf54a32ed26a50e861fca559e43ec1f9dee93b7
  Sjors:
    re-tACK ecf54a32ed26a50e861fca559e43ec1f9dee93b7
  theuni:
    ACK ecf54a32ed26a50e861fca559e43ec1f9dee93b7

Tree-SHA512: bab92df6b81c47d9d97ba8db37470a6d7aa435d5578afe40df7154885eda55afc59f0bf20dc9db3b2fd88ceb9a0319b9678f9e9af01e7afd4851ec3a79f3f402
2025-03-03 14:41:05 +00:00
Sjors Provoost
14f1674855
chainparams: add mainnet assumeutxo param at height 880_000 2025-03-01 10:53:48 -05:00
merge-script
3c1f72a367
Merge bitcoin/bitcoin#31930: doc: Update translation generation instructions
75d5d235a6b5eb6b960be0c5e6e181460a1ac5e6 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 75d5d235a6b5eb6b960be0c5e6e181460a1ac5e6. 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
073a017016e62c7d52562aa61d942024379c110d 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 073a017016e62c7d52562aa61d942024379c110d
  Prabhat1308:
    Concept ACK [`073a017`](073a017016)
  brunoerg:
    utACK 073a017016e62c7d52562aa61d942024379c110d

Tree-SHA512: be9b3d2e1cf65b20369be44d333aa2244b3af588f4a90374ad9562c3ea336669ba8f98a5fb88d616ba1f1f1b7dc0ad9bb47e7167aa03a52f2e0601525e156345
2025-02-26 09:36:34 -05:00
laanwj
44041ae0ec init: Handle dropped UPnP support more gracefully
Closes bitcoin-core/gui#843.

In that issue it was brought up that users likely don't care what kind
of port forwarding is used, and the setting is opportunistic anyway, so
instead of showing an extensive warning, we can simply migrate from
UPNP to NAT-PMP+PCP. This prevents nodes dropping from the public
network.

- Change the logic for removed runtime setting `-upnp` to set `-natpmp`
  instead, and only log a message.

- Also replace any lingering `upnp` in `settings.json` with `natpmp`.
2025-02-26 14:42:35 +01:00
MarcoFalke
fac1dd9dff
test: Fix authproxy named args debug logging 2025-02-25 22:41:17 +01:00
merge-script
0bb8a01810
Merge bitcoin/bitcoin#31880: cmake: Add optional sources to minisketch library directly
9919e92022ba61d2dc1b13b1116b56035be459a6 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 9919e92022ba61d2dc1b13b1116b56035be459a6

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

Pull request description:

  remove redundant word

ACKs for top commit:
  maflcko:
    lgtm ACK d9ba427f9d09dcf39cfdc7f871f7b093b876a0a3

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()
303f8cca0568d2ca77189c4eccdfc7a6913c958d 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 303f8cca0568d2ca77189c4eccdfc7a6913c958d
  theStack:
    Tested ACK 303f8cca0568d2ca77189c4eccdfc7a6913c958d
  pablomartin4btc:
    re-ACK 303f8cca0568d2ca77189c4eccdfc7a6913c958d

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
01f771576608403dbfc5dee4fcdd84ef262f9390 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 01f771576608403dbfc5dee4fcdd84ef262f9390

Tree-SHA512: a6a795e4d4e13e9d35c9346f3c83d5da817f1452bdc4a9412aeadc4c652ad6e5047f4c77756570594a70ec9095cc786772a0469e306dc19bb5a508fd515c37f4
2025-02-25 09:46:46 -05:00
MarcoFalke
fa99c3b544
test: Exclude SeedStartup from coverage counts 2025-02-25 10:15:00 +01:00
MarcoFalke
fa579d663d
contrib: Add deterministic-unittest-coverage
This replaces the bash script with a tool based on clang/llvm tools.
2025-02-25 10:14:41 +01:00
MarcoFalke
fa3940b1cb
contrib: deterministic-fuzz-coverage fixups
* Name the fuzz_corpora dir after its real name.
* Add missing cargo lock file.
* Use git instead of diff command to increase compatibility
* Use --help instead of --version to increase compatibility
* Use assert consistently for unexpected errors.
* Remove redundant Stdio::from.
* Fix typos.
2025-02-24 11:41:41 +01:00
MarcoFalke
faf905b9b6
doc: Remove unused -fPIC
This is harmless, but no longer needed after commit
06b9236f4327525875768af5fc554c651c5ec3cf.
2025-02-24 11:38:02 +01: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
8400b742fa6dda4ad89311f547ccf50b0187e817 fuzz: add basic TxOrphanage::EraseForBlock cov (Greg Sanders)

Pull request description:

  Currently uncovered

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

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
e747ed989ebb7b9650ba1478d583f7f507e1083f contrib: fix read metadata related comment (rkrux)
d3095ac35a8891afc891458211130170d5a8a12e 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 e747ed989ebb7b9650ba1478d583f7f507e1083f

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
d82dc1041524e8402d201d32c9143233b5ec1baf 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 d82dc1041524e8402d201d32c9143233b5ec1baf 🚂

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
c73b59d47f1ec6fff1ad9155181c2285a5ef5cf4 fuzz: implement targets for PCP and NAT-PMP port mapping requests (Antoine Poinsot)
1695c8ab5bd3ea2dd0a065bcb8162a973dede7fe fuzz: in FuzzedSock::GetSockName(), return a random-length name (Antoine Poinsot)
0d472c19533a0c13ea8b79e84bcff49230179519 fuzz: never return an uninitialized sockaddr in FuzzedSock::GetSockName (Antoine Poinsot)
39b7e2b5905255645264bc332b934b62441e55b9 fuzz: add steady clock mocking to FuzzedSock (Antoine Poinsot)
6fe1c35c05b353f5cc3f3811fdf46e3b220096e4 pcp: make NAT-PMP error codes uint16_t (Antoine Poinsot)
01906ce912e945c967316f829c1356f8ff38745f 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 c73b59d47f1ec6fff1ad9155181c2285a5ef5cf4
  marcofleon:
    ACK c73b59d47f1ec6fff1ad9155181c2285a5ef5cf4
  dergoegge:
    utACK c73b59d47f1ec6fff1ad9155181c2285a5ef5cf4

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
Lőrinc
4cd95a2921 refactor: modernize remaining outdated trait patterns 2025-02-21 10:43:41 +01:00
Lőrinc
ab2b67fce2 scripted-diff: modernize outdated trait patterns - values
See https://en.cppreference.com/w/cpp/types/is_enum for more details.

-BEGIN VERIFY SCRIPT-
sed -i -E 's/(std::[a-z_]+)(<[^<>]+>)::value\b/\1_v\2/g' $(git grep -l '::value' ./src ':(exclude)src/bench/nanobench.h' ':(exclude)src/minisketch' ':(exclude)src/span.h')
-END VERIFY SCRIPT-
2025-02-21 10:43:01 +01:00
Lőrinc
8327889f35 scripted-diff: modernize outdated trait patterns - types
The use of e.g. `std::underlying_type_t<T>` replaces the older `typename std::underlying_type<T>::type`.
The `_t` helper alias template (such as `std::underlying_type_t<T>`) introduced in C++14 offers a cleaner and more concise way to extract the type directly.
See https://en.cppreference.com/w/cpp/types/underlying_type for details.

-BEGIN VERIFY SCRIPT-
sed -i -E 's/(typename )?(std::[a-z_]+)(<[^<>]+>)::type\b/\2_t\3/g' $(git grep -l '::type' ./src ':(exclude)src/bench/nanobench.h' ':(exclude)src/leveldb' ':(exclude)src/minisketch' ':(exclude)src/span.h' ':(exclude)src/sync.h')
-END VERIFY SCRIPT-
2025-02-21 10:41:27 +01:00
Hennadii Stepanov
5b8fd7c3a6
Merge bitcoin-core/gui#854: qt: Update src/qt/locale/bitcoin_en.xlf after string freeze
7267ed051820b9227856143bdf767ae94a5be1d8 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 7267ed051820b9227856143bdf767ae94a5be1d8 - I get the same results when building the `translate` target.
  pablomartin4btc:
    tACK 7267ed051820b9227856143bdf767ae94a5be1d8

Tree-SHA512: dc3641d3288c00cb7802714680508de517e56c615716e52181555634ad489fbed676229063995170edb8efeaa4e900ef2d3d5a0f1b8ce7cec143ef364c96e1c0
2025-02-20 22:42:15 +00:00
Hennadii Stepanov
568fcdddae
scripted-diff: Adjust documentation per top-level target output location
-BEGIN VERIFY SCRIPT-

ren() { sed -i "s|\<$1\>|$2|g" $( git grep -l "$1" :\(exclude\)./src/secp256k1 ) ; }

ren build/src/bench   build/bin
ren build/src/test    build/bin
ren build/src/qt/test build/bin
ren build/src/qt      build/bin
ren build/src         build/bin
ren build_fuzz/src/test/fuzz build_fuzz/bin

-END VERIFY SCRIPT-
2025-02-20 22:18:57 +00:00
Hennadii Stepanov
026bb226e9
cmake: Set top-level target output locations
This change:
1. Collects build artifacts in dedicated locations.
2. Allows running bitcoin-chainstate.exe with bitcoinkernel.dll directly
from the build tree on Windows.
2025-02-20 22:18:51 +00:00
merge-script
db63bfbe7c
Merge bitcoin/bitcoin#31580: test: Remove non-portable IPv6 test
d871d778251c35fd55d420ecf5c278f3edfea227 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 d871d778251c35fd55d420ecf5c278f3edfea227

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
2c4b229c906de6250500d3af2b44808e90b9ce0b cmake: Introduce `FUZZ_LIBS` (Hennadii Stepanov)
ea929c0848e2d95a71439e1b3aa0cf350e12bc73 scripted-diff: Rename CMake helper module (Hennadii Stepanov)
8d238c1dfde28bbd38bfba84136900724c0d7d95 cmake: Delete `check_cxx_source_links*` macros (Hennadii Stepanov)
71bf8294a985d818a9d855390bd8503a9ae8074a cmake: Convert `check_cxx_source_compiles_with_flags` to a function (Hennadii Stepanov)
88ee6800c9686931a1550b41fa634b0c6c3988a7 cmake: Delete `check_cxx_source_links_with_flags` macro (Hennadii Stepanov)
09e8fd25b1a5411472564e599ad15059bbf9e8d6 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 2c4b229c906de6250500d3af2b44808e90b9ce0b
  theuni:
    utACK 2c4b229c906de6250500d3af2b44808e90b9ce0b

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
63a8791e15c3ffb44b84ab3e85db62d7997d25fd 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 63a8791e15c3ffb44b84ab3e85db62d7997d25fd
  achow101:
    ACK 63a8791e15c3ffb44b84ab3e85db62d7997d25fd

Tree-SHA512: cf4d5b0d2e8b1f5db759bec01e131d8a0c511a2fd183389d2a0488d5fe4a906db2579d944f408b5c966f619edc6b2534023c3521f1fa5f8edd0216d29f3e48db
2025-02-20 11:54:10 -08:00