27871 Commits

Author SHA1 Message Date
Lőrinc
794180e8f8 refactor: reduce template bloat in primitive serialization
Merged multiple template methods into single constexpr-delimited implementation to reduce template bloat (i.e. related functionality is grouped into a single method, but can be optimized because of C++20 constexpr conditions).
This unifies related methods that were only bound before by similar signatures - and enables `SizeComputer` optimizations later
2025-03-12 19:16:07 +01:00
Lőrinc
99b2c2a862 bench: measure block (size)serialization speed
The SizeComputer is a special serializer which returns what the exact final size will be of the serialized content.

> cmake -B build -DBUILD_BENCH=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j$(nproc) && build/src/bench/bench_bitcoin -filter='SizeComputerBlock|SerializeBlock|DeserializeBlock' --min-time=10000

> C compiler ............................ AppleClang 16.0.0.16000026

|            ns/block |             block/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|          936,285.45 |            1,068.05 |    0.1% |     11.01 | `DeserializeBlock`
|          194,330.04 |            5,145.88 |    0.2% |     10.97 | `SerializeBlock`
|           12,215.05 |           81,866.19 |    0.0% |     11.00 | `SizeComputerBlock`

> C++ compiler .......................... GNU 13.3.0

|            ns/block |             block/s |    err% |       ins/block |       cyc/block |    IPC |      bra/block |   miss% |     total | benchmark
|--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
|        4,447,243.87 |              224.86 |    0.0% |   53,689,737.58 |   15,966,336.86 |  3.363 |   2,409,315.46 |    0.5% |     11.01 | `DeserializeBlock`
|          869,833.14 |            1,149.65 |    0.0% |    8,015,883.90 |    3,123,013.80 |  2.567 |   1,517,035.87 |    0.5% |     10.81 | `SerializeBlock`
|           26,535.51 |           37,685.36 |    0.0% |      225,261.03 |       95,278.40 |  2.364 |      53,037.03 |    0.6% |     11.00 | `SizeComputerBlock`
2025-03-12 19:16:07 +01:00
Lőrinc
bb9cb81607 optimization: Xor 64 bits together instead of byte-by-byte
`util::Xor` method was split out into more focused parts:
* one which assumes tha the `uint64_t` key is properly aligned, doing the first few xors as 64 bits (the memcpy is eliminated in most compilers), and the last iteration is optimized for 8/16/32 bytes.
* an unaligned `uint64_t` key with a `key_offset` parameter which is rotated to accommodate the data (adjusting for endianness).
* a legacy `std::vector<std::byte>` key with an asserted 8 byte size, converted to `uint64_t`.

Note that the default statement alone would pass the tests, but would be very slow, since the 1, 2 and 4 byte versions won't be specialized by the compiler, hence the switch.

Asserts were added throughout the code to make sure every such vector has length 8, since in the next commit we're converting all of them to `uint64_t`.

refactor: Migrate fixed-size obfuscation end-to-end from `std::vector<std::byte>` to `uint64_t`

Since `util::Xor` accepts `uint64_t` values, we're eliminating any repeated vector-to-uint64_t conversions going back to the loading/saving of these values (we're still serializing them as vectors, but converting as soon as possible to `uint64_t`). This is the reason the tests still generate vector values and convert to `uint64_t` later instead of generating it directly.

We're also short-circuit `Xor` calls with 0 key values early to avoid unnecessary calculations (e.g. `MakeWritableByteSpan`) - even assuming that XOR is never called for 0.

>  cmake -B build -DBUILD_BENCH=ON -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build -j$(nproc) \
&& build/src/bench/bench_bitcoin -filter='XorHistogram|AutoFileXor' -min-time=10000

C++ compiler .......................... AppleClang 16.0.0.16000026

|             ns/byte |              byte/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|                0.09 |   10,799,585,470.46 |    1.3% |     11.00 | `AutoFileXor`
|                0.14 |    7,144,743,097.97 |    0.2% |     11.01 | `XorHistogram`

C++ compiler .......................... GNU 13.2.0

|             ns/byte |              byte/s |    err% |        ins/byte |        cyc/byte |    IPC |       bra/byte |   miss% |     total | benchmark
|--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
|                0.59 |    1,706,433,032.76 |    0.1% |            0.00 |            0.00 |  0.620 |           0.00 |    1.8% |     11.01 | `AutoFileXor`
|                0.47 |    2,145,375,849.71 |    0.0% |            0.95 |            1.48 |  0.642 |           0.20 |    9.6% |     10.93 | `XorHistogram`

----

A few other benchmarks that seem to have improved as well (tested with Clang only):
Before:

|               ns/op |                op/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|        2,237,168.64 |              446.99 |    0.3% |     10.91 | `ReadBlockFromDiskTest`
|          748,837.59 |            1,335.40 |    0.2% |     10.68 | `ReadRawBlockFromDiskTest`

After:

|               ns/op |                op/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|        1,827,436.12 |              547.21 |    0.7% |     10.95 | `ReadBlockFromDiskTest`
|           49,276.48 |           20,293.66 |    0.2% |     10.99 | `ReadRawBlockFromDiskTest`
2025-03-12 19:16:07 +01:00
Lőrinc
8ce0670506 bench: Make Xor benchmark more representative
To make the benchmarks representative, I've collected the write-vector's sizes during IBD for every invocation of `util::Xor` until 860k blocks, and used it as a basis for the micro-benchmarks, having a similar distribution of random data (taking the 1000 most frequent ones, making sure the very big ones are also covered).

And even though we already have serialization tests, `AutoFileXor` was added to serializing 1 MB via the provided key_bytes.
This was used to test the effect of disabling obfuscation.

>  cmake -B build -DBUILD_BENCH=ON -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build -j$(nproc) \
&& build/src/bench/bench_bitcoin -filter='XorHistogram|AutoFileXor' -min-time=10000

C++ compiler .......................... AppleClang 16.0.0.16000026

|             ns/byte |              byte/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|                1.07 |      937,527,289.88 |    0.4% |     10.24 | `AutoFileXor`
|                0.87 |    1,149,859,017.49 |    0.3% |     10.80 | `XorHistogram`

C++ compiler .......................... GNU 13.2.0

|             ns/byte |              byte/s |    err% |        ins/byte |        cyc/byte |    IPC |       bra/byte |   miss% |     total | benchmark
|--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
|                1.87 |      535,253,389.72 |    0.0% |            9.20 |            3.45 |  2.669 |           1.03 |    0.1% |     11.02 | `AutoFileXor`
|                1.70 |      587,844,715.57 |    0.0% |            9.35 |            5.41 |  1.729 |           1.05 |    1.7% |     10.95 | `XorHistogram`
2025-03-12 19:16:07 +01:00
Lőrinc
34afcc90c0 test: Compare util::Xor with randomized inputs against simple impl
Since production code only uses keys of length 8, we're not testing with other values anymore
2025-03-12 19:16:07 +01:00
Lőrinc
d0a86b343d log: unify error messages for (read/write)[undo]block
Co-authored-by: maflcko <6399679+maflcko@users.noreply.github.com>
2025-03-12 19:16:07 +01:00
Lőrinc
23ed684c6a optimization: Bulk serialization writes in SaveBlockUndo and SaveBlock
Similarly to the serialization reads, buffered writes will enable batched xor calculations - especially since currently we need to copy the write inputs Span to do the obfuscation on it, batching enables doing the xor on the internal buffer instead.

> cmake -B build -DBUILD_BENCH=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j$(nproc) && build/src/bench/bench_bitcoin -filter='SaveBlockBench' -min-time=10000

> C++ compiler .......................... AppleClang 16.0.0.16000026

Before:
|               ns/op |                op/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|        5,267,613.94 |              189.84 |    1.0% |     11.05 | `SaveBlockBench`

After:
|               ns/op |                op/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|        1,767,367.40 |              565.81 |    1.6% |     10.86 | `SaveBlockBench`

> C++ compiler .......................... GNU 13.3.0

Before:
|               ns/op |                op/s |    err% |          ins/op |          cyc/op |    IPC |         bra/op |   miss% |     total | benchmark
|--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
|        4,128,530.90 |              242.22 |    3.8% |   19,358,001.33 |    8,601,983.31 |  2.250 |   3,079,334.76 |    0.4% |     10.64 | `SaveBlockBench`

After:
|               ns/op |                op/s |    err% |          ins/op |          cyc/op |    IPC |         bra/op |   miss% |     total | benchmark
|--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
|        3,130,556.05 |              319.43 |    4.7% |   17,305,378.56 |    6,457,946.37 |  2.680 |   2,579,854.87 |    0.3% |     10.83 | `SaveBlockBench`

Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>
2025-03-12 19:16:07 +01:00
Lőrinc
e18c96a3fe Add AutoFile::write_large for batching obfuscation operations
Instead of copying the data and doing the xor in a 4096 byte array, we're doing it directly on the input.

`DataStream` constructor was also added to enable presized serialization and writing in a single command.
2025-03-12 19:16:07 +01:00
Lőrinc
edb2575fb6 optimization: Bulk serialization reads in UndoRead and ReadBlock
The Obfuscation (XOR) operations are currently done byte-by-byte during serialization, buffering the reads will enable batching the obfuscation operations later (not yet done here).

Also, different operating systems seem to handle file caching differently, so reading bigger batches (and processing those from memory) is also a bit faster (likely because of fewer native fread calls or less locking).

Since `ReadBlock[Undo]` is called with the file position being set after the [undo]block size, we have to start by backtracking 4 bytes to be able to read the expected size first.
As a consequence, the `FlatFilePos pos` parameter in `ReadBlock` is copied now.

`HashVerifier` was included in the try/catch to include the `undo_size` serialization there as well since the try is about `Deserialize` errors. This is why the final checksum verification was also included in the try.

> cmake -B build -DBUILD_BENCH=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j$(nproc) && build/src/bench/bench_bitcoin -filter='ReadBlockBench' -min-time=10000

> C++ compiler .......................... AppleClang 16.0.0.16000026

Before:
|               ns/op |                op/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|        2,289,743.62 |              436.73 |    0.3% |     11.03 | `ReadBlockBench`

After:
|               ns/op |                op/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|        1,724,703.14 |              579.81 |    0.4% |     11.06 | `ReadBlockBench`

> C++ compiler .......................... GNU 13.3.0

Before:
|               ns/op |                op/s |    err% |          ins/op |          cyc/op |    IPC |         bra/op |   miss% |     total | benchmark
|--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
|        7,786,309.20 |              128.43 |    0.0% |   70,832,812.80 |   23,803,523.16 |  2.976 |   5,073,002.56 |    0.4% |     10.72 | `ReadBlockBench`

After:
|               ns/op |                op/s |    err% |          ins/op |          cyc/op |    IPC |         bra/op |   miss% |     total | benchmark
|--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
|        6,272,557.28 |              159.42 |    0.0% |   63,251,231.42 |   19,739,780.92 |  3.204 |   3,589,886.66 |    0.3% |     10.57 | `ReadBlockBench`

Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>
2025-03-12 19:16:07 +01:00
merge-script
8cb6ab0b97
Merge bitcoin/bitcoin#32025: validation, fix: Use wtxid instead of txid in CheckEphemeralSpends
e637dc2c01c3b566e6c51c911c5881a8d206c924 refactor: Replace uint256 type with Wtxid in PackageMempoolAcceptResult struct (marcofleon)
a3baead7cb8376e3b09f1726b8c466648d187524 validation: use wtxid instead of txid in CheckEphemeralSpends (marcofleon)

Pull request description:

  This PR addresses a small bug in [`AcceptMultipleTransactions`](45719390a1/src/validation.cpp (L1598)) where a txid was being inserted into a map that should only hold wtxids.  `CheckEphemeralSpends` has an out parameter on failure that records that the child transaction did not spend the parent's dust. Instead of using the txid of this child, use its wtxid.

  The second commit in this PR is a refactor of the `PackageMempoolAcceptResult` struct to use the `Wtxid` type instead of `uint256`. This helps to prevent errors like this in the future.

ACKs for top commit:
  instagibbs:
    ACK e637dc2c01
  glozow:
    ACK e637dc2c01c, hooray for type safety
  dergoegge:
    Code review ACK e637dc2c01c3b566e6c51c911c5881a8d206c924

Tree-SHA512: 17039efbb241b7741e2610be5a6d6f88f4c1cbe22d476931ec99e43f993d259a1a5e9334e1042651aff49edbdf7b9e1c1cd070a28dcba5724be6db842e4ad1e0
2025-03-12 19:57:58 +08:00
merge-script
502d47203e
Merge bitcoin/bitcoin#31161: cmake: Set top-level target output locations
568fcdddaec2cc8decba5a098257f31729cc1caa scripted-diff: Adjust documentation per top-level target output location (Hennadii Stepanov)
026bb226e96919603af829d0b677779a234a0f6e cmake: Set top-level target output locations (Hennadii Stepanov)

Pull request description:

  This PR sets the target output locations to the `bin` and `lib` subdirectories within the build tree, creating a directory structure that mirrors that of the installed targets.

  This approach is widely adopted by the large projects, such as [LLVM](e146c1867e/lldb/cmake/modules/LLDBStandalone.cmake (L128-L130)):
  ```cmake
  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
  ```

  The `libsecp256k1` project has also recently [adopted](https://github.com/bitcoin-core/secp256k1/pull/1553) this approach.

  With this PR, all binaries are conveniently located. For example, run:
  ```
  $ ./build/bin/fuzz
  ```
  instead of:
  ```
  $ ./build/src/test/fuzz/fuzz
  ```

  On Windows, all required DLLs are now located in the same directory as the executables, allowing to run `bitcoin-chainstate.exe` (which loads `bitcoinkernel.dll`) without the need to copy DLLs or modify the `PATH` variable.

  The idea was briefly discussed among the build team during the recent CoreDev meeting.

  ---

  **Warning**: This PR changes build locations of newly built executables like `bitcoind` and `test_bitcoin` from `src/` to `bin/` without deleting previously built executables. A clean build is recommended to avoid accidentally running old binaries.

ACKs for top commit:
  theStack:
    Light re-ACK 568fcdddaec2cc8decba5a098257f31729cc1caa
  ryanofsky:
    Code review ACK 568fcdddaec2cc8decba5a098257f31729cc1caa. Only change since last review was rebasing. I'm ok with this PR in its current form if other developers are happy with it. I just personally think it is inappropriate to \*silently\* break an everyday developer workflow like `git pull; make bitcoind`. I wouldn't have a problem with this PR if it triggered an explicit error, or if the problem was limited to less common workflows like changing cmake options in an existing build.
  TheCharlatan:
    Re-ACK 568fcdddaec2cc8decba5a098257f31729cc1caa
  theuni:
    ACK 568fcdddaec2cc8decba5a098257f31729cc1caa

Tree-SHA512: 1aa5ecd3cd49bd82f1dcc96c8e171d2d19c58aec8dade4bc329df89311f9e50cbf6cf021d004c58a0e1016c375b0fa348ccd52761bcdd179c2d1e61c105e3b9f
2025-03-12 11:19:00 +08:00
merge-script
1d0a1a60e8
Merge bitcoin/bitcoin#32004: qt: 29.0 translations update
9132824947005421057f6a5f035082c7b99f3853 qt: 29.0 translations update (Hennadii Stepanov)

Pull request description:

  This PR follows our [Release Process](bd0ee07310/doc/release-process.md) and concludes the translation-specific efforts for this release cycle. It follows two previous translation-related PRs, https://github.com/bitcoin/bitcoin/pull/31809 and https://github.com/bitcoin-core/gui/pull/854.

  It is one of the steps required _before_ branch-off, as scheduled in https://github.com/bitcoin/bitcoin/issues/31029.

  The previous similar PR: https://github.com/bitcoin/bitcoin/pull/30715.

  **Notes for reviewers:**
  1. This is the first release process conducted after migrating the build system to CMake. The [bitcoin-maintainer-tools/update-translations.py](https://github.com/bitcoin-core/bitcoin-maintainer-tools/blob/main/update-translations.py) tool, which is used to fetch translations from [Transifex.com](https://www.transifex.com/bitcoin/bitcoin), still generates the no-longer-needed  `src/Makefile.qt_locale.include` file. Please ignore it.
  2. The actual translations on Transifex is a moving target. Therefore, your diff after running [`bitcoin-maintainer-tools/update-translations.py`](https://github.com/bitcoin-core/bitcoin-maintainer-tools/blob/main/update-translations.py) might differ.
  3. The translations for the following languages, which appear to be the result of a mistake or an act of vandalism, have been discarded:
      - Czech (cs)
      - Danish (da)
      - Dutch (nl)
  4. Changes to the Thai (th) translation have been discarded due to multiple unsolicited pronunciation notes.

ACKs for top commit:
  glozow:
    ACK 9132824947005421057f6a5f035082c7b99f3853

Tree-SHA512: 560dbd587eec563fa26f2ff07d950c2e86b89a7768deef7397aee80d527ad4b10c1f17d4abab6ecfcffd143e3a2d2a4e45b453197ad19c1a64087f98ab80ed4d
2025-03-12 09:20:08 +08:00
Hennadii Stepanov
9132824947
qt: 29.0 translations update
The translations for the following languages, which appear to be the
result of a mistake or an act of vandalism, have been discarded:
- Czech (cs)
- Danish (da)
- Dutch (nl)

Changes to the Thai (th) translation have been discarded due to multiple
unsolicited pronunciation notes.
2025-03-11 17:35:36 +00:00
marcofleon
e637dc2c01 refactor: Replace uint256 type with Wtxid in PackageMempoolAcceptResult struct 2025-03-11 16:00:54 +00:00
marcofleon
a3baead7cb validation: use wtxid instead of txid in CheckEphemeralSpends 2025-03-11 16:00:46 +00:00
glozow
dbc89b604c
Merge bitcoin/bitcoin#31960: seeds: add signet/testnet4, update makeseeds regex, minblocks, fixed seeds
f0b659716bd455dca02053df573d888b5a115aa4 seeds: update .gitignore with signet and testnet4 (Jon Atack)
48f07ac9da4dfdd379d58cd67637bf195d6698d1 chainparams: remove hardcoded signet seeds (Jon Atack)
d4ab1150c4016282b59574ce2609cfc4a01851c5 chainparams: add signet fixed seeds if default network (Jon Atack)
49f155efbfb65ab60c7c67597f68489893015c71 seeds: update fixed dns seeds (Jon Atack)
236687083fb9e0daa9f9b66c5d86c6f3985f343a makeseeds: regex improvements (Lőrinc)
98f84d6c233385c3ee8d9a300f7f7be597b2768b generate-seeds: update and add signet (Jon Atack)
c4ed23e53987b4b7190cc6f8aa0519eb4fcc21aa seeds: add testnet4 seeds (Jon Atack)
60f17dd8167054410236b34318446bdfa10854e3 seeds: add signet seeds (Jon Atack)
2bcccaa41077d2086a350e54aff66341b96ad796 makeseeds: align I2P column header (Jon Atack)
94e21aa5fc5e06dbf9aefeaad44fe401a4250974 makeseeds: update MIN_BLOCKS, add reminder to README (Jon Atack)
6ae7a3bc4e7bfc8fe446be0a5527b0417a23276c makeseeds: update user agent regex (Jon Atack)
9b0d2e5094626ff21c7ace6b29888ada90c43060 makeseeds: fix incorrect regex (laanwj)

Pull request description:

  In `makeseeds.py`:
  - fix the user agent regex (by laanwj)
  - fix the I2P column header spacing
  - update the regex (it was also not updated for the previous release)
  - update `MIN_BLOCKS` (4320 blocks/month * ~6.5 months) and add README documentation to remember to update it
  - further robustness/standardness/consistency improvements to the regexes (by l0rinc)

  Add signet and testnet4 seeds to the README and to `generate-seeds.py`

  Update the fixed seeds in `src/chainparamsseeds.h`

  In `kernel/chainparams.cpp`:
  - add signet fixed seeds if default network
  - remove hardcoded signet seeds

  Update `contrib/seeds/.gitignore` with signet and testnet4

  The previous 2 seeds updates were https://github.com/bitcoin/bitcoin/pull/30008 and https://github.com/bitcoin/bitcoin/pull/30695.

  mainnet:
  ```
  $ contrib/seeds$ python3 makeseeds.py -a asmap-filled.dat -s seeds_main.txt > nodes_main.txt

  Loading asmap database "asmap-filled.dat"…Done.
  Loading and parsing DNS seeds…Done.
    IPv4   IPv6  Onion    I2P  CJDNS Pass
   17252   3630  21079   3095     12 Initial
   17252   3630  21079   3095     12 Skip entries with invalid address
    8444   1742  14607   2330     10 After removing duplicates
    8194   1691  14321   2102     10 Enforce minimal number of blocks
    7838   1578  14321   2102     10 Require service bit 1
    6802   1326  14321   2102     10 Require minimum uptime
    6762   1321  14320   2102     10 Require a known and recent user agent
    6762   1321  14320   2102     10 Filter out hosts with multiple bitcoin ports
     512    485    512    512     10 Look up ASNs and limit results per ASN and per net
  ```

  signet:
  ```
  $ contrib/seeds$ python3 makeseeds.py -a asmap-filled.dat -s seeds_signet.txt -m 237800 > nodes_signet.txt

  Loading asmap database "asmap-filled.dat"…Done.
  Loading and parsing DNS seeds…Done.
    IPv4   IPv6  Onion    I2P  CJDNS Pass
     110     47     63      9      4 Initial
     110     47     63      9      4 Skip entries with invalid address
     110     47     63      9      4 After removing duplicates
      83     31     58      9      4 Enforce minimal number of blocks
      83     31     58      9      4 Require service bit 1
      83     31     57      9      4 Require minimum uptime
      83     31     57      9      4 Require a known and recent user agent
      83     31     57      7      4 Filter out hosts with multiple bitcoin ports
      42     30     57      7      4 Look up ASNs and limit results per ASN and per net
  ```

  testnet:
  ```
  $ contrib/seeds$ python3 makeseeds.py -a asmap-filled.dat -s seeds_test.txt > nodes_test.txt

  Loading asmap database "asmap-filled.dat"…Done.
  Loading and parsing DNS seeds…Done.
    IPv4   IPv6  Onion    I2P  CJDNS Pass
     204     73     96     11      5 Initial
     204     73     96     11      5 Skip entries with invalid address
     204     73     96     11      5 After removing duplicates
     204     73     96     11      5 Enforce minimal number of blocks
     204     73     96     11      5 Require service bit 1
     195     69     87      9      5 Require minimum uptime
     193     69     87      9      5 Require a known and recent user agent
     193     69     87      9      5 Filter out hosts with multiple bitcoin ports
      79     39     87      9      5 Look up ASNs and limit results per ASN and per net
  ```

  testnet4
  ```
  $ contrib/seeds$ python3 makeseeds.py -a asmap-filled.dat -s seeds_testnet4.txt -m 72600 > nodes_testnet4.txt

  Loading asmap database "asmap-filled.dat"…Done.
  Loading and parsing DNS seeds…Done.
    IPv4   IPv6  Onion    I2P  CJDNS Pass
     149    115     69     11      4 Initial
     149    115     69     11      4 Skip entries with invalid address
     149    115     69     11      4 After removing duplicates
     104     75     52      7      4 Enforce minimal number of blocks
     104     75     52      7      4 Require service bit 1
     100     73     51      7      4 Require minimum uptime
     100     73     51      7      4 Require a known and recent user agent
     100     73     51      7      4 Filter out hosts with multiple bitcoin ports
      43     46     51      7      4 Look up ASNs and limit results per ASN and per net
  ```

ACKs for top commit:
  l0rinc:
    I have mostly reviewed the regexes, for the rest it's only a very lightweight ACK f0b659716bd455dca02053df573d888b5a115aa4
  achow101:
    ACK f0b659716bd455dca02053df573d888b5a115aa4
  laanwj:
    re-ACK f0b659716bd455dca02053df573d888b5a115aa4

Tree-SHA512: 86f4ea247469dbb3f131f2de884e470fbf93f399744d4854fcc26511afafcec231d7eaed37f8564244bc64d917d130b314d948aa97b13020613f8e186c70e368
2025-03-11 09:58:41 -04:00
Hennadii Stepanov
093c757d7c
Merge bitcoin/bitcoin#32000: Update minisketch subtree to d1e6bb8bbf8ef104b9dd002cab14a71b91061177
f5d8b66a8cf23f9ccc51fb9702943c8a5f755f43 Squashed 'src/minisketch/' changes from eb37a9b8e7..d1e6bb8bbf (fanquake)

Pull request description:

  Includes:
  * https://github.com/bitcoin-core/minisketch/pull/92

ACKs for top commit:
  hebasto:
    ACK 4fde88bc469dc1c827591f764bd635038ccaf852, I've updated the subtree locally and got zero diff with this PR.

Tree-SHA512: 0ddaa6b64ca14da244d455594bc122a059fd1d199d28a7a78f266e352811568bd0f30d3b1e5e5d859f92753d3979831c095e3f6078f0ba2c909b1566a0e74a0c
2025-03-07 12:37:56 +00:00
Jon Atack
48f07ac9da chainparams: remove hardcoded signet seeds 2025-03-06 15:39:58 -06:00
Jon Atack
d4ab1150c4 chainparams: add signet fixed seeds if default network 2025-03-06 15:39:58 -06:00
Jon Atack
49f155efbf seeds: update fixed dns seeds 2025-03-06 15:39:58 -06:00
merge-script
9f3dcacef7
Merge bitcoin/bitcoin#31978: kernel: pre-29.x chainparams and headerssync update
11a2d3a63e90cdc1920ede3c67d52a9c72860e6b [headerssync] update headerssync config for v29 (glozow)
dd23c532581f56423047842f4dcbc2c04bd88136 [kernel] update chainTxData for v29 (glozow)
80926af8c2624193f57cf3352233e310d7ae2d09 [kernel] update assumevalid and minimumChainWork for v29 (glozow)
0683b8ebf33386d5c05140df89df10b1853d7c7e [kernel] update assumed blockchain and chainstate sizes for v29 (glozow)

Pull request description:

  Update chainparams and headerssync config for v29.0 (see [release process](https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#before-branch-off)).

ACKs for top commit:
  achow101:
    ACK 11a2d3a63e90cdc1920ede3c67d52a9c72860e6b
  Sjors:
    ACK 11a2d3a63e90cdc1920ede3c67d52a9c72860e6b

Tree-SHA512: 726cbb16a3bc8b11419c2888b17552d70217f616f17a715ba4983fdfccb0cfd9705c528601a6bb3e62563a6f43d41543181e13cdbad89d75abba3b7899328031
2025-03-06 10:23:01 +00:00
fanquake
4fde88bc46
Update minisketch subtree to latest master 2025-03-05 15:36:56 +00:00
glozow
11a2d3a63e [headerssync] update headerssync config for v29 2025-03-04 14:23:18 -05:00
glozow
dd23c53258 [kernel] update chainTxData for v29 2025-03-04 14:23:18 -05:00
glozow
80926af8c2 [kernel] update assumevalid and minimumChainWork for v29 2025-03-04 14:23:18 -05:00
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
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
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
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
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
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
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
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
Ava Chow
77bf99012a
Merge bitcoin/bitcoin#30302: doc: clarify loadwallet path loading for wallets
ca6aa0b9bee3fdf355b7154a9a686a80977f2a02 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 ca6aa0b9bee3fdf355b7154a9a686a80977f2a02
  maflcko:
    lgtm ACK ca6aa0b9bee3fdf355b7154a9a686a80977f2a02
  rkrux:
    ACK ca6aa0b9bee3fdf355b7154a9a686a80977f2a02
  jonatack:
    ACK ca6aa0b9bee3fdf355b7154a9a686a80977f2a02

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
eb51963d87
Merge bitcoin/bitcoin#31884: cmake: Make implicit libbitcoinkernel dependencies explicit
3b42e05aa9e38ba00d52b2338375b4caf032f041 cmake: Make implicit `libbitcoinkernel` dependencies explicit (Hennadii Stepanov)
3fd64efb437e10194ffd0e6d9b6b4664bcf1a0de 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 @ 28dec6c5f8bd35ef4e6cb8d7aa3f21b6879acf98:
  - 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 3b42e05aa9e38ba00d52b2338375b4caf032f041
  theuni:
    utACK 3b42e05aa9e38ba00d52b2338375b4caf032f041

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
c4c5cf174883cb53256e869f0d1673e29576a97c cmake: Fix passing `APPEND_*FLAGS` to `secp256k1` subtree (Hennadii Stepanov)
eb540a262953baf9ed920f98efc4044a353b278a cmake: Remove `core_sanitizer_{cxx,linker}_flags` helper variables (Hennadii Stepanov)

Pull request description:

  On the master branch @ 70e20ea024ce4f39abc4022e1ba19d5a6db2a207, 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 c4c5cf174883cb53256e869f0d1673e29576a97c.
  TheCharlatan:
    ACK c4c5cf174883cb53256e869f0d1673e29576a97c

Tree-SHA512: 707acfa623f0436e34e9e6ba8ce2979e0fde5e196e2242fd1cde4c50f433938549781193d8a06419a0866bbe6d69d76f8383d973afbd87d944407963b318c5c9
2025-02-20 09:36:48 -05:00
merge-script
e606c577cb
Merge bitcoin/bitcoin#31899: cmake: Exclude generated sources from translation
ff4ddd3d2e3b08156fd0a0aeb954fde0a5f4cb03 Revert "cmake: Ensure generated sources are up to date for `translate` target" (Hennadii Stepanov)
03b3166aac5acbf3eec95681c0ab98c4f94ab177 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 ff4ddd3d2e3b08156fd0a0aeb954fde0a5f4cb03
  pablomartin4btc:
    tACK ff4ddd3d2e3b08156fd0a0aeb954fde0a5f4cb03

Tree-SHA512: 6471498a33b145e073f76bd007591b0449e5d520f141c3e3afeca02a09c160fd0f572ec7172dd84703cdc2a1175ad8f3c91e8b0bf705d671338d760786765f56
2025-02-19 16:11:22 -05:00
Antoine Poinsot
3e9b12b3e0 Revert "Merge bitcoin/bitcoin#31826: random: Check GetRNDRRS is supported in InitHardwareRand to avoid infinite loop"
This reverts commit 139640079ff52de5a7935e98225da76686ef32cb, reversing
changes made to dc3a71463373e07e1c8956173c039e61fecbf029.
2025-02-19 10:28:13 -05:00
Ava Chow
139640079f
Merge bitcoin/bitcoin#31826: random: Check GetRNDRRS is supported in InitHardwareRand to avoid infinite loop
09b150bb8adae00854f02ece69fc6ef222fb07d9 In `InitHardwareRand`, do trail test for `RNDRRS` by `VerifyRNDRRS` (Eval EXEC)

Pull request description:

  This PR want to fix #31817 by added a maximum retry limit (`max_retries`) to the `GetRNDRRS` function to prevent it from entering an infinite loop if the hardware random number generator fails to return a valid random number. This change improves stability and ensures that the function terminates after a predefined number of retries.

ACKs for top commit:
  achow101:
    ACK 09b150bb8adae00854f02ece69fc6ef222fb07d9
  sipa:
    utACK 09b150bb8adae00854f02ece69fc6ef222fb07d9

Tree-SHA512: 5626b6b182a55d344a3aba11b782259ecc6bbec513771d50077874c5f70934750e68add8f63aa0bf69c6b7b313112940a85508af5447622c703cc5e92439ab4a
2025-02-18 18:43:12 -08:00
Ava Chow
dc3a714633
Merge bitcoin/bitcoin#31794: wallet: abandon orphan coinbase txs, and their descendants, during startup
e4dd5a351bde88a94326824945f4c8b1e4c15df2 test: wallet, abandon coinbase txs and their descendants during startup (furszy)
474139aa9bf7109df78e46936e5a649c70703386 wallet: abandon inactive coinbase tx and their descendants during startup (furszy)

Pull request description:

  Since #26499, we mark coinbase transactions and their descendants as abandoned when a reorg arises through the "block disconnection" signal handler. However, this does not cover all scenarios; external wallets could contain coinbase transactions from blocks the node has not seen yet, or the user could have replaced the chain with an earlier or different version (one without the coinbase chain).

  This affects balance calculation as well as mempool rebroadcast (descendants shouldn't be relayed).
  Fix this by marking orphaned coinbase transactions and their descendants as abandoned during wallet startup.

ACKs for top commit:
  achow101:
    ACK e4dd5a351bde88a94326824945f4c8b1e4c15df2
  rkrux:
    tACK e4dd5a351bde88a94326824945f4c8b1e4c15df2
  mzumsande:
    Code Review ACK e4dd5a351bde88a94326824945f4c8b1e4c15df2

Tree-SHA512: 461a43de7a6f5a580f2e6e3b56ec9bc92239cd45e850a2ff594ab5488dcd4a507f68fbbf550a33d7173b2add0de80de1e1b3841e1dfab0c95b284212d8ced08a
2025-02-18 18:39:00 -08:00
am-sq
ca6aa0b9be doc: loadwallet loads from relative walletdir
Improves the documentation of help output for loadwallet
to clarify that filename is relative to the default
wallet directory. Adds examples that get a wallet from
sub-directories.
2025-02-18 15:38:34 -08:00
Hennadii Stepanov
ff4ddd3d2e
Revert "cmake: Ensure generated sources are up to date for translate target"
This reverts commit 864386a7444fb5cf16613956ce8bf335f51b67d5.
2025-02-18 16:05:08 +00:00
Hennadii Stepanov
03b3166aac
cmake: Exclude generated sources from translation 2025-02-18 16:02:56 +00:00