44110 Commits

Author SHA1 Message Date
Lőrinc
99fe67e132 bench: measure CheckBlock speed separately from serialization
> cmake -B build -DBUILD_BENCH=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j$(nproc) && build/src/bench/bench_bitcoin -filter='CheckBlockBench|DuplicateInputs' -min-time=10000

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

|            ns/block |             block/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|          372,743.63 |            2,682.81 |    1.1% |     10.99 | `CheckBlockBench`

|               ns/op |                op/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|        3,304,694.54 |              302.60 |    0.5% |     11.05 | `DuplicateInputs`

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

|            ns/block |             block/s |    err% |       ins/block |       cyc/block |    IPC |      bra/block |   miss% |     total | benchmark
|--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
|        1,096,261.84 |              912.19 |    0.1% |    7,963,390.88 |    3,487,375.26 |  2.283 |   1,266,941.00 |    1.8% |     11.03 | `CheckBlockBench`

|               ns/op |                op/s |    err% |          ins/op |          cyc/op |    IPC |         bra/op |   miss% |     total | benchmark
|--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
|        8,366,309.48 |              119.53 |    0.0% |   23,865,177.67 |   26,620,160.23 |  0.897 |   5,972,887.41 |    4.0% |     10.78 | `DuplicateInputs`
2025-03-12 19:16:07 +01:00
Lőrinc
b07cdbe542 test: validate duplicate detection in CheckTransaction
The `CheckTransaction` validation function in https://github.com/bitcoin/bitcoin/blob/master/src/consensus/tx_check.cpp#L41-L45 relies on a correct ordering relation for detecting duplicate transaction inputs.

This update to the tests ensures that:
* Accurate detection of duplicates: Beyond trivial cases (e.g., two identical inputs), duplicates are detected correctly in more complex scenarios.
* Consistency across methods: Both sorted sets and hash-based sets behave identically when detecting duplicates for `COutPoint` and related values.
* Robust ordering and equality relations: The function maintains expected behavior for ordering and equality checks.

Using randomized testing with shuffled inputs (to avoid any remaining bias introduced), the enhanced test validates that `CheckTransaction` remains robust and reliable across various input configurations. It confirms identical behavior to a hashing-based duplicate detection mechanism, ensuring consistency and correctness.

To make sure the new branches in the follow-up commits will be covered, `basic_transaction_tests` was extended a randomized test one comparing against the old implementation (and also an alternative duplicate). The iterations and ranges were chosen such that every new branch is expected to be hit once.
2025-03-12 19:16:07 +01:00
Lőrinc
c072498305 optimization: merge SizeComputer specializations + add new ones
Endianness doesn't affect the final size, we can skip it for `SizeComputer`.
We can `if constexpr` previous calls into existing method, short-circuiting existing logic when we only need their serialized sizes.

> 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
|--------------------:|--------------------:|--------:|----------:|:----------
|          888,859.82 |            1,125.04 |    0.4% |     10.87 | `DeserializeBlock`
|          168,502.88 |            5,934.62 |    0.1% |     10.99 | `SerializeBlock`
|           10,200.88 |           98,030.75 |    0.1% |     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,460,428.52 |              224.19 |    0.0% |   53,692,507.13 |   16,015,347.97 |  3.353 |   2,410,105.48 |    0.5% |     11.01 | `DeserializeBlock`
|          567,042.65 |            1,763.54 |    0.0% |    7,386,775.59 |    2,035,613.84 |  3.629 |   1,385,368.57 |    0.5% |     11.01 | `SerializeBlock`
|           25,728.56 |           38,867.32 |    0.0% |      172,750.03 |       92,366.64 |  1.870 |      42,131.03 |    1.7% |     11.00 | `SizeComputerBlock`
2025-03-12 19:16:07 +01:00
Lőrinc
c02600b8e1 optimization: Add single byte write
Single byte writes are used very often (used for every (u)int8_t or std::byte or bool and for every VarInt's first byte which is also needed for every (pre)Vector).
It makes sense to avoid the generalized serialization infrastructure that isn't needed:
* AutoFile write doesn't need to allocate 4k buffer for a single byte now;
* `VectorWriter` and `DataStream` avoids memcpy/insert calls.

> 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
|--------------------:|--------------------:|--------:|----------:|:----------
|          934,120.45 |            1,070.53 |    0.2% |     11.01 | `DeserializeBlock`
|          170,719.27 |            5,857.57 |    0.1% |     10.99 | `SerializeBlock`
|           12,048.40 |           82,998.58 |    0.2% |     11.01 | `SizeComputerBlock`

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

|            ns/block |             block/s |    err% |       ins/block |       cyc/block |    IPC |      bra/block |   miss% |     total | benchmark
|--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
|        4,433,835.04 |              225.54 |    0.0% |   53,688,481.60 |   15,918,730.23 |  3.373 |   2,409,056.47 |    0.5% |     11.01 | `DeserializeBlock`
|          563,663.10 |            1,774.11 |    0.0% |    7,386,775.59 |    2,023,525.77 |  3.650 |   1,385,368.57 |    0.5% |     11.00 | `SerializeBlock`
|           27,351.60 |           36,560.93 |    0.1% |      225,261.03 |       98,209.77 |  2.294 |      53,037.03 |    0.9% |     11.00 | `SizeComputerBlock`
2025-03-12 19:16:07 +01:00
Lőrinc
028c006541 cleanup: remove unused ser_writedata16be and ser_readdata16be 2025-03-12 19:16:07 +01:00
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
aa68ed27b8
Merge bitcoin/bitcoin#32041: build: bump CLIENT_VERSION_MAJOR to 29
a3f0e9a4336a57440615efb352793fe131079487 [build] bump CLIENT_VERSION_MAJOR to 29 (glozow)

Pull request description:

ACKs for top commit:
  fanquake:
    ACK a3f0e9a4336a57440615efb352793fe131079487

Tree-SHA512: 23a421a2b457a8e9fe8d4a831fcb21b665902a522695294997cc5175af533d91467c51856001a7bb98bfa6b122022803327d4dabfb186489e24e08f48216183b
2025-03-12 23:03:48 +08:00
glozow
a3f0e9a433 [build] bump CLIENT_VERSION_MAJOR to 29 2025-03-12 10:58:37 -04: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
Hennadii Stepanov
7bb4c82d8b
Merge bitcoin/bitcoin#32021: qa: Enable feature_init.py on Windows
59c4930394cafc939eb396224b3d60d01ba0ce37 qa: Enable feature_init.py on Windows (Hodlinator)

Pull request description:

  Windows has been skipped since feature_init.py was added in #23289. Possibly due to poorer support on older Python versions, or attempts to use `CTRL_C_EVENT` (which didn't work in my testing either) instead of `CTRL_BREAK_EVENT`.

ACKs for top commit:
  maflcko:
    lgtm ACK 59c4930394cafc939eb396224b3d60d01ba0ce37
  BrandonOdiwuor:
    Code Review ACK 59c4930394cafc939eb396224b3d60d01ba0ce37
  hebasto:
    ACK 59c4930394cafc939eb396224b3d60d01ba0ce37, I have reviewed the code and it looks OK.

Tree-SHA512: 4f3649b41bcba2e8d03b8dcb1a7a6882edafb2c456db4b0768fc86018e9e9ed7171cb3d3c99e74b4ef38a3fcf3ab5d2f1865bbd49d791f1ce0a246806634e1a7
2025-03-12 11:26:58 +00: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
e38f09b776
Merge bitcoin/bitcoin#31955: test: Fix authproxy named args debug logging
fac1dd9dffba1033245c283bc0468e801c14e910 test: Fix authproxy named args debug logging (MarcoFalke)

Pull request description:

  In Python the meaning of `args or argsn` is that `argsn` is fully ignored when `args` is a list with at least one element. However, the RPC server accepts mixed positional and named args in the same RPC.

  Fix the debug log by always printing both. Also, add a new `_json_dumps` helper to avoid bloated code.

  Can be tested via `--tracerpc` on a call that uses named args mixed with positional args.

ACKs for top commit:
  i-am-yuvi:
    Tested ACK fac1dd9dffba1033245c283bc0468e801c14e910
  rkrux:
    tACK fac1dd9dffba1033245c283bc0468e801c14e910
  musaHaruna:
    Tested ACK [fac1dd9](fac1dd9dff)
  ryanofsky:
    Code review ACK fac1dd9dffba1033245c283bc0468e801c14e910. Thanks for logging fix. This change should have been included in #19762

Tree-SHA512: ff63fbc2564b2c7589e9294baacf4c7a79f10d593776813392510702ca726e3893a29db3ba261f3aee1789a59bb215d7cb10fc85ca1a02632631d3722ddcdfc5
2025-03-12 09:43:36 +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
45719390a1
Merge bitcoin/bitcoin#32011: Docs: fix typos in documentation files
5601bab4f8b01fdef7a54c9e397d513217ab1c1f Docs: fix typos in documentation files (wgyt)

Pull request description:

ACKs for top commit:
  jonatack:
    ACK 5601bab4f8b01fdef7a54c9e397d513217ab1c1f
  mabu44:
    crACK 5601bab4f8b01fdef7a54c9e397d513217ab1c1f
  maflcko:
    lgtm ACK 5601bab4f8b01fdef7a54c9e397d513217ab1c1f

Tree-SHA512: 66c14638090f472f6c68d094cd9b0fc2e47e40d29e4f30a0a798992317cce8e96ef053ff159cf950a1d44cffb24554c6cebccec5cf49d24f105b367fc29382c1
2025-03-09 16:44:34 +00:00
Hennadii Stepanov
4637cb1eec
Merge bitcoin/bitcoin#32002: doc: add note to Windows build about stripping bins
c94195c077ff227e5e2d80e803e1400d7f60812b doc: add note to windows build about stripping bin (fanquake)

Pull request description:

  The Windows binaries are particularly big when they contain debug info, closing in on 500mb. Add a note to the Windows build instructions about using `--strip`.

  I haven't tested this (the copying out to WSL). If we don't want to add this note, in favour of [user-presents or similar](https://github.com/bitcoin/bitcoin/issues/30593#issuecomment-2271304490), then we should just close #30593.

  Fixes #30593.

ACKs for top commit:
  hodlinator:
    ACK c94195c077ff227e5e2d80e803e1400d7f60812b
  hebasto:
    ACK c94195c077ff227e5e2d80e803e1400d7f60812b.

Tree-SHA512: c55670486ef60c6bda720e65443e17747b840e220c5bf6d6c0b77590d95cd6c8f040bc0e67dfa8eb11451f4f2eac9faf25d74ea68251b881773836f4113e8595
2025-03-08 11:43:34 +00:00
Hennadii Stepanov
5f732089d6
Merge bitcoin/bitcoin#32017: doc: warn against having qt6 installed on macOS
d79dab0fa999002a0c5b70c1688240e2a5032ce1 doc: warn against having qt6 installed on macOS (Sjors Provoost)

Pull request description:

  Document #31009 in time for the v29 release.

ACKs for top commit:
  achow101:
    ACK d79dab0fa999002a0c5b70c1688240e2a5032ce1
  hebasto:
    ACK d79dab0fa999002a0c5b70c1688240e2a5032ce1.

Tree-SHA512: 4c6e557b6410c7fd766e1cdc356ae9f7410fbb4746732580e5bdf33ba43dca64e6f2fb66677d1e0c8fa71c19f212dc81ac73dc4277f2fd966bbd41c20d9291f8
2025-03-08 11:29:44 +00:00
Hennadii Stepanov
a1aea3ea74
Merge bitcoin/bitcoin#31996: doc: link to benchcoin over bitcoinperf
611999e09777716d1fa686254db20845aff3dffe doc: link to benchcoin over bitcoinperf (fanquake)

Pull request description:

  Seems like linking to https://github.com/bitcoin-dev-tools/benchcoin is now the best thing to do here. If not, we can just drop the other links.

ACKs for top commit:
  l0rinc:
    ACK 611999e09777716d1fa686254db20845aff3dffe
  laanwj:
    ACK 611999e09777716d1fa686254db20845aff3dffe
  hebasto:
    ACK 611999e09777716d1fa686254db20845aff3dffe. I agree. I've had a great experience using it.

Tree-SHA512: 558060bec92099befaa047e9192e5172e6a0cdfc5530d1f8b4d64ac717ce999a993d39c5d108fa9df3e30b2fc089e31d720f344153381e7c53f0ed40938ae1e0
2025-03-08 10:46:58 +00:00
wgyt
5601bab4f8 Docs: fix typos in documentation files 2025-03-08 09:26:18 +08:00
Hodlinator
59c4930394
qa: Enable feature_init.py on Windows 2025-03-07 22:33:49 +01:00
fanquake
c94195c077
doc: add note to windows build about stripping bin
The Windows binaries are particularly big when they contain debug
info, closing in on 500mb. Add a note to the Windows build instructions
about using `--strip`.
2025-03-07 17:19:05 +00:00
merge-script
ee68b05f3d
Merge bitcoin/bitcoin#32014: ci: Do not try to install for fuzz builds
a3c3f37e71efc1ad13fcad49b1ac651e5843b26b ci: Do not try to install for fuzz builds (Hennadii Stepanov)

Pull request description:

  This PR is a follow-up to https://github.com/bitcoin/bitcoin/pull/31844 and extends the changes from fb0546b1c5ebb858605bef4c9fa001782e0ab213 to all fuzz builds in the CI.

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

ACKs for top commit:
  dergoegge:
    utACK a3c3f37e71efc1ad13fcad49b1ac651e5843b26b

Tree-SHA512: bc422c53f6f06f25a0e13e788ade7c98711d864773a909487b8863e7cacfbc499ea466ec675a955279a89e247745ff0e845cd42896b4d405c4441d5e9f3a9c1b
2025-03-07 14:08:25 +00: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
Hennadii Stepanov
a3c3f37e71
ci: Do not try to install for fuzz builds 2025-03-07 11:09:57 +00:00
Sjors Provoost
d79dab0fa9
doc: warn against having qt6 installed on macOS 2025-03-07 05:01:46 -05:00
Jon Atack
f0b659716b seeds: update .gitignore with signet and testnet4 2025-03-06 15:39:58 -06: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
Lőrinc
236687083f makeseeds: regex improvements 2025-03-06 14:50:39 -06:00
Jon Atack
98f84d6c23 generate-seeds: update and add signet 2025-03-06 14:50:39 -06:00
Jon Atack
c4ed23e539 seeds: add testnet4 seeds 2025-03-06 14:50:39 -06:00
Jon Atack
60f17dd816 seeds: add signet seeds 2025-03-06 14:50:39 -06:00
Jon Atack
2bcccaa410 makeseeds: align I2P column header 2025-03-06 14:50:39 -06:00
Jon Atack
94e21aa5fc makeseeds: update MIN_BLOCKS, add reminder to README 2025-03-06 14:50:39 -06:00
Jon Atack
6ae7a3bc4e makeseeds: update user agent regex 2025-03-06 14:50:39 -06:00
laanwj
9b0d2e5094 makeseeds: fix incorrect regex
We shouldn't have | at the end of the last clause, as this will make it match
the empty string too (so effectively everything starting with Satoshi: matches).

While doing this, put the | at the beginning of every line of regex rather than
the end, to make it easier to update in the future without accidentally running
into this problem again.
2025-03-06 14:50:39 -06:00
Ava Chow
a9a2b669f3
Merge bitcoin/bitcoin#32003: doc: remove note about macOS self-signing
c873ab6f23e027af1c5837256ce3c9eccaf409cb doc: remove note about macOS self-signing (fanquake)

Pull request description:

  Followup to #31407.

ACKs for top commit:
  Sjors:
    ACK c873ab6f23e027af1c5837256ce3c9eccaf409cb
  achow101:
    ACK c873ab6f23e027af1c5837256ce3c9eccaf409cb

Tree-SHA512: f51aacf11606fb3c0a5811a0bb2ed8dbddfcf36c9e4ece1ef0f742195d0a9f3b26dd60299c165c90caca8e2ce264922bdb990632f991d1fef53f2274ec3dcb6a
2025-03-06 10:00:20 -08:00
merge-script
c7d216ac94
Merge bitcoin/bitcoin#31993: ci: use LLVM 20.1.0 for MSAN
d76647eb8f11708ae90600ce3b92570a86f62bac ci: use LLVM 20.1.0 for MSAN (fanquake)

Pull request description:

  Now that the release is out, stop using rc1.

ACKs for top commit:
  l0rinc:
    utACK d76647eb8f11708ae90600ce3b92570a86f62bac
  Sjors:
    ACK d76647eb8f11708ae90600ce3b92570a86f62bac

Tree-SHA512: 2eefad118dd617c3e9554caee1549965fc4acc437dbef1252c1912faea57ccbfcb39f879911f27f4274931c1d8723b9c7f981aafa6958e70d4371f16c368c627
2025-03-06 17:19:59 +00:00