Commit graph

37843 commits

Author SHA1 Message Date
furszy
82bb7831fa
wallet: skip block scan if block was created before wallet birthday
To avoid wasting processing power, we can skip blocks that occurred
before the wallet's creation time,  since these blocks are guaranteed
not to contain any relevant wallet data.

This has direct implications (an speed improvement) on the underlying
blockchain synchronization process as well.

The reason is that the validation interface queue is limited to
10 tasks per time. This means that no more than 10 blocks can be
waiting for the wallet(s) to be processed while we are synchronizing
the chain (activating the best chain to be more precise).
Which can be a bottleneck if blocks arrive and are processed faster
from the network than what they are  processed by the wallet(s).
2023-05-25 10:45:38 -03:00
furszy
a082434d12
refactor: single method to append new spkm to the wallet 2023-05-25 10:38:20 -03:00
MarcoFalke
fab19a8ae3
doc: Fix typo in doc/release-process.md URL 2023-05-25 13:17:17 +02:00
MarcoFalke
faaa97bb38
doc: Add doc/release-notes/release-notes-25.0.md 2023-05-25 13:16:44 +02:00
fanquake
9d098af5a9
Merge bitcoin/bitcoin#27747: rpc: Use 'byte'/'bytes' for bech32(m) validation error message
3d0a5c37e9 use 'byte'/'bytes' for bech32(m) validation error (Reese Russell)

Pull request description:

  This PR rectifies a linguistic inconsistency found in merged PR [27727](https://github.com/bitcoin/bitcoin/pull/27727). It addresses the improper usage of the term 'byte' in error reports. As it stands, PR [27727](https://github.com/bitcoin/bitcoin/pull/27727) exclusively utilizes 'byte' in error messages, regardless of the context, as demonstrated below:

  Currently: ```Invalid Bech32 v0 address program size (16 byte), per BIP141```

  This modification enhances the accuracy of error reporting in most scenarios users are likely to encounter by checking for a plural or singular number of bytes.

  This PR

  **16 Bytes program size error** :

  ```
  (
      "BC1QR508D6QEJXTDG4Y5R3ZARVARYV98GJ9P",
      "Invalid Bech32 v0 address program size (16 bytes), per BIP141",
      [],
  )
  ```

  **1 Byte program size error**

  ```
  (
      "bc1pw5dgrnzv",
      "Invalid Bech32 address program size (1 byte)",
      []
  ),
  ```
  Thank you

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 3d0a5c37e9

Tree-SHA512: 55069194a6a33a37559cf14b59b6ac05b1160f57f14d1415aef8e76c916c7c7f343310916ae85b3fa895937802449c1dddb2f653340d0f39203f06aee10f6fce
2023-05-25 12:02:49 +01:00
fanquake
e43432086a
Merge bitcoin/bitcoin#27743: p2p: Unconditionally return when compact block status == READ_STATUS_FAILED
d972695797 Unconditionally return when compact block status == READ_STATUS_FAILED (Greg Sanders)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/pull/27626#discussion_r1204491894 which would have resulted in wasted bandwidth every once in a while.

ACKs for top commit:
  Sjors:
    utACK d972695797
  mzumsande:
    ACK d972695797

Tree-SHA512: 2483cae03093fc61b36279bbc455829822258703ae608ff2797a20449410b12bfe8d40de63c02fc79ed4ef4d91b34c63281b71b81a1c691cab9647b65761586f
2023-05-25 10:05:55 +01:00
Reese Russell
3d0a5c37e9 use 'byte'/'bytes' for bech32(m) validation error
changed from std::string -> std::string_view

applied snake case to byteStr -> byte_str
2023-05-25 06:30:10 +00:00
Greg Sanders
d972695797 Unconditionally return when compact block status == READ_STATUS_FAILED 2023-05-24 13:59:49 -04:00
Andrew Chow
a13f3746dc
Merge bitcoin/bitcoin#27727: rpc: Fix invalid bech32 address handling
eeee55f928 rpc: Fix invalid bech32 handling (MarcoFalke)

Pull request description:

  Currently the handling of invalid bech32(m) addresses over RPC has many issues:

  * No error for invalid addresses is reported, leading to internal bugs via `CHECK_NONFATAL`, see https://github.com/bitcoin/bitcoin/issues/27723
  * The error messages use "data size" (the meaning of which is unclear to the user, because the witness program data and bech32 section data are related but different) when they mean "program size"

  Fix all issues. Also, use the BIP 173 and BIP 350 test vectors.

ACKs for top commit:
  achow101:
    ACK eeee55f928
  brunoerg:
    crACK eeee55f928

Tree-SHA512: c8639ee49e2a54b740b72d66bc4a40352dd553a6e3220dea9f94e48e33124f21f597a2817cb405d0a4c88d21df1013c0a4877a01370a2d326aa2cff1f9c381a8
2023-05-24 12:10:55 -04:00
Ryan Ofsky
8aa8f73adc refactor: Replace std::optional<bilingual_str> with util::Result 2023-05-24 08:55:47 -04:00
MarcoFalke
5f49cb1bc8 util: Add void support to util::Result
A minimal (but hacky) way to add support for void to Result
originally posted https://github.com/bitcoin/bitcoin/pull/27632#discussion_r1195604095
2023-05-24 08:55:47 -04:00
fanquake
51c050787f
Merge bitcoin/bitcoin#27626: Parallel compact block downloads, take 3
d7f359b35e Add tests for parallel compact block downloads (Greg Sanders)
03423f8bd1 Support up to 3 parallel compact block txn fetchings (Greg Sanders)
13f9b20b4c Only request full blocks from the peer we thought had the block in-flight (Greg Sanders)
cce96182ba Convert mapBlocksInFlight to a multimap (Greg Sanders)
a90595478d Remove nBlocksInFlight (Greg Sanders)
86cff8bf18 alias BlockDownloadMap for mapBlocksInFlight (Greg Sanders)

Pull request description:

  This is an attempt at mitigating https://github.com/bitcoin/bitcoin/issues/25258 , which is a revival of https://github.com/bitcoin/bitcoin/pull/10984, which is a revival of https://github.com/bitcoin/bitcoin/pull/9447.

  This PR attempts to mitigate a single case, where high bandwidth peers can bail us out of a flakey
  peer not completing blocks for us. We allow up to 2 additional getblocktxns requests per unique block.
  This would hopefully allow the chance for an honest high bandwidth peer to hand us the transactions
  even if the first in flight peer stalls out.

  In contrast to previous effort:

  1) it will not help if subsequent peers send block headers only, so only high-bandwidth peers this time. See: https://github.com/bitcoin/bitcoin/pull/10984/files#diff-6875de769e90cec84d2e8a9c1b962cdbcda44d870d42e4215827e599e11e90e3R1411
  2)  `MAX_GETBLOCKTXN_TXN_AFTER_FIRST_IN_FLIGHT` is removed, in favor of aiding recovery during turbulent mempools
  3) We require one of the 3 block fetching slots to be an outbound peer. This can be the original offering peer, or subsequent compact blocks given by high bandwidth peers.

ACKs for top commit:
  sdaftuar:
    ACK d7f359b35e
  mzumsande:
    Code Review ACK d7f359b35e

Tree-SHA512: 54980eac179e30f12a0bd49df147b2c3d63cd8f9401abb23c7baf02f76eeb59f2cfaaa155227990d0d39384de9fa38663f88774e891600a3837ae927f04f0db3
2023-05-24 10:09:09 +01:00
Andrew Chow
3132ec64d9
Merge bitcoin/bitcoin#27177: test: fix intermittent issue in feature_bip68_sequence
272eb55616 test: fix `include_immature_coinbase` logic in `get_utxos` (brunoerg)
a951c34f17 test: fix `interface_usdt_mempool` by mining a block after each test (brunoerg)
1557bf1196 test: fix mature utxos addition to wallet in `mempool_package_limits` (brunoerg)
60ced9007d test: fix intermittent issue in `feature_bip68_sequence` (brunoerg)

Pull request description:

  Fixes #27129

  To avoid `bad-txns-premature-spend-of-coinbase` error,
  when getting a utxo (using `get_utxo`) to create a new
  transaction `get_utxo` shouldn't return (if possible)
  by default immature coinbase.

ACKs for top commit:
  achow101:
    ACK 272eb55616
  pinheadmz:
    re-ACK 272eb55616

Tree-SHA512: eae821c7833bf084d8b907c94876ed010a7925d2177c3013a0c61b69d9571df006da83397a19487d93b0d1fa415951152f0b8ad0de2a55d86c39f6917934f050
2023-05-23 15:48:07 -04:00
Greg Sanders
d7f359b35e Add tests for parallel compact block downloads 2023-05-23 13:07:49 -04:00
Greg Sanders
03423f8bd1 Support up to 3 parallel compact block txn fetchings
A single outbound slot is required, so if the first two slots
are taken by inbound in-flights, the node will reject additional
unless they are coming from outbound.

This means in the case where a fast sybil peer is attempting to
stall out a node, a single high bandwidth outbound peer can
mitigate the attack.
2023-05-23 13:07:49 -04:00
MarcoFalke
eeee55f928
rpc: Fix invalid bech32 handling 2023-05-23 15:10:00 +02:00
willcl-ark
59c8944749
build: disable boost multi index safe mode
Disable boost multi index safe mode by default when configuring with
--enable-debug.

This option can cause transactions to take a long time to be accepted
into the mempool under certain conditions; iterator destruction takes
O(n) time vs O(1) as they are stored in a singly linked list. See
27586 for more information.

Re-enable it on the CI builds which previously had it enabled.

Re-enable it on the msan fuzz target so that we have fuzz tasks testing
with it enabeld and disabled in this repo.
2023-05-23 13:44:07 +01:00
fanquake
5ef2c1ee7a
Merge bitcoin/bitcoin#27717: test: Make util/test_runner.py honor BITCOINUTIL and BITCOINTX
4f2f615d13 test: Make `util/test_runner.py` honor `BITCOINUTIL` and `BITCOINTX` (Hennadii Stepanov)

Pull request description:

  This PR is a continuation of changes to our testing frameworks (https://github.com/bitcoin/bitcoin/pull/27554, https://github.com/bitcoin/bitcoin/pull/27561) that allow them to work correctly in a multi-config build environment that is possible for [upcoming](https://github.com/bitcoin/bitcoin/pull/25797) CMake-based build system. That means that built for different configurations binaries (e.g., "Debug" and "Release") can coexist in separated directories.

  The commit has been pulled from https://github.com/hebasto/bitcoin/pull/15 and it seems [useful](https://github.com/hebasto/bitcoin/pull/15#discussion_r1200251404) by itself as:
  > I believe the rationale for allowing to drop in the executables via env var is to allow to test the guix-produced, or other third-party-produced executables...

  The current implementation of the `test/functional/test_framework/test_framework.py` script uses the same approach: 09351f51d2/test/functional/test_framework/test_framework.py (L231-L246)

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 4f2f615d13
  TheCharlatan:
    ACK 4f2f615d13
  stickies-v:
    ACK 4f2f615d13

Tree-SHA512: 99ee9a727b266700649d8f2ec528dfaeb04a1e48f0cb1d4eeaece65917165be647c10c4548429a9e8b30d094597f67e860c1db03ac689ebb409b223ce1b63aa9
2023-05-23 13:23:58 +01:00
Cory Fields
4fe5f3c467 depends: remove redundant stdlib option
Use of -stdlib++-isystem gets rid of any system c++ header include paths and
negates the need for this option. In newer versions of clangs the combo
produces a warning.
2023-05-22 16:02:44 +00:00
furszy
3126454dcf
index: prevent race by calling 'CustomInit' prior setting 'synced' flag
The 'm_synced' flag enables 'BlockConnected' events to be processed by
the index. If we set the flag before calling 'CustomInit', we could be
dispatching a block connected event to an uninitialized index child
class.

e.g. BlockFilterIndex, initializes the next filter position
inside 'CustomInit'. So, if `CustomInit` is not called prior receiving
the block event, the index will use 'next_filter_position=0' which
overwrites the first filter in disk.
2023-05-22 12:56:16 -03:00
Andrew Chow
22139f6e83
Merge bitcoin/bitcoin#25796: rpc: add descriptorprocesspsbt rpc
1bce12acd3 test: add test for `descriptorprocesspsbt` RPC (ishaanam)
fb2a3a70e8 rpc: add descriptorprocesspsbt rpc (ishaanam)

Pull request description:

  This PR implements an RPC called `descriptorprocesspsbt`. This RPC is based off of `walletprocesspsbt`, but instead of interacting with the wallet to update, sign and finalize a psbt, it instead accepts an array of output descriptors and uses that information along with information from the mempool, txindex, and the utxo set to do so. `utxoupdatepsbt` also updates a psbt in this manner, but doesn't sign or finalize it. Because of this overlap, a helper function that is added in this PR is called by both `utxoupdatepsbt` and `descriptorprocesspsbt`. Whether or not the helper function signs a psbt is dictated by if the HidingSigningProvider passed to it contains any private information. There is also a test added in this PR for this new RPC that uses p2wsh, p2wpkh, and legacy outputs.
  Edit: see https://github.com/bitcoin/bitcoin/pull/25796#issuecomment-1228830963

ACKs for top commit:
  achow101:
    re-ACK 1bce12acd3
  instagibbs:
    reACK 1bce12acd3

Tree-SHA512: e1d0334739943e71f2ee68b4db7637ebe725da62e7aa4be071f71c7196d2a5970a31ece96d91e372d34454cde8509e95ab0eebd2c8edb94f7d5a781a84f8fc5d
2023-05-22 11:28:11 -04:00
fanquake
456701420b
Merge bitcoin/bitcoin#27672: fuzz: Print error message when FUZZ is missing
fa1b3abc83 ci: Log qa-assets repo last commit (MarcoFalke)
fa22966f33 fuzz: Print error message when FUZZ is missing (MarcoFalke)

Pull request description:

  Some trivial UX improvements.

  * Change the exit code for `PRINT_ALL_FUZZ_TARGETS_AND_ABORT` and `WRITE_ALL_FUZZ_TARGETS_AND_ABORT` to `EXIT_SUCCESS` instead of `Aborted (core dumped)`.
  * Print readable error message when `FUZZ` is missing instead of `Aborted (core dumped)`.
  * Clarify that a fuzz target needs to be compiled into the executable.

ACKs for top commit:
  dergoegge:
    ACK fa1b3abc83

Tree-SHA512: 065ef8920449c64b3516f89a61cb397b505eccf531318c4f3830895d5ff6cd7ae2525cb857320481e3d0ed0b2f8a522cd8f7835e69f021241b6ec297a6102fc8
2023-05-22 12:55:18 +01:00
fanquake
09351f51d2
Merge bitcoin/bitcoin#27699: random: drop syscall wrapper usage for getrandom()
5228223e1f ci: remove MSAN getrandom syscall workaround (fanquake)
d5e06919db random: switch to using getrandom() directly (fanquake)
c2ba3f5b0c random: add [[maybe_unused]] to GetDevURandom (fanquake)
c13c97dbf8 random: getentropy on macOS does not need unistd.h (fanquake)

Pull request description:

  This requires a linux kernel of `3.17`+, which seems entirely
  reasonable. `3.17` went EOL in 2015, and the last supported `3.x` kernel
  (`3.16`) went EOL > 4 years ago, in 2020. For reference, the current
  oldest maintained kernel is `4.14` (released 2017, going EOL Jan 2024).

  Support for `getrandom()` (and `getentropy()`) was added to
  glibc `2.25` https://sourceware.org/legacy-ml/libc-alpha/2017-02/msg00079.html:
  > * The getentropy and getrandom functions, and the <sys/random.h> header
    file have been added.

  and we already require `2.27` or later.

  All that being said, I don't think you would encounter a current day (+~6 months from now)
  system, running with kernel headers older than 3.17 (released 2014) but also having a
  glibc of 2.27+ (released 2018)?

  Removing this (our only) use of `syscall()` also means we can drop a workaround in our MSAN jobs.
  If this is merged, I'll drop the [same workaround in oss-fuzz](25946a5448/projects/bitcoin-core/build.sh (L49-L56)).

ACKs for top commit:
  josibake:
    ACK 5228223e1f
  hebasto:
    ACK 5228223e1f, I've tested build system changes on Ubuntu 22.04 and macOS Monterey 12.6.6 (x86_64).

Tree-SHA512: cc978e08510c461b875ca8c08ae176b4519fa1108f0efd74dcb7474518945357e0184e54423282c9a496de195e4ddc3e221ee78623bd63e24c50cc86acdf32e2
2023-05-22 11:34:58 +01:00
Hennadii Stepanov
4f2f615d13
test: Make util/test_runner.py honor BITCOINUTIL and BITCOINTX
This change allows to drop in the executables via environment variables
in the same way as for functional tests.
2023-05-22 11:23:24 +01:00
fanquake
ad7819d2f8
Merge bitcoin/bitcoin#27670: guix: remove redundant glibc patches
3cfe366ec3 guix: remove redundant glibc patches (fanquake)

Pull request description:

  These should only be relevant for a glibc that is built as part of a Guix system, and should not be required for a glibc that is just being built to compile our binaries against. A x86_64 linux bitcoind produced with Guix using master vs this change has no difference. i.e:
  #### Comparing `bitcoind` & `../../../../../guix-build-d7700d3a2647/output/x86_64-linux-gnu/bitcoin-d7700d3a2647/bin/bitcoind`:

  ## strings --all --bytes=8 {}

  ```diff
  @@ -20311,15 +20311,15 @@
   This is experimental software.
   The source code is available from %s.
   Please contribute if you find %s useful. Visit %s for further information about the software.
   The %s developers
   The Bitcoin Core developers
   <https://bitcoincore.org/>
   Copyright (C) %i-%i
  -v25.99.0-gda0bf1d07639b0490791bbd6aec71bbea8aa2aThe %s developer<https://github.com/bitcoin/bitcDistributed under the MIT software license, see the accompanyingThis is experimeThe source code is available froPlease contribute if you find %s useful. Visit %s for further information about Copyright (C) %ibool BCLog::Logger::StartLogging()
  +v25.99.0-gd7700d3a26478d9b1648463c188648c7047b1cThe %s developer<https://github.com/bitcoin/bitcDistributed under the MIT software license, see the accompanyingThis is experimeThe source code is available froPlease contribute if you find %s useful. Visit %s for further information about Copyright (C) %ibool BCLog::Logger::StartLogging()
   std::string BCLog::Logger::LogLevelToStr(BCLog::Level) const
   std::string LogCategoryToStr(BCLog::LogFlags)
   void BCLog::Logger::LogPrintStr(const string&, const string&, const string&, int, BCLog::LogFlags, BCLog::Level)
   void BCLog::Logger::ShrinkDebugFile()
   Failed to shrink debug log file: fseek(...) failed
   logging.cpp
   m_buffering
  ```

  #### objdump --line-numbers --disassemble --demangle --reloc --no-show-raw-insn --section=.text {}

  ```diff
  @@ -1505889,15 +1505889,15 @@
   call   aa3380 <malloc@plt+0xa4edb0>
   mov    (%rsp),%rdx
   movdqa 0x465540(%rip),%xmm0
   mov    %rax,0x7a0559(%rip)
   lea    0x7a0552(%rip),%rsi
   lea    0x3957bb(%rip),%rdi
   mov    %rdx,0x7a0554(%rip)
  -mov    $0x3038,%edx
  +mov    $0x3036,%edx
   movups %xmm0,(%rax)
   movdqa 0x465524(%rip),%xmm0
   mov    %dx,0x30(%rax)
   mov    0x7a0529(%rip),%rdx
   movups %xmm0,0x10(%rax)
   movdqa 0x46551d(%rip),%xmm0
   movups %xmm0,0x20(%rax)
  ```

  #### readelf --wide --decompress --hex-dump=.rodata {}

  ```diff
  @@ -37238,17 +37238,17 @@
     0x00b73730 65202573 20646576 656c6f70 65727300 e %s developers.
     0x00b73740 54686520 42697463 6f696e20 436f7265 The Bitcoin Core
     0x00b73750 20646576 656c6f70 65727300 434f5059  developers.COPY
     0x00b73760 494e4700 3c687474 70733a2f 2f626974 ING.<https://bit
     0x00b73770 636f696e 636f7265 2e6f7267 2f3e0043 coincore.org/>.C
     0x00b73780 6f707972 69676874 20284329 2025692d opyright (C) %i-
     0x00b73790 25690053 61746f73 68690000 00000000 %i.Satoshi......
  -  0x00b737a0 7632352e 39392e30 2d676461 30626631 v25.99.0-gda0bf1
  -  0x00b737b0 64303736 33396230 34393037 39316262 d07639b0490791bb
  -  0x00b737c0 64366165 63373162 62656138 61613261 d6aec71bbea8aa2a
  +  0x00b737a0 7632352e 39392e30 2d676437 37303064 v25.99.0-gd7700d
  +  0x00b737b0 33613236 34373864 39623136 34383436 3a26478d9b164846
  +  0x00b737c0 33633138 38363438 63373034 37623163 3c188648c7047b1c
     0x00b737d0 54686520 25732064 6576656c 6f706572 The %s developer
     0x00b737e0 3c687474 70733a2f 2f676974 6875622e <https://github.
     0x00b737f0 636f6d2f 62697463 6f696e2f 62697463 com/bitcoin/bitc
     0x00b73800 44697374 72696275 74656420 756e6465 Distributed unde
     0x00b73810 72207468 65204d49 5420736f 66747761 r the MIT softwa
     0x00b73820 7265206c 6963656e 73652c20 73656520 re license, see
     0x00b73830 74686520 6163636f 6d70616e 79696e67 the accompanying
  ```

  #### readelf --wide --decompress --hex-dump=.gnu_debuglink {}

  ```diff
  @@ -1,5 +1,5 @@

   Hex dump of section '.gnu_debuglink':
     0x00000000 62697463 6f696e64 2e646267 00000000 bitcoind.dbg....
  -  0x00000010 6b6e8eda                            kn..
  +  0x00000010 345cb865                            4\.e
  ```

  Guix Build:
  ```bash
  3d180219536b4ae2b4ea012a2e2afc8dcc76a79a7f55a36418a6e5a83f5adf90  guix-build-3cfe366ec35e/output/aarch64-linux-gnu/SHA256SUMS.part
  c25fbd84b7791d5bd3cab36d26828bf2b1063fadc4e944096e65597b66aba867  guix-build-3cfe366ec35e/output/aarch64-linux-gnu/bitcoin-3cfe366ec35e-aarch64-linux-gnu-debug.tar.gz
  bee8bf6f100912a0548cee798abb1ee9ac1ee17c065259a2410950e71eb3ff13  guix-build-3cfe366ec35e/output/aarch64-linux-gnu/bitcoin-3cfe366ec35e-aarch64-linux-gnu.tar.gz
  caa17fa9ba8b731c903a96211b2c17e8a1e2600bd9df8abd79eac4a89bfff72d  guix-build-3cfe366ec35e/output/arm-linux-gnueabihf/SHA256SUMS.part
  27829fab271cca459e2d037c42ccbefbbbbb1eb4463d5895d5a40220d737ecd9  guix-build-3cfe366ec35e/output/arm-linux-gnueabihf/bitcoin-3cfe366ec35e-arm-linux-gnueabihf-debug.tar.gz
  6b3eba0d9518dce3a6b7d88a32ae2a5b5ab943126e2a105d4ee6a861d44bea6f  guix-build-3cfe366ec35e/output/arm-linux-gnueabihf/bitcoin-3cfe366ec35e-arm-linux-gnueabihf.tar.gz
  855ab932aa0cc6d583a0f0422b1373afd44bff244e0022f29ce45305e5c8e8e2  guix-build-3cfe366ec35e/output/arm64-apple-darwin/SHA256SUMS.part
  02aabfdfe730400550bfc01e45055f6bc5b643511f08e314634c06b462a00c9e  guix-build-3cfe366ec35e/output/arm64-apple-darwin/bitcoin-3cfe366ec35e-arm64-apple-darwin-unsigned.dmg
  310722826ba985c58d800135f7ba9c73489e138cbf1b84a50be4f13453918ce1  guix-build-3cfe366ec35e/output/arm64-apple-darwin/bitcoin-3cfe366ec35e-arm64-apple-darwin-unsigned.tar.gz
  52d4f1af1e2608da4fa28ed446301d5c516e492c760db03c05c2a421c0a64ab9  guix-build-3cfe366ec35e/output/arm64-apple-darwin/bitcoin-3cfe366ec35e-arm64-apple-darwin.tar.gz
  2055c29fcde9aba8274d3649ea0c34ef0dac207d9d6f6a76fd9df9b010cdd7a8  guix-build-3cfe366ec35e/output/dist-archive/bitcoin-3cfe366ec35e.tar.gz
  99feae7ee4bfaf818efe49fbc9de81575a1e087593059bd630da70f5c6b8a7c8  guix-build-3cfe366ec35e/output/powerpc64-linux-gnu/SHA256SUMS.part
  7a55a6287eec3cfe598378684293b077791da234f1d5fcfe6f368e42f8a52428  guix-build-3cfe366ec35e/output/powerpc64-linux-gnu/bitcoin-3cfe366ec35e-powerpc64-linux-gnu-debug.tar.gz
  c2ba080a26b4bbfa443113d0044d07b97cc08f55df6bec90f162232f3f934c58  guix-build-3cfe366ec35e/output/powerpc64-linux-gnu/bitcoin-3cfe366ec35e-powerpc64-linux-gnu.tar.gz
  a670349367e671e73317476795eb7317559bf171d3facdfc2086031eb9dca264  guix-build-3cfe366ec35e/output/powerpc64le-linux-gnu/SHA256SUMS.part
  f9c0683f515bfd072ad18a780ad35ace7e4f5529d5bd9fffc06490d55bac402e  guix-build-3cfe366ec35e/output/powerpc64le-linux-gnu/bitcoin-3cfe366ec35e-powerpc64le-linux-gnu-debug.tar.gz
  608cce8d989b6cbfa723d57744a7e0ceac6a8668b12b4e223fe3de7833fe73ac  guix-build-3cfe366ec35e/output/powerpc64le-linux-gnu/bitcoin-3cfe366ec35e-powerpc64le-linux-gnu.tar.gz
  bbdebd22afc49c66c70738f68e3beea363c4a03701ccbb729d6f0eb0a0eaf150  guix-build-3cfe366ec35e/output/riscv64-linux-gnu/SHA256SUMS.part
  a84871c91a9b9d3423e9b86ffd46eb926672a1a88a3a3df1a5e8288a1fe6d98b  guix-build-3cfe366ec35e/output/riscv64-linux-gnu/bitcoin-3cfe366ec35e-riscv64-linux-gnu-debug.tar.gz
  21a89eb023113398bc1968284cbea86c6630284cb09325b9cee9669348206683  guix-build-3cfe366ec35e/output/riscv64-linux-gnu/bitcoin-3cfe366ec35e-riscv64-linux-gnu.tar.gz
  10f4ef77a97420490bc4494797d0acf8278f5bd4998b6c32881e611cc2faf237  guix-build-3cfe366ec35e/output/x86_64-apple-darwin/SHA256SUMS.part
  6e47a3676e76cd7175a08b6da81dcf7186849aba7c2ee95f12e998fdf1d4596d  guix-build-3cfe366ec35e/output/x86_64-apple-darwin/bitcoin-3cfe366ec35e-x86_64-apple-darwin-unsigned.dmg
  9ca8cd648a464e4e0bef107e23876d4588866eb12b844484a16fe93e4cd2f3b3  guix-build-3cfe366ec35e/output/x86_64-apple-darwin/bitcoin-3cfe366ec35e-x86_64-apple-darwin-unsigned.tar.gz
  89c7a5040683b63f58667f4eea6827af2874fc0962ddba3a158ad3aa78b8a407  guix-build-3cfe366ec35e/output/x86_64-apple-darwin/bitcoin-3cfe366ec35e-x86_64-apple-darwin.tar.gz
  1577c7f6c5eb7cb073c0ba32cfe7347df5aeaf62508d0ba1936506b1cb8a739e  guix-build-3cfe366ec35e/output/x86_64-linux-gnu/SHA256SUMS.part
  8703d39ce218216ee43502e030d3b3fbe6a00bdab82e8cd0706fa597fc6e11b7  guix-build-3cfe366ec35e/output/x86_64-linux-gnu/bitcoin-3cfe366ec35e-x86_64-linux-gnu-debug.tar.gz
  3e4d44d3cddfe2e34c12f55a704f791834385e1a867856e8a1c05f4f4fb3482a  guix-build-3cfe366ec35e/output/x86_64-linux-gnu/bitcoin-3cfe366ec35e-x86_64-linux-gnu.tar.gz
  87186fbcc7f0580ef3a347603c868f96bba31a987cad86991fa79b740d41f654  guix-build-3cfe366ec35e/output/x86_64-w64-mingw32/SHA256SUMS.part
  ceefefe1eb1d518f1534e0e3d51347332874016ce6adeba691fbbfc0b561437a  guix-build-3cfe366ec35e/output/x86_64-w64-mingw32/bitcoin-3cfe366ec35e-win64-debug.zip
  7bf2736457431bbba5c64b5320dd1c72d0d13fae59127fcc92805946de83908a  guix-build-3cfe366ec35e/output/x86_64-w64-mingw32/bitcoin-3cfe366ec35e-win64-setup-unsigned.exe
  721838ac437db5764c22c90d9c0a0b51283d6a50da8c60a6bccb394090380195  guix-build-3cfe366ec35e/output/x86_64-w64-mingw32/bitcoin-3cfe366ec35e-win64-unsigned.tar.gz
  dd58422fc4fd89353002bdb6a546b997fe31546c348a9b4a87bc697913abd382  guix-build-3cfe366ec35e/output/x86_64-w64-mingw32/bitcoin-3cfe366ec35e-win64.zip
  ```

ACKs for top commit:
  TheCharlatan:
    ACK 3cfe366ec3

Tree-SHA512: b1f30f8775acd69e897784c2168887eedc008db80f6d2d0d68390716965fbd3ddfd70fd1560ef30a8cc70941e9010c395c7feed9386ca92b2c9148d063d64724
2023-05-22 10:49:07 +01:00
fanquake
5421dc3244
Merge bitcoin/bitcoin#27561: test: Explicitly specify directory where to search tests for
c44f3f2319 test: Explicitly specify directory where to search tests for (Hennadii Stepanov)

Pull request description:

  For out-of-source builds, the `test/functional/test_runner.py` is supposed to be run from the build directory which allows it to pick the `test/config.ini` file generated by the build system. Currently, it works accidently for the following reasons:
  - on POSIX systems, when running a created by Autoconf symlink to the `test/functional/test_runner.py` in the source directory, it actually has the source directory location in the `sys.path`.
  - on Windows (the `build_msvc` directory) VS project puts and copies every build artifact into the source tree (which is wrong and ugly).

  This PR makes `test/functional/test_runner.py` work from a build directory in any form (a symbolic link, a hard link, a copy) on _all_ supported platforms, which is highly desirable in the upcoming [CMake-based build system](https://github.com/bitcoin/bitcoin/pull/25797).

  For the current master branch, this PR has no behaviour change.

  Required for https://github.com/hebasto/bitcoin/pull/15.

  ---

  **Steps to reproduce the issue**

  While the issue is mostly specific to Windows and CMake builds, it is still possible to reproduce it on the current master branch.

  1. Make an out-of-source build:
  ```
  $ ./autogen.sh
  $ mkdir ../build && cd ../build
  $ ../bitcoin/configure
  $ make
  ```

  2. Note that Autoconf created a symbolic link `test/functional/test_runner.py` in the `../build` directory:
  ```
  $ ls -l test/functional/test_runner.py
  lrwxrwxrwx 1 hebasto hebasto 47 May  5 17:40 test/functional/test_runner.py -> ../../../bitcoin/test/functional/test_runner.py
  ```
  which works flawlessly.

  3. However, replacing this symbolic link with a hard link or a copy of `test/functional/test_runner.py` from the source tree will cause the following error:
  ```
  $ cp ../bitcoin/test/functional/test_runner.py test/functional/test_runner.py
  $ ls -l test/functional/test_runner.py
  $ ./test/functional/test_runner.py
  Temporary test directory at /tmp/test_runner_₿_🏃_20230505_175104
  Running Unit Tests for Test Framework Modules
  E
  ======================================================================
  ERROR: test_framework (unittest.loader._FailedTest)
  ----------------------------------------------------------------------
  ImportError: Failed to import test module: test_framework
  Traceback (most recent call last):
    File "/usr/lib/python3.10/unittest/loader.py", line 154, in loadTestsFromName
      module = __import__(module_name)
  ModuleNotFoundError: No module named 'test_framework'

  ----------------------------------------------------------------------
  Ran 1 test in 0.000s

  FAILED (errors=1)
  Early exiting after failure in TestFramework unit tests
  ```

ACKs for top commit:
  stickies-v:
    re-ACK c44f3f2319
  MarcoFalke:
    lgtm ACK c44f3f2319 💸

Tree-SHA512: 622ff629080a55f76dd4c1dab6699de0e9f06b75da3315cd3b31b972ef4bde746458bf3e8a95e879b3c6a63be2368af70005a83f6a3c85c4f1ba5be51e91a61d
2023-05-22 10:21:08 +01:00
fanquake
a106a86c46
Merge bitcoin/bitcoin#27696: build: Do not define ENABLE_ZMQ when ZMQ is not available
fa5831bd6f build: Do not define `ENABLE_ZMQ` when ZMQ is not available (Hennadii Stepanov)

Pull request description:

  A new behavior is consistent with the other optional dependencies.

  The source code contains `#if ENABLE_ZMQ` lines only:
  ```
  $ git grep ENABLE_ZMQ -- src/*.cpp
  src/init.cpp:#if ENABLE_ZMQ
  src/init.cpp:#if ENABLE_ZMQ
  src/init.cpp:#if ENABLE_ZMQ
  src/init.cpp:#if ENABLE_ZMQ
  src/init.cpp:#if ENABLE_ZMQ
  ```

  Change in description line -- "Define to 1..." -->  "Define this symbol.." -- is motivated by the fact that the actual value of the defined `ENABLE_ZMQ` macro does not matter at all.

  Related to:
  - https://github.com/bitcoin/bitcoin/issues/16419
  - https://github.com/bitcoin/bitcoin/pull/25302

ACKs for top commit:
  TheCharlatan:
    ACK fa5831bd6f
  jarolrod:
    ACK fa5831bd6f

Tree-SHA512: 5e72ff0d34c4b33205338daea0aae8d7aa0e48fd633e21af01af32b7ddb0532ef68dd3dd74deb2c1d2599691929617e8c09676bcbaaf7d669b88816f866f1db2
2023-05-22 10:00:15 +01:00
fanquake
f998eb7662
Merge bitcoin/bitcoin#27683: ci: remove RUN_SECURITY_TESTS
6a936580d1 ci: remove RUN_SECURITY_TESTS (fanquake)

Pull request description:

  We no-longer run any security/symbol checks in the CI, and doubt we will in future (if we do, it'll be via Guix, where this var would be redundant in any case). The CI environment doesn't (exactly) match the release build environment (and is semi-regularly changing), and the binaries produced in the CI don't match how we build release binaries, so there is no point trying to run these checks, especially as we add more involved tests, i.e #26953.

ACKs for top commit:
  josibake:
    code review ACK 6a936580d1
  TheCharlatan:
    ACK 6a936580d1

Tree-SHA512: c0eec61a4b873bac487ba9321b50116a215b4796bd7d416d98ffcd09969dbf635c2cb5aeb225c89d1e6462838fa2a48565048ebe730f48d76d3db46b64855a91
2023-05-22 09:52:27 +01:00
fanquake
9a8318f30b
Merge bitcoin/bitcoin#27707: ci, iwyu: Double maximum line length for includes
98ea798411 ci, iwyu: Double maximum line length for includes (Hennadii Stepanov)

Pull request description:

  This PR makes the IWYU output in the CI 'tidy' task more useful by avoiding most cases where a comment ends with an ellipsis like that:
  ```
  #include "primitives/transaction.h"  // for CTxIn, CMutableTransaction, CTra...
  ```

ACKs for top commit:
  TheCharlatan:
    ACK 98ea798411

Tree-SHA512: 25195ccb2095884b23586416b86999ebc42577c6d777abdbd176a704fa75c64deb91fa61cd91d570a5408dd459e930e53bc70d963b76c73fca7a800e74b1bdbf
2023-05-22 09:42:42 +01:00
MarcoFalke
fa1b3abc83
ci: Log qa-assets repo last commit
This documents the state in the CI output and may help debugging in case
of failure.
2023-05-22 10:02:40 +02:00
MarcoFalke
fa22966f33
fuzz: Print error message when FUZZ is missing
Also, add missing includes.
2023-05-22 10:02:29 +02:00
Sebastian Falbesoner
a97c59f12d test: p2p: check misbehavior for non-continuous headers messages 2023-05-21 15:21:35 +02:00
fanquake
5228223e1f
ci: remove MSAN getrandom syscall workaround
The corresponding workaround will also be dropped in oss-fuzz:
25946a5448/projects/bitcoin-core/build.sh (L49).
2023-05-20 17:20:06 +01:00
fanquake
d5e06919db
random: switch to using getrandom() directly
This requires a linux kernel of 3.17.0+, which seems entirely
reasonable. 3.17 went EOL in 2015, and the last supported 3.x kernel
(3.16) went EOL > 4 years ago, in 2020. For reference, the current
oldest maintained kernel is 4.14 (released 2017, EOL Jan 2024).

Support for `getrandom()` (and `getentropy()`) was added to
glibc 2.25, https://sourceware.org/legacy-ml/libc-alpha/2017-02/msg00079.html,
and we already require 2.27+.

All that being said, I don't think you would encounter a current day
system, running with kernel headers older than 3.17 (released 2014) but
also having a glibc of 2.27+ (released 2018).
2023-05-20 17:20:01 +01:00
fanquake
c2ba3f5b0c
random: add [[maybe_unused]] to GetDevURandom
Rather than multiple instances of (void)GetDevURandom to silence
compiler warnings.
2023-05-20 17:09:48 +01:00
fanquake
c13c97dbf8
random: getentropy on macOS does not need unistd.h
Remove it. Make this change, so in a future commit, we can
combine #ifdefs, and avoid duplicate <sys/random.h> includes once we
switch to using getrandom directly.

Also remove the comment about macOS 10.12. We already require macOS >
10.15, so it is redundant.
2023-05-20 17:09:47 +01:00
Hennadii Stepanov
98ea798411
ci, iwyu: Double maximum line length for includes 2023-05-20 13:16:26 +01:00
fanquake
17acb2782a
Merge bitcoin/bitcoin#27688: doc: remove Security section from build-unix.md
4bfcbbfd4a doc: remove Security section from build-unix.md (fanquake)

Pull request description:

  Our compile documentation isn't the right place for generic binary hardening notes, which are neither particularly Bitcoin-Core specific, or as relevant as they might have once been, i.e non-executable stacks are now just the norm.

  Just remove the notes for now, if someone has something more interesting/Bitcoin Core specific, it could be added in separate documentation in the future (maybe into the devwiki or similar).

  Split from https://github.com/bitcoin/bitcoin/pull/27685#discussion_r1196517868.

ACKs for top commit:
  jarolrod:
    ACK 4bfcbbfd4a

Tree-SHA512: 01b523ba40353d6cafb5dbd6540b514d83a2dc4e462a068fb390ca7de45b78e4a329367f70527f1824006ebe43f8caeea4ad05ec60556d5a5bd0143e27bf6581
2023-05-20 11:29:12 +01:00
TheCharlatan
7d3b35004b
refactor: Move system from util to common library
Since the kernel library no longer depends on the system file, move it
to the common library instead in accordance to the diagram in
doc/design/libraries.md.
2023-05-20 12:08:13 +02:00
TheCharlatan
7eee356c0a
refactor: Split util::AnyPtr into its own file 2023-05-20 12:03:33 +02:00
TheCharlatan
44de325d95
refactor: Split util::insert into its own file 2023-05-20 12:03:31 +02:00
TheCharlatan
9ec5da36b6
refactor: Move ScheduleBatchPriority to its own file
With the previous move of AlertNotify out of the validation file, and
thus out of the kernel library, ScheduleBatchPriority is the last
remaining function used by the kernel library from util/system. Move it
to its own file, such that util/system can be moved out of the util
library in the following few commits.

Moving util/system out of the kernel library removes further networking
as well as shell related code from it.
2023-05-20 12:03:30 +02:00
TheCharlatan
f871c69191
kernel: Add warning method to notifications
This commit is part of the libbitcoinkernel project and seeks to remove
the ChainstateManager's and, more generally, the kernel library's
dependency on interface_ui with options methods in this and the following
few commits. By removing interface_ui from the kernel library, its
dependency on boost is reduced to just boost::multi_index.

The DoWarning and AlertNotify functions are moved out of the
validation.cpp file, which removes its dependency on interface_ui as
well as util/system.
2023-05-20 12:03:28 +02:00
TheCharlatan
4452707ede
kernel: Add progress method to notifications
This commit is part of the libbitcoinkernel project and seeks to remove
the ChainstateManager's and, more generally, the kernel library's
dependency on interface_ui with options methods in this and the
following few commits. By removing interface_ui from the kernel library,
its dependency on boost is reduced to just boost::multi_index.
2023-05-20 12:03:26 +02:00
TheCharlatan
84d71457e7
kernel: Add headerTip method to notifications
This commit is part of the libbitcoinkernel project and seeks to remove
the ChainstateManager's and, more generally, the kernel library's
dependency on interface_ui with options methods in this and the following
few commits. By removing interface_ui from the kernel library, its
dependency on boost is reduced to just boost::multi_index.
2023-05-20 12:03:24 +02:00
TheCharlatan
447761c822
kernel: Add notification interface
This commit is part of the libbitcoinkernel project and seeks to remove
the ChainstateManager's and, more generally, the kernel library's
dependency on interface_ui with options methods in this and the following
few commits. By removing interface_ui from the kernel library, its
dependency on boost is reduced to just boost::multi_index.

Define a new kernel notification class with virtual methods for
notifying about internal kernel events. Create a new file in the node
library for defining a function creating the default set of notification
methods such that these do not need to be re-defined all over the
codebase. As a first step, add a `blockTip` method, wrapping
`uiInterface.NotifyBlockTip`.
2023-05-20 12:03:22 +02:00
Hennadii Stepanov
c44f3f2319
test: Explicitly specify directory where to search tests for
This change allows `test_runner.py` to work from an out-of-source build
directory using a symlink, a hard link or a copy on any platform.
2023-05-19 19:21:10 +01:00
glozow
0f8c95dccd
Merge bitcoin/bitcoin#27021: Implement Mini version of BlockAssembler to calculate mining scores
6b605b91c1 [fuzz] Add MiniMiner target + diff fuzz against BlockAssembler (glozow)
3f3f2d59ea [unit test] GatherClusters and MiniMiner unit tests (glozow)
59afcc8354 Implement Mini version of BlockAssembler to calculate mining scores (glozow)
56484f0fdc [mempool] find connected mempool entries with GatherClusters(…) (glozow)

Pull request description:

  Implement Mini version of BlockAssembler to calculate mining scores

  Run the mining algorithm on a subset of the mempool, only disturbing the
  mempool to copy out fee information for relevant entries. Intended to be
  used by wallet to calculate amounts needed for fee-bumping unconfirmed
  transactions.

  From comments of sipa and glozow below:

  > > In what way does the code added here differ from the real block assembly code?
  >
  >    * Only operates on the relevant transactions rather than full mempool
  >    * Has the ability to remove transactions that will be replaced so they don't impact their ancestors
  >    * Does not hold mempool lock outside of the constructor, makes copies of the entries it needs instead (though I'm not sure if this has an effect in practice)
  >    * Doesn't do the sanity checks like keeping weight within max block weight and `IsFinalTx()`
  >    * After the block template is built, additionally calculates fees to bump remaining ancestor packages to target feerate

ACKs for top commit:
  achow101:
    ACK 6b605b91c1
  Xekyo:
    > ACK [6b605b9](6b605b91c1) modulo `miniminer_overlap` test.
  furszy:
    ACK 6b605b91 modulo `miniminer_overlap` test.
  theStack:
    Code-review ACK 6b605b91c1

Tree-SHA512: f86a8b4ae0506858a7b15d90f417ebceea5038b395c05c825e3796123ad3b6cb8a98ebb948521316802a4c6d60ebd7041093356b1e2c2922a06b3b96b3b8acb6
2023-05-19 10:26:19 -04:00
brunoerg
272eb55616 test: fix include_immature_coinbase logic in get_utxos
Use current block height to compute the confirmation count
instead of using the value from utxo object
2023-05-19 09:13:30 -03:00
brunoerg
a951c34f17 test: fix interface_usdt_mempool by mining a block after each test
Co-authored-by: josibake <josibake@protonmail.com>
2023-05-19 09:13:30 -03:00