Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update bitcoin to 0.18.1 #1

Open
wants to merge 10,000 commits into
base: master
Choose a base branch
from
Open

update bitcoin to 0.18.1 #1

wants to merge 10,000 commits into from

Conversation

pinhopro
Copy link
Member

No description provided.

MarcoFalke and others added 29 commits September 12, 2024 15:01
…ing built

23eedc5 build: Skip secp256k1 ctime tests when tests are not being built (Hennadii Stepanov)

Pull request description:

  Fixes #30791 (comment):
  > Building with a fuzz engine fails, because the ctime tests are auto-detected in cmake, based on whether or not valgrind-devel is installed or not.

ACKs for top commit:
  maflcko:
    re-review ACK 23eedc5
  fanquake:
    ACK 23eedc5

Tree-SHA512: bfc0f2798acd36be9c52073d578b42c002606c60ef3fe8ef633eaea4f5382a3e9765d31637e4c25d8b71fd70473b29c24af4732e55e5183f27b48725b61fa15b
72b46f2 test: fix exclude parsing for functional runner (Max Edwards)

Pull request description:

  This restores previous behaviour of being able to exclude a test by name without having to specify .py extension.

  It was noticed in #30851 that tests were no longer being excluded.

  PR #30244 introduced being able to exclude a specific tests based on args (such as `--exclude "rpc_bind.py --ipv6`) but it made the wrong assumption that test names intended to be excluded would include the .py extension.

  The following #30244 (comment) shows that this is not how the `--exclude` flag was used in CI.

  #30244 (comment) gave three examples of `--exclude` being used in CI so I compared the number of tests that the runner would run for these three examples in three situations, before #30244 was introduced, in master today and with this PR applied.

  Example:

  `--previous-releases --coverage --extended --exclude feature_dbcrash`

  Test count:
  Before #30244 introduced: 314
  Master: 315
  With this PR: 314

  Example:

  `--exclude feature_init,rpc_bind,feature_bind_extra`

  Test count:
  Before #30244 introduced: 306
  Master 311
  With this PR: 306

  Example:

  `--exclude rpc_bind,feature_bind_extra`

  Before #30244 introduced:  307
  Master 311
  With this PR: 307

  I've also tested that the functionality introduced with #30244 remains and we can still exclude specific tests by argument.

ACKs for top commit:
  maflcko:
    review ACK 72b46f2
  willcl-ark:
    ACK 72b46f2

Tree-SHA512: 37c0e3115f4e3efdf9705f4ff8cd86a5cc906aacc1ab26b0f767f5fb6a953034332b29b0667073f8382a48a2fe9d649b7e60493daf04061260adaa421419d8c8
`m_is_inbound` cannot be changed throughout the life of a `Peer`. However, we
are currently storing it in `CNodeState`, which requires locking `cs_main` in
order to access it. This can be moved to the outside scope and only require
`m_peer_mutex`.

This is a refactor in preparation for Erlay reworks.
0dd16d7 build: Add a pkg-config file for libbitcoinkernel (TheCharlatan)
45be32f build: Produce a usable static kernel library (TheCharlatan)

Pull request description:

  Since the move to cmake, the kernel static library that is installed after a cmake --install build is unusable. It lacks symbols for the internal libraries, besides those defined in the kernel library target.

  Fix this by explicitly installing all the required internal static libraries. To make usage of these installed libraries easy, add a pkg-config file that can be used during linking.

  This patch can be tested with:

  ```
  cmake -B build -DBUILD_SHARED_LIBS=OFF -DBUILD_KERNEL_LIB=ON
  cmake --build build
  cmake --install build
  g++ -std=c++20 -o test_chainstate src/bitcoin-chainstate.cpp -I/home/drgrid/bitcoin/src $(pkg-config --libs --static libbitcoinkernel)
  ```

  Attempts to solve #30801

ACKs for top commit:
  hebasto:
    ACK 0dd16d7.
  fanquake:
    ACK 0dd16d7 - this looks like a good place to start.
  ryanofsky:
    Code review ACK 0dd16d7

Tree-SHA512: 92f7bc959584bdc595f4aa6d0ab133355481075fe8564224fd7ac122fd7bdd75f98cf26ef0a6a7d84fd552d2258ddca1b674eca91122469a58bacc5f0a0ec2ef
…erFrom{Json,Raw}.cmake`"

fdeb717 Revert "build: Minimize I/O operations in `GenerateHeaderFrom{Json,Raw}.cmake`" (Hennadii Stepanov)

Pull request description:

  This reverts commit b07fe66 from #30842.

  Fixes #30881.

  Apparently, the `string(APPEND ...)` command isn't optimized for large strings.

ACKs for top commit:
  maflcko:
    review ACK fdeb717

Tree-SHA512: ad5c3d49d3395ab318edcd7c9a98090838bec0cd3c1f1cc6ebc6f4262df2494f605458b523251bf5e590bbcfda15ed963f0a814678135ce4cc2dca9a108d20c7
…se FromUserHex fuzz feature coverage

1eac96a Compare FromUserHex result against other hex validators and parsers (Lőrinc)
1994786 Use BOOST_CHECK_EQUAL for optional, arith_uint256, uint256, uint160 (Lőrinc)
743ac30 Add std::optional support to Boost's equality check (Lőrinc)

Pull request description:

  Enhanced `FromUserHex` coverage by:

  * Added `std::optional` support to `BOOST_CHECK_EQUAL`, allowing direct comparisons of `std::optional<T>` with other `T` expected values.
  * Increased fuzz testing for hex parsing to validate against other hex validators and parsers.

  ----

  * Use BOOST_CHECK_EQUAL for #30569 (comment) arith_uint256, uint256, uint160

  Example error before:
  > unknown location:0: fatal error: in "validation_chainstatemanager_tests/chainstatemanager_args": std::bad_optional_access: bad_optional_access
  test/validation_chainstatemanager_tests.cpp:781: last checkpoint

  after:
  > test/validation_chainstatemanager_tests.cpp:801: error: in "validation_chainstatemanager_tests/chainstatemanager_args": check set_opts({"-assumevalid=0"}).assumed_valid_block == uint256::ZERO has failed [std::nullopt != 0000000000000000000000000000000000000000000000000000000000000000]

ACKs for top commit:
  stickies-v:
    re-ACK 1eac96a
  ryanofsky:
    Code review ACK 1eac96a. Only changes since last review were auto type and fuzz test tweaks.
  hodlinator:
    ACK 1eac96a

Tree-SHA512: f1d2c65f0ee4e97830700be5b330189207b11ed0c89a8cebf0f97d43308402a6b3732e10130c79a0c044f7d2eeabfb5359990825aadf02c4ec19428dcd982b00
…f, LogConnectFailure

fa5bc45 util: Use compile-time check for LogConnectFailure (MarcoFalke)
fa7087b util: Use compile-time check for FatalErrorf (MarcoFalke)
faa62c0 util: Add ConstevalFormatString (MarcoFalke)
fae7b83 lint: Remove forbidden functions from lint-format-strings.py (MarcoFalke)

Pull request description:

  The `test/lint/lint-format-strings.py` was designed to count the number of format specifiers and assert that they are equal to the number of parameters passed to the format function. The goal seems reasonable, but the implementation has many problems:

  * It is written in Python, meaning that C++ code can not be parsed correctly. Currently it relies on brittle regex and string parsing.
  * Apart from the parsing errors, there are also many logic errors. For example, `count_format_specifiers` allows a mix of positional specifiers and non-positional specifiers, which can lead to runtime format bugs. Also, `count_format_specifiers` silently skipped over "special" format specifiers, which are valid in tinyformat, which again can lead to runtime format bugs being undetected.
  * The brittle logic has a history of breaking in pull requests that are otherwise fine. This causes the CI to fail and the pull request being blocked from progress until the bug in the linter is fixed, or the code is rewritten to work around the bug.
  * It is only run in the CI, or when the developer invokes the script. It would be better if the developer got the error message at compile-time, directly when writing the code.

  Fix all issues by using a `consteval` checked format string in `FatalErrorf` and `LogConnectFailure`.

  This is the first step toward #30530 and a follow-up will apply the approach to the other places.

ACKs for top commit:
  stickies-v:
    re-ACK fa5bc45
  l0rinc:
    ACK fa5bc45
  hodlinator:
    ACK fa5bc45
  ryanofsky:
    Code review ACK fa5bc45

Tree-SHA512: d6189096b16083143687ed1b1559cf4f92f97dd87bc5d00673e44f4fb9fce7bb7b215cfdfc39b6e6a24f0b75a79a03ededce966639e554f7172e1fc22cf015ae
Put the warning closer to where it is relevant. That is, put it close to
the functions that actually do unconditional logging.

Also, remove a stray empty line.
…meutxo

19f4a7c test: Wait for local services to update in feature_assumeutxo (Fabian Jahr)

Pull request description:

  Closes #30878

  It seems like there is a race where the block is stored locally and `getblock` does not error anymore, but `ActivateBestChain` has not finished yet, so the local services are not updated yet either. Fix this by waiting for the local services to update.

  Can be reproduced locally by adding the sleep here:

  ```cpp
  ──────────────────────────────────────────────────────────────────────────────────────────────────────────┐
  src/validation.cpp:3567: bool Chainstate::ActivateBestChain(BlockValidationState& state, std::shared_ptr< │
  ──────────────────────────────────────────────────────────────────────────────────────────────────────────┘
          }

          if (WITH_LOCK(::cs_main, return m_disabled)) {
              std::this_thread::sleep_for(std::chrono::seconds(10));
              // Background chainstate has reached the snapshot base block, so exit.

              // Restart indexes to resume indexing for all blocks unique to the snapshot
  ```

ACKs for top commit:
  maflcko:
    review-only ACK 19f4a7c
  achow101:
    ACK 19f4a7c
  pablomartin4btc:
    tACK 19f4a7c
  furszy:
    Code review ACK [19f4a7c](19f4a7c).

Tree-SHA512: 70dad3795988956c5e20f2d2d895fb56c5e3ce257c7547d3fd729c88949f0e24cb34594da1537bce8794ad02b2db44e7e46e995aa32539cd4dd84c4f1d4bb1c4
Before this commit, the worst case for linearization involves clusters which
break apart in several smaller components after the first candidate is
included in the output linearization.

Address this by never considering work items that span multiple components
of what remains of the cluster.
Add a DepGraph(depgraph, reordering) function that constructs a new DepGraph
corresponding to an old one, but with its transactions is a modified order
(given as a vector from old to new positions).

Also use this reordering feature inside DepGraphFormatter::Unser, which needs
a small modification so that its reordering mapping is old-to-new (rather than
the new-to-old it used before).
This is a requirement for a future commit, which will rely on quickly iterating
over transaction sets in decreasing individual feerate order.
…ion)

In each work item, keep track of a conservative overestimate of the best
possible feerate that can be reached from it, and then use these to avoid
exploring hopeless work items.
Keep track of which transactions in the graph have an individual
feerate that is better than the best included set so far. Others do not
need to be added to the pot set, as they cannot possibly help beating
best.
Automatically add topologically-valid subsets of the potential set pot
to inc. It can be proven that these must be part of the best reachable
topologically-valid set from that work item.

This is a crucial optimization that (apparently) reduces the maximum
number of iterations from ~2^(N-1) to ~sqrt(2^N).

Co-Authored-By: Suhas Daftuar <[email protected]>
Empirically, this approach seems to be more efficient in common real-life
clusters, and does not change the worst case.

Co-Authored-By: Suhas Daftuar <[email protected]>
Replaced multiple file writes with a single string template write.
The raw content is first grouped into 8 byte chunks, followed by another regex replace which wraps them in `std::byte`.

Tested the output with `diff -w` and they're the same - only whitespace differences because slightly different source formatting.

Tested the performance with:
> time cmake -DRAW_SOURCE_PATH=src/bench/data/block413567.raw -DHEADER_PATH=build/after/block413567.raw.h -DRAW_NAMESPACE=benchmark::data -P cmake/script/GenerateHeaderFromRaw.cmake

Before:
> 15.41s user 23.06s system 97% cpu 39.593 total
After:
> 0.77s user 0.06s system 97% cpu 0.849 total
Tested the performance with:
>  time cmake -DJSON_SOURCE_PATH=src/secp256k1/src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.json -DHEADER_PATH=build/after/ecdsa_secp256k1_sha256_bitcoin_test.json -P cmake/script/GenerateHeaderFromJson.cmake

Before:
> 3.57s user 6.01s system 94% cpu 10.136 total

After:
> 0.17s user 0.01s system 98% cpu 0.187 total
-BEGIN VERIFY SCRIPT-
sed -i 's/nLocalServices/m_local_services/g' src/net.h src/net.cpp
sed -i 's/connOptions.nLocalServices/connOptions.m_local_services/g' src/init.cpp
sed -i 's/nLocalServices/g_local_services/g' src/init.cpp
-END VERIFY SCRIPT-
This test checks m_log_sourcelocations, not the formatting with format
specifiers. Those are tested in logging_LogPrintMacros below.

So just use LogPrintStr directly in this test, without format specifiers
and format args.

This is required for a follow-up commit.
hebasto and others added 30 commits October 3, 2024 19:56
This change ensures compatibility across all supported Qt versions.

Co-Authored-By: João Barbosa <[email protected]>
…untryName`

9123a28 qt6: Handle deprecated `QLocale::nativeCountryName` (Hennadii Stepanov)

Pull request description:

  Split from #30997.

  [`QLocale::nativeCountryName()`](https://doc.qt.io/qt-6/qlocale-obsolete.html#nativeCountryName) has been deprecated since Qt 6.6.

  [`QLocale::nativeTerritoryName()`](https://doc.qt.io/qt-6/qlocale.html#nativeTerritoryName) was introduced in Qt 6.2.

  This PR ensures compatibility across all supported Qt versions.

  No behaviour change for the current codebase, which uses Qt 5.

  ---

  This PR can be tested on macOS using the first commit from #30997 and Homebrew's `qt` package.

ACKs for top commit:
  promag:
    Code review ACK 9123a28.
  jarolrod:
    ACK 9123a28

Tree-SHA512: 937258ab90f41077b0c9b1489e05104e3558b5da522b9dcd07fe373826aa671b2388539425f38c43fcde22419cdb8694cdcb04574d92b773acdb80f9a4fb1c02
5625840 qt6, test: Handle deprecated `QVERIFY_EXCEPTION_THROWN` (Hennadii Stepanov)
cb750b4 qt6, test: Use `qWarning()` instead of `QWARN()` macro (Hennadii Stepanov)

Pull request description:

  Split from #30997.

  This PR ensures compatibility across all supported Qt versions.

  ---

  This PR can be tested on macOS using the first commit from #30997 and Homebrew's `qt` package.

ACKs for top commit:
  promag:
    Code review ACK 5625840.
  Sjors:
    tACK 5625840

Tree-SHA512: e7307eaf0027c6addc9481ba91ed31b81554ffb0d2ba77938e68915c9d490a7962e55a330f97ea31d49bbfb30f92773c3af3afc867a4215d00752405d7e3bb6d
…ENABLE_WALLET=OFF`

5be34ba qt: Fix linking when configured with `-DENABLE_WALLET=OFF` (Hennadii Stepanov)

Pull request description:

  Split from #30997.

  When building with Qt 6 in my dev branch, I encountered a linker error when configured with `-DENABLE_WALLET=OFF`:
  ```
  $ cmake -B build -DENABLE_WALLET=OFF -DBUILD_GUI=ON
  $ cmake --build build -t bitcoin-qt
  <snip>
  [100%] Linking CXX executable bitcoin-qt
  /usr/bin/ld: libbitcoinqt.a(rpcconsole.cpp.o): in function `QtPrivate::MetaObjectForType<WalletModel const*, void>::metaObjectFunction(QtPrivate::QMetaTypeInterface const*)':
  /usr/include/x86_64-linux-gnu/qt6/QtCore/qmetatype.h:903:(.text._ZN9QtPrivate17MetaObjectForTypeIPK11WalletModelvE18metaObjectFunctionEPKNS_18QMetaTypeInterfaceE[_ZN9QtPrivate17MetaObjectForTypeIPK11WalletModelvE18metaObjectFunctionEPKNS_18QMetaTypeInterfaceE]+0x2b): undefined reference to `WalletModel::staticMetaObject'
  /usr/bin/ld: libbitcoinqt.a(rpcconsole.cpp.o): in function `QMetaTypeIdQObject<WalletModel const*, 8>::qt_metatype_id()':
  /usr/include/x86_64-linux-gnu/qt6/QtCore/qmetatype.h:1313:(.text._ZZN9QtPrivate16QMetaTypeForTypeIPK11WalletModelE17getLegacyRegisterEvENUlvE_4_FUNEv[_ZZN9QtPrivate16QMetaTypeForTypeIPK11WalletModelE17getLegacyRegisterEvENUlvE_4_FUNEv]+0x53): undefined reference to `WalletModel::staticMetaObject'
  collect2: error: ld returned 1 exit status
  gmake[3]: *** [src/qt/CMakeFiles/bitcoin-qt.dir/build.make:154: src/qt/bitcoin-qt] Error 1
  gmake[2]: *** [CMakeFiles/Makefile2:2107: src/qt/CMakeFiles/bitcoin-qt.dir/all] Error 2
  gmake[1]: *** [CMakeFiles/Makefile2:2114: src/qt/CMakeFiles/bitcoin-qt.dir/rule] Error 2
  gmake: *** [Makefile:998: bitcoin-qt] Error 2
  ```

  This PR resolves the issue.

ACKs for top commit:
  promag:
    ACK 5be34ba, all other changes in 33657e1c958146312e4c68765a92871920401396 are not required, makes the code harder to read.
  pablomartin4btc:
    tACK 5be34ba

Tree-SHA512: d10da665384e6539b8e9106dc905ba30e9e57cd4603fc7e5eb893fc899f55f26889c570687fa5daf55c6fc5bf4fcfcfcd9b70822cfe637f31f9151bb653b7941
This change ensures compatibility across all supported Qt versions.
f019fce doc: Archive 28.0 release notes (Ava Chow)

Pull request description:

  Matches the release notes on the website.

ACKs for top commit:
  laanwj:
    ACK f019fce
  tdb3:
    ACK f019fce

Tree-SHA512: 4d1932bf47cceea0c8cac7c1f28adbb47ad5b1f730977db343dd442563143f9f795f6c6509ab6cf2f37c0af8021a122e68d27a51c1ca7e451310f1d8d84e4ae6
98c1536 test: add getorphantxs tests (tdb3)
93f48fc test: add tx_in_orphanage() (tdb3)
34a9c10 rpc: add getorphantxs (tdb3)
f511ff3 refactor: move verbosity parsing to rpc/util (tdb3)
532491f net: add GetOrphanTransactions() to PeerManager (tdb3)
91b65ad refactor: add OrphanTxBase for external use (tdb3)

Pull request description:

  This PR adds a new hidden rpc, `getorphantxs`, that provides the caller with a list of orphan transactions.  This rpc may be helpful when checking orphan behavior/scenarios (e.g. in tests like `p2p_orphan_handling`) or providing additional data for statistics/visualization.

  ```
  getorphantxs ( verbosity )

  Shows transactions in the tx orphanage.

  EXPERIMENTAL warning: this call may be changed in future releases.

  Arguments:
  1. verbosity    (numeric, optional, default=0) 0 for an array of txids (may contain duplicates), 1 for an array of objects with tx details, and 2 for details from (1) and tx hex

  Result (for verbose = 0):
  [           (json array)
    "hex",    (string) The transaction hash in hex
    ...
  ]

  Result (for verbose = 1):
  [                          (json array)
    {                        (json object)
      "txid" : "hex",        (string) The transaction hash in hex
      "wtxid" : "hex",       (string) The transaction witness hash in hex
      "bytes" : n,           (numeric) The serialized transaction size in bytes
      "vsize" : n,           (numeric) The virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
      "weight" : n,          (numeric) The transaction weight as defined in BIP 141.
      "expiration" : xxx,    (numeric) The orphan expiration time expressed in UNIX epoch time
      "from" : [             (json array)
        n,                   (numeric) Peer ID
        ...
      ]
    },
    ...
  ]

  Result (for verbose = 2):
  [                          (json array)
    {                        (json object)
      "txid" : "hex",        (string) The transaction hash in hex
      "wtxid" : "hex",       (string) The transaction witness hash in hex
      "bytes" : n,           (numeric) The serialized transaction size in bytes
      "vsize" : n,           (numeric) The virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
      "weight" : n,          (numeric) The transaction weight as defined in BIP 141.
      "expiration" : xxx,    (numeric) The orphan expiration time expressed in UNIX epoch time
      "from" : [             (json array)
        n,                   (numeric) Peer ID
        ...
      ],
      "hex" : "hex"          (string) The serialized, hex-encoded transaction data
    },
    ...
  ]

  Examples:
  > bitcoin-cli getorphantxs 2
  > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getorphantxs", "params": [2]}' -H 'content-type: application/json' http://127.0.0.1:8332/
  ```
  ```
  $ build/src/bitcoin-cli getorphantxs 2
  [
    {
      "txid": "50128aac5deab548228d74d846675ad4def91cd92453d81a2daa778df12a63f2",
      "wtxid": "bb61659336f59fcf23acb47c05dc4bbea63ab533a98c412f3a12cb813308d52c",
      "bytes": 133,
      "vsize": 104,
      "weight": 415,
      "expiration": 1725663854,
      "from": [
        1
      ],
      "hex": "020000000001010b992959eaa2018bbf31a4a3f9aa30896a8144dbd5cfaf263bf07c0845a3a6620000000000000000000140fe042a010000002251202913b252fe537830f843bfdc5fa7d20ba48639a87c86ff837b92d083c55ad7c102015121c0000000000000000000000000000000000000000000000000000000000000000100000000"
    },
    {
      "txid": "330bb7f701604a40ade20aa129e9a3eb8a7bf024e599084ca1026d3222b9f8a1",
      "wtxid": "b7651f7d4c1a40c4d01f6a1e43a121967091fa0f56bb460146c1c5c068e824f6",
      "bytes": 133,
      "vsize": 104,
      "weight": 415,
      "expiration": 1725663854,
      "from": [
        2
      ],
      "hex": "020000000001013600adfe41e0ebd2454838963d270916d2b47239c9eebb93a992b720d3589a080000000000000000000140fe042a010000002251202913b252fe537830f843bfdc5fa7d20ba48639a87c86ff837b92d083c55ad7c102015121c0000000000000000000000000000000000000000000000000000000000000000100000000"
    }
  ]
  ```

ACKs for top commit:
  glozow:
    reACK 98c1536
  hodlinator:
    re-ACK 98c1536
  danielabrozzoni:
    ACK 98c1536
  pablomartin4btc:
    tACK 98c1536
  itornaza:
    reACK 98c1536

Tree-SHA512: 66075f9faa83748350b87397302100d08af92cbef5fadb27f2b4903f028c08020bf34a23e17262b41abb3f379ca9f46cf6cd5459b8681f2b83bffbbaf3c03ff9
…n Options Dialog (UI only, no functionality impact)

fee4cba gui: Fix proxy details display in Options Dialog (pablomartin4btc)

Pull request description:

  Currently, setting up a proxy (whether SOCKS5 or Tor) with an IPv6 address works correctly via the command line or configuration file in both `bitcoind` and `bitcoin-qt` (also from the UI the ipv6 address gets saved properly in `settings.json`). However, the UI does not reflect this properly, which can create confusion. Since some ISPs and VPNs still experience issues with IPv6, users may mistakenly think there is a problem with Bitcoin Core, when in fact the proxy setup is functioning as expected.

  So this PR ensures that the proxy IP is displayed correctly in the UI when using an IPv6 address.

  No functionality impact; changes only affect UI display.

  <details>
  <summary>Click her to see <b>before</b> and <b>after</b> screenshots.</summary>

  - Before:

    ![image](https://github.com/user-attachments/assets/073d9022-3174-4eef-8e0c-8c1b73b17226)

  - After:

    ![image](https://github.com/user-attachments/assets/293e4e07-83e5-44ec-8ab3-df9d1f601a6f)

  </details>

  ---

  <details>
  <summary>Test instructions</summary>

  (Ubuntu 22.04)

  1. Start ssh service on localhost.

     `ssh -D [::1]:1080 -f -C -q -N localhost`

  2. Check that the service is up and running.

     ```
     ps aux | grep ssh
     pepe    2860289  0.0  0.0  20456  5576 ?        Ss   06:59   0:00 ssh -D [::1]:1080 -f -C -q -N localhost
     ```

  3. Check with `bitcoind` if it works correctly.

     `bitcoind -onlynet=ipv6 -proxy=[::1]:1080`

  4. Check for established connections.

     ```
     netstat -natl |grep 1080
     tcp6       0      0 ::1:1080                :::*                    LISTEN
     tcp6       0      0 ::1:47610               ::1:1080                ESTABLISHED
     tcp6       0      0 ::1:1080                ::1:47610               ESTABLISHED
     tcp6       0      0 ::1:1080                ::1:47606               TIME_WAIT
     ```

     ```./build/src/bitcoin-cli getpeerinfo
     [
        {
          "id": 0,
          "addr": "[2a01:4f9:4a:2a07::2]:8333",
          "addrbind": "[::1]:47638",
          "network": "ipv6",
     ...
     ```

  5. Stop `bitcoind` and run `bitcoin-qt` adding the corresponding configuration in `settings.json`.

      ```
     {
         "onlynet": "ipv6",
         "proxy": "[::1]:1080",
     }
     ```

  6. Open the Peers window to check available connections or run `getpeerinfo` on the rpc-console window.

  7. Same can be done for Tor setting up `tor` service (I'll add instructions later) and configuring on its default port 9050 and forcing `"onlynet": "onion"` to verify easily the net traffic.

  </details>

  ---

  Thanks jarolrod and vasild for your help on validating ipv6 was not broken.

ACKs for top commit:
  vasild:
    ACK fee4cba
  promag:
    Code review ACK fee4cba.
  hebasto:
    ACK fee4cba, I have reviewed the code and it looks OK.

Tree-SHA512: 4be9052569ccb1e17ce94fb15691debf0651fa172ed1a83d60696d10f20d469b19d70a979b65322951f5783cd7582d55b39b669edb588e20404d8d10e767c49a
…le / variable names

deacf3c cmake: Avoid hardcoding Qt's major version in Find module (Hennadii Stepanov)

Pull request description:

  This PR facilitates future migration to Qt 6 and is a prerequisite for #30997.

  No behaviour change.

ACKs for top commit:
  l0rinc:
    utACK deacf3c
  promag:
    Code review ACK deacf3c.
  maflcko:
    lgtm ACK deacf3c

Tree-SHA512: 6991f30e9cf6a7103bfe91f8958246b17360210bf695ab620ca1c8b59565bf6192cc366036cf54f860ccc4d782b9c28899970978de79392c88a45ef149c06a79
…F::nativeEventFilter`

80761af qt6: Handle different signatures of `QANEF::nativeEventFilter` (Hennadii Stepanov)

Pull request description:

  Split from #30997.

  This PR ensures compatibility across all supported Qt versions.

  For more details, please refer to qt/qtbase@3b38c73.

  No behaviour change.

ACKs for top commit:
  maflcko:
    lgtm ACK 80761af
  promag:
    Code review ACK 80761af.

Tree-SHA512: a265e1c33cc7da37003bb0e6fd40950acb5e948ca9ec63a59a79c5e2a1894334f48d5565539c91d4d777b48a589366958df1498eaa6935e3b7fb534493adb51a
This should be long enough (with headroom) for our longest running tests,
which even under MSAN, TSAN, Valgrind, etc max out at about 800s.

i.e under Valgrind I see the longer runtimes as:
```bash
135/136 Test   #8: bench_sanity_check_high_priority .....   Passed  371.19 sec
136/136 Test #122: coinselector_tests ...................   Passed  343.39 sec
```

In the CI `tests` under TSAN:
```bash
tests ................................   Passed  795.20 sec
```
and MSAN:
```bash
tests ................................   Passed  658.48 sec
```

This will also prevent the current issue we are seeing of `ctest`
running until it reaches the CI timeout, see #30969.

However, we still need to figure out what underlying issue is causing
the tests to (sometimes) run for so long, but in the mean time, this
will stop `ctest` wasting our CI CPU.
This avoids special-casing macos
56aad83 ci: set a ctest timeout of 1200 (20 minutes) (fanquake)

Pull request description:

  This should be long enough (with headroom) for our longest running tests, which even under MSAN, TSAN, Valgrind, etc max out at about 800s.

  i.e under Valgrind I see the longer runtimes as:
  ```bash
  135/136 Test   #8: bench_sanity_check_high_priority .....   Passed  371.19 sec
  136/136 Test #122: coinselector_tests ...................   Passed  343.39 sec
  ```

  In the CI `tests` [under TSAN](https://cirrus-ci.com/task/6321297691508736?logs=ci#L2520):
  ```bash
  tests ................................   Passed  795.20 sec
  ```
  [and MSAN](https://cirrus-ci.com/task/4913922807955456?logs=ci#L2226):
  ```bash
  tests ................................   Passed  658.48 sec
  ```

  This will also prevent the current issue we are seeing of `ctest` running until it reaches the CI timeout, see #30969.

  We still need to figure out what underlying issue is causing the tests to (sometimes) run for so long, but in the mean time, this will stop `ctest` wasting our CI CPU. It should also make it more clear in the logs, exactly which test is the one that is hitting the timeout.

ACKs for top commit:
  maflcko:
    review ACK 56aad83
  tdb3:
    re ACK 56aad83

Tree-SHA512: 43c0dc12b8b12b1d9804751a9816935e2abbe962b451e12a268f2d2c430bc568b83995dbc405f100b596dfb0f1e9f65b78074de98916592d3ae4ebc2126e3a6c
This has been unused since #29648.
Noticed while running a newer version of clang-tidy (19.1.1):
```bash
[127/391][6.2s] /opt/homebrew/opt/llvm/bin/clang-tidy -p=build -quiet --config-file=/bitcoin/src/.clang-tidy /bitcoin/src/test/script_tests.cpp
bitcoin/src/test/script_tests.cpp:126:25: error: local copy 'tx2' of the variable 'tx' is never modified and never used; consider removing the statement [performance-unnecessary-copy-initialization,-warnings-as-errors]
  126 |     CMutableTransaction tx2 = tx;
      |     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
  127 |     BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, &scriptWitness, flags, MutableTransactionSignatureChecker(&tx, 0, txCredit.vout[0].nValue, MissingDataBehavior::ASSERT_FAIL), &err) == expect, message);
512 warnings generated.
```
…ake invocation

605926d depends: Print ready-to-use `--toolchain` option for CMake invocation (Hennadii Stepanov)

Pull request description:

  Requested in #30997 (comment):
  > P.S. it would be nice if `make` in `depends` provides the incantation needed for the configure stage.

  An example of a build log with this PR:
  ```
  $ make --no-print-directory -C depends -j16 NO_QT=1 NO_WALLET=1 NO_UPNP=1 NO_NATPMP=1 NO_ZMQ=1 NO_USDT=1 LOG=1
  Extracting boost...
  /home/hebasto/git/bitcoin/depends/sources/boost_1_81_0.tar.gz: OK
  Preprocessing boost...
  Configuring boost...
  Building boost...
  Staging boost...
  Postprocessing boost...
  Caching boost...
  Extracting libevent...
  /home/hebasto/git/bitcoin/depends/sources/libevent-2.1.12-stable.tar.gz: OK
  Preprocessing libevent...
  Configuring libevent...
  Building libevent...
  Staging libevent...
  Postprocessing libevent...
  Caching libevent...
  copying packages: boost libevent
  to: /home/hebasto/git/bitcoin/depends/x86_64-pc-linux-gnu
  To build Bitcoin Core with these packages, pass '--toolchain /home/hebasto/git/bitcoin/depends/x86_64-pc-linux-gnu/toolchain.cmake' to the first CMake invocation.
  ```

ACKs for top commit:
  Sjors:
    tACK 605926d
  theuni:
    ACK 605926d
  jarolrod:
    ACK 605926d
  pablomartin4btc:
    ACK 605926d

Tree-SHA512: 658358cb12a2409486962273d418f8cfa9609c84c6e70b426250173925c0938a6eba0dca72f43d78cc63c9cb927514c959473da04bdcda714228c5d8c248c1fe
e0287bc test: remove unused code from script_tests (fanquake)

Pull request description:

  This has been unused since #29648. Noticed while running a newer version of clang-tidy (19.1.1):
  ```bash
  [127/391][6.2s] /opt/homebrew/opt/llvm/bin/clang-tidy -p=build -quiet --config-file=/bitcoin/src/.clang-tidy /bitcoin/src/test/script_tests.cpp
  bitcoin/src/test/script_tests.cpp:126:25: error: local copy 'tx2' of the variable 'tx' is never modified and never used; consider removing the statement [performance-unnecessary-copy-initialization,-warnings-as-errors]
    126 |     CMutableTransaction tx2 = tx;
        |     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
    127 |     BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, &scriptWitness, flags, MutableTransactionSignatureChecker(&tx, 0, txCredit.vout[0].nValue, MissingDataBehavior::ASSERT_FAIL), &err) == expect, message);
  512 warnings generated.
  ```

ACKs for top commit:
  maflcko:
    review ACK e0287bc
  BrandonOdiwuor:
    ACK e0287bc

Tree-SHA512: f69513d0b898e0e9afad047bcec200707b057e3718a3d35bd479a788a1973e49ee7e5f48feadb8731ab5fdbd12a2b53b0bcf65296701e2296c3fdb67cdcabfb5
…ent library conflict

ae56b32 depends: For mingw cross compile use -gcc-posix to prevent library conflict (laanwj)

Pull request description:

  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.

ACKs for top commit:
  theuni:
    utACK ae56b32.
  hebasto:
    ACK ae56b32. I've tested on both Debian Bookworm and Ubuntu 24.04 with the `g++-mingw-w64-x86-64` package installed. The resulting CMake internal configuration appears more accurate. For instance, on Ubuntu 24.04, for the `bitcoin-tx` target, the diff in `build/src/CMakeFiles/bitcoin-tx.dir/linkLibs.rsp` looks as follows:

Tree-SHA512: f36fae50f91a29f565940494af9e46f47e219b99e329c0714ace47c516ac524602d5b6538a07488157bc2a71be7bac72176097fff3178129c5084bf6cc823167
fa5ebc9 ci: Double ctest timeout (MarcoFalke)

Pull request description:

  It looks like msan sometimes hits the timeout. So double it, which should still be useful to catch real timeouts in the wine windows-cross unit tests.

  Example: https://cirrus-ci.com/task/5141974322249728

ACKs for top commit:
  fanquake:
    ACK fa5ebc9

Tree-SHA512: de346f34c4d157be515706fd71c2072fb5859d50d0e8cd7e6c4637578e4dc54aa8c75b2521e7aecf679b486c4e20fd184e259ffc701b8b668d7f61abff883875
…erator

f50557f test: Fix copy-paste in db_tests ostream operator (Hodlinator)

Pull request description:

  Fix accidentally remaining copy-pasted variable name.

  Example output when intentionally adding `expected.erase(expected.begin());` before `BOOST_CHECK_EQUAL_COLLECTIONS` in *db_tests.cpp*/`CheckPrefix`:

  Before fix:
  ```
  src/wallet/test/db_tests.cpp(61): error: in "db_tests/db_cursor_prefix_byte_test": check { actual.begin(), actual.end() } == { expected.begin(), expected.end() } has failed.
  Mismatch at position 0: ("�", "�") != ("�suffix", "�suffix")
  Mismatch at position 1: ("�suffix", "�suffix") != ("��", "��")
  Mismatch at position 2: ("��", "��") != ("��suffix", "��suffix")
  Collections size mismatch: 4 != 3
  ```

  After fix:
  ```
  src/wallet/test/db_tests.cpp(61): error: in "db_tests/db_cursor_prefix_byte_test": check { actual.begin(), actual.end() } == { expected.begin(), expected.end() } has failed.
  Mismatch at position 0: ("�", "f") != ("�suffix", "fs")
  Mismatch at position 1: ("�suffix", "fs") != ("��", "ff")
  Mismatch at position 2: ("��", "ff") != ("��suffix", "ffs")
  Collections size mismatch: 4 != 3
  ```

  Super-minor issue only uncovered when tests fail, but might as well correct it.

ACKs for top commit:
  maflcko:
    lgtm ACK f50557f
  tdb3:
    code review ACK f50557f

Tree-SHA512: d36e9bc36f82f2c39e9c7585ae9e5c63f7fd07665d1d3c625709bc90168ced2f83ac7d577b4914dae2f0f101c415bf0c1ed6de98a20c96c8c0383a701cbdbe99
fa6d14e test: Treat exclude list warning as failure in CI (MarcoFalke)

Pull request description:

  An outdated exclude list or otherwise an error in the exclude list handling is usually a bug.

  So make it fatal in the CI, instead of silently ignoring it.

  Fixes https://github.com/bitcoin/bitcoin/pull/30872/files#r1757015334

  Can be tested with something like (with and without `--ci`):

  ```
  ./bld-cmake/test/functional/test_runner.py wallet_disable -x wallet_disablee

ACKs for top commit:
  tdb3:
    ACK fa6d14e
  ismaelsadeeq:
    utACK fa6d14e

Tree-SHA512: 03a70dff9d1272d982591d60ab764f9233d4802488bc1bad305a2755e2d7ed86e691ee94767a3bc5f68321b63214aba44e6f9edd1543dfad7a20f9397cf78734
fa1cffa ci: Install missing nproc in macos task (MarcoFalke)
faf7a2b ci: Add missing -DWERROR=ON to test-each-commit (MarcoFalke)

Pull request description:

  Found by in Sjors in #27260 (comment) (Thanks!)

  Also, includes an unrelated commit to simplify the ci scripts, by assuming nproc exists on macos as well. (Having more than one commit is also required to trigger the `test-each-commit` task)

ACKs for top commit:
  theuni:
    utACK fa1cffa.

Tree-SHA512: 881df6964da31c3f7161b763bdf74029743567272c7a4db24ded10909a8cedad39b494a9f486f0b059bbeb0beb190dcd91369650d014e1fc3b5f7ae07cd54771
…ility.py

fae44c8 test: Remove 0.16.3 test from wallet_backwards_compatibility.py (MarcoFalke)

Pull request description:

  The test checks that any wallet created with current master can not be loaded with `v0.16.3`. This is interesting documentation, however it is probably not something to keep as a test, because:

  * It seems like an extremely unlikely (and unsupported) edge case that someone creates a wallet with master and then goes ahead to open it with a long EOL software version.
  * A better test would be the inverse: Create a wallet with `v0.16.3` and open it with current master. This is already tested in `wallet_upgradewallet.py`, where I've added an additional balance check before upgrading the `v0.16.3` wallet.
  * The test is intermittently failing when shutting down the `v0.16.3` node, for example in #30875 (comment). The exact cause is unclear, but given that the test isn't worthy to keep, removing it will ensure that the error disappears.

ACKs for top commit:
  Sjors:
    utACK fae44c8
  fanquake:
    ACK fae44c8 - I agree that test seems to have past it's usefulness, and the fact that it otherwise causes intemittent issues is further reason to remove it.

Tree-SHA512: 85bf428e616e0880198c1a7529936520505d7fa87c2eeb87a0457f13b50a163accaf5f80f9364dea978f6bd14b0b5350cda88f49aa7584682c8b5e0b0b117724
…ovalReasonToString

This was not in its own header when it was added, but now that it is the
forward-declare makes no sense.
fa22e5c refactor: Remove dead code that assumed tip == nullptr (MarcoFalke)
fa2e443 refactor: Replace g_genesis_wait_cv with m_tip_block_cv (MarcoFalke)
fa7f52a refactor: Use wait_for predicate to check for interrupt (MarcoFalke)
5ca28ef refactor: Split up NodeContext shutdown_signal and shutdown_request (Ryan Ofsky)
fad8e7f bugfix: Mark m_tip_block_cv as guarded by m_tip_block_mutex (MarcoFalke)
fa18586 refactor: Add missing GUARDED_BY(m_tip_block_mutex) (MarcoFalke)
fa4c075 doc: Clarify waitTipChanged docs (MarcoFalke)

Pull request description:

  `g_genesis_wait_cv` is similar to `m_tip_block_cv` but shuffling everything through a redundant `boost::signals2`.

  So remove it, along with some other dead code, as well as minor fixups.

ACKs for top commit:
  ryanofsky:
    Code review ACK fa22e5c (just rebased since last review)
  Sjors:
    ACK fa22e5c
  TheCharlatan:
    ACK fa22e5c

Tree-SHA512: a2cb59b651aaf85a3574723adfe403487566788ad945933b0458816ccc841fce08ca77b31afbd2d6adb5bf1deed7229c028bee74fb4bbaf6576e9edcfa0ad817
33381ea scripted-diff: Modernize nLocalServices to m_local_services (Fabian Jahr)

Pull request description:

  The type of the `nLocalServices` variable was changed to `std::atomic<ServiceFlags>` in #30807 and I suggested the variable name to get updated with a scripted diff along with it. It wasn't included in the PR but I am still suggesting to do it as a follow-up since I had already prepared the commit.

ACKs for top commit:
  sipa:
    utACK 33381ea
  achow101:
    ACK 33381ea
  furszy:
    utACK 33381ea
  jonatack:
    ACK 33381ea
  theStack:
    ACK 33381ea

Tree-SHA512: 407ea9eac694f079aa5b5c1611b5874d7a0897ba6bc3aa0570be94afe1bf3a826657b6890b6597c03c063e95b9dc868f0bdfbfc41e77ec7e06f5b045bf065c71
…-declaring RemovalReasonToString

ca2e4ba refactor: include the proper header rather than forward-declaring RemovalReasonToString (Cory Fields)

Pull request description:

  Trivial no-op fixup.

  This was pointed out by #31053, which causes the include order to be shuffled around:

  ```
  [21:49:26.130] /ci_container_base/src/validationinterface.cpp:22:13: error: redundant 'RemovalReasonToString' declaration [readability-redundant-declaration,-warnings-as-errors]
  [21:49:26.130]    22 | std::string RemovalReasonToString(const MemPoolRemovalReason& r) noexcept;
  [21:49:26.130]       | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  [21:49:26.130] /ci_container_base/src/kernel/mempool_removal_reason.h:22:13: note: previously declared here
  [21:49:26.130]    22 | std::string RemovalReasonToString(const MemPoolRemovalReason& r) noexcept;
  [21:49:26.130]       |             ^
  ```

  I don't see any reason why the include shouldn't just be used.

ACKs for top commit:
  maflcko:
    lgtm ACK ca2e4ba
  hebasto:
    ACK ca2e4ba, IWYU seems [agree](https://cirrus-ci.com/task/6170839912022016):
  TheCharlatan:
    ACK ca2e4ba

Tree-SHA512: e3584cae4f50bf2bc6c824bfaddfe683ef6a17d16138d0cbcc544b98bd64d5d7353b0826b1e8cf16e12410e27b0fcedde27100d4241b7cc194cd4465c8175a5b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.