0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-22 12:23:34 -05:00
Commit graph

43926 commits

Author SHA1 Message Date
Cory Fields
f605f7a9c2 build: refactor: set debug definitions in main CMakeLists
No functional change. This is a simple move required the next commit.
2025-02-06 20:21:37 +00:00
Greg Sanders
2706c5b7c8 test: test_inv_block, use mocktime instead of waiting 2025-02-06 11:36:40 -05:00
Sergi Delgado Segura
0a02e7fdea test: deduplicates p2p_tx_download constants
Some of the networking constants defined in p2p_tx_download.py are more generally
defined in p2p.py

Also, rename the remaining ones to match ones defined in txdownloadman
2025-02-06 10:45:40 -05:00
Hennadii Stepanov
2f27c91086
qt: Update the src/qt/locale/bitcoin_en.xlf translation source file
Steps to reproduce the diff:
```
$ gmake -C depends -j $(nproc) MULTIPROCESS=1
$ cmake --preset dev-mode --toolchain depends/$(./depends/config.guess)/toolchain.cmake
$ cmake --build build_dev_mode --target translate
```
2025-02-06 10:30:30 +00:00
Hennadii Stepanov
864386a744
cmake: Ensure generated sources are up to date for translate target
Some sources might be generated, and while they likely do not contain
any translatable strings, this change generalizes the approach to
include generated sources in the translation process as well.
2025-02-06 10:24:45 +00:00
merge-script
d6c229d8bd
Merge bitcoin/bitcoin#31804: ci: Remove no longer needed -Wno-error=documentation
f1d7a6dfa1 ci: Remove no longer needed '-Wno-error=documentation' (Hennadii Stepanov)

Pull request description:

  Picked from https://github.com/bitcoin/bitcoin/pull/31726.

ACKs for top commit:
  maflcko:
    lgtm ACK f1d7a6dfa1

Tree-SHA512: 2c4b197da1a60662922341062f9c1fe43b0e35a50194f4757057a48d7538f2f68540ed56508193a5c6a81e3f7dfbca78b15e3c101aae08d8ccd1fc5df0535932
2025-02-06 10:00:03 +00:00
Hennadii Stepanov
2b51dd384b
Update Transifex slug for 29.x
Update the Transifex slug to match the new resource created for the
upcoming 29.x branch.
2025-02-06 09:38:49 +00:00
glozow
82ba505134
Merge bitcoin/bitcoin#31759: test: fixes p2p_ibd_txrelay wait time
1973a9e4f1 test: fixes p2p_ibd_txrelay wait time (Sergi Delgado Segura)

Pull request description:

  `p2p_ibd_txrelay` expects no GETDATA to have been received by a peer after announcing a transaction. The reason is that the node is doing IBD, so transaction requests are not replied to. However, the way this is checked is wrong, and the check will pass even if the node **was not** in IBD.

  This is due to the mocktime not being properly initialized, so the check is always performed earlier than it should, making it impossible for the request to be there.

  This can be checked by modifying the test so the peer **is not doing IBD**, and checking how the test succeeds on that assert (even though it fails later on, given the nature of the test):

  ```diff
  index 882f5b5c13..3a69ae5860 100755
  --- a/test/functional/p2p_ibd_txrelay.py
  +++ b/test/functional/p2p_ibd_txrelay.py
  @@ -34,7 +34,7 @@ NORMAL_FEE_FILTER = Decimal(100) / COIN

   class P2PIBDTxRelayTest(BitcoinTestFramework):
       def set_test_params(self):
  -        self.setup_clean_chain = True
  +        # self.setup_clean_chain = True
           self.num_nodes = 2
           self.extra_args = [
               ["-minrelaytxfee={}".format(NORMAL_FEE_FILTER)],
  @@ -43,9 +43,11 @@ class P2PIBDTxRelayTest(BitcoinTestFramework):

       def run_test(self):
           self.log.info("Check that nodes set minfilter to MAX_MONEY while still in IBD")
  -        for node in self.nodes:
  -            assert node.getblockchaininfo()['initialblockdownload']
  -            self.wait_until(lambda: all(peer['minfeefilter'] == MAX_FEE_FILTER for peer in node.getpeerinfo()))
  +        # for node in self.nodes:
  +        #     assert node.getblockchaininfo()['initialblockdownload']
  +        #     self.wait_until(lambda: all(peer['minfeefilter'] == MAX_FEE_FILTER for peer in node.getpeerinfo()))
  ```

ACKs for top commit:
  i-am-yuvi:
    ACK 1973a9e4f1
  glozow:
    ACK 1973a9e4f1

Tree-SHA512: c4b3afe9927c5480671ebf5c1f6ee5fc7e3aeefeb13c210fa83587a6c126e1a8e40ad8e46587537d0f4bf06a36bbf2310ca065d685d4d9286e5a446b8d5b2235
2025-02-06 00:57:29 -05:00
glozow
ae9eaa063b
Merge bitcoin/bitcoin#31760: test: make sure we are on sync with a peer before checking if they have sent a message
3f4b104b1b test: make sure we are on sync with a peer before checking if they have sent a message (Sergi Delgado Segura)

Pull request description:

  p2p_orphan_handling checks whether a message has not been requested slightly too soon, making the check always succeed. This passes unnoticed since the expected result is for the message to not have been received, but it will make the test not catch a relevant change that should make it fail.

  An easy way to check this is the case is to modify one of the test cases to force a request within the expected time, and check how the request is not seen. After the change, the test would crash as expected:

  ```diff
  index 963d92485c..30ab5f2035 100755
  --- a/test/functional/p2p_orphan_handling.py
  +++ b/test/functional/p2p_orphan_handling.py
  @@ -186,9 +185,12 @@ class OrphanHandlingTest(BitcoinTestFramework):
           parent_inv = CInv(t=MSG_WTX, h=int(tx_parent_arrives["tx"].getwtxid(), 16))
           assert_equal(len(peer_spy.get_invs()), 0)
           peer_spy.assert_no_immediate_response(msg_getdata([parent_inv]))
  +        txid = 0xdeadbeef
  +        peer_spy.send_and_ping(msg_inv([CInv(t=MSG_WTX, h=txid)]))

           # Request would be scheduled with this delay because it is not a preferred relay peer.
           self.nodes[0].bumpmocktime(NONPREF_PEER_TX_DELAY)
  +        peer_spy.assert_never_requested(int(txid))
           peer_spy.assert_never_requested(int(tx_parent_arrives["txid"], 16))
           peer_spy.assert_never_requested(int(tx_parent_doesnt_arrive["txid"], 16))
           # Request would be scheduled with this delay because it is by txid.
  ```

  It is worth noting that this is not seen in the cases where the message is expected to be received, because in such cases `assert_never_requested` is always after a `wait_....` method, which is already waiting for the node to sync on their end.

ACKs for top commit:
  i-am-yuvi:
    ACK 3f4b104b1b
  instagibbs:
    ACK 3f4b104b1b
  glozow:
    ACK 3f4b104b1b

Tree-SHA512: 321a6605d630bed2217b6374e999dbb84da14138263dd8adf65fe3a6cd7981a50c873beced9cf05cb6d747a912e91017c58e7d4323d25449c87d83095ff4cba9
2025-02-06 00:02:00 -05:00
Hennadii Stepanov
f1d7a6dfa1
ci: Remove no longer needed '-Wno-error=documentation' 2025-02-05 17:24:36 +00:00
merge-script
a43f08c4ae
Merge bitcoin/bitcoin#25832: tracing: network connection tracepoints
e3622a9692 tracing: document that peer addrs can be >68 chars (0xb10c)
b19b526758 tracing: log_p2p_connections.bt example (0xb10c)
caa5486574 tracing: connection closed tracepoint (0xb10c)
b2ad6ede95 tracing: add misbehaving conn tracepoint (0xb10c)
68c1ef4f19 tracing: add inbound connection eviction tracepoint (0xb10c)
4d61d52f43 tracing: add outbound connection tracepoint (0xb10c)
85b2603eec tracing: add inbound connection tracepoint (0xb10c)

Pull request description:

  This adds five new tracepoints with documentation and tests for network connections:

  - established connections with `net:inbound_connection` and `net:outbound_connection`
  - closed connections (both closed by us or by the peer) with `net:closed_connnection`
  - inbound connections that we choose to evict with `net:evicted_inbound_connection`
  - connections that are misbehaving and punished with `net:misbehaving_connection`

  I've been using these tracepoints for a few months now to monitor connection lifetimes, re-connection frequency by IP and netgroup, misbehavior, peer discouragement, and eviction and more. Together with the two existing P2P message tracepoints they allow for a good overview of local P2P network activity. Also sort-of addresses https://github.com/bitcoin/bitcoin/pull/22006#discussion_r636775863.

  I've been back and forth on which arguments to include. For example, `net:evicted_connection` could also include some of the eviction metrics like e.g. `last_block_time`, `min_ping_time`, ... but I've left them out for now. If wanted, this can be added here or in a follow-up. I've tried to minimize a potential performance impact by measuring executed instructions with `gdb` where possible (method described [here](https://github.com/bitcoin/bitcoin/pull/23724#issuecomment-996919963)). I don't think a few hundred extra instructions are too crucial, as connection opens/closes aren't too frequent (compared to e.g. P2P messages).   Note: e.g. `CreateNodeFromAcceptedSocket()` usually executes between 80k and 90k instructions for each new inbound connection.

  | tracepoint                 | instructions                                           |
  |----------------------------|--------------------------------------------------------|
  | net:inbound_connection     | 390 ins                                                |
  | net:outbound_connection    | between 700 and 1000 ins                                     |
  | net:closed_connnection     | 473 ins                                                |
  | net:evicted_inbound_connection     | not measured; likely similar to net:closed_connnection |
  | net:misbehaving_connection | not measured                                           |

  Also added a bpftrace (tested with v0.14.1) `log_p2p_connections.bt` example script that produces output similar to:
  ```
  Attaching 6 probes...
  Logging opened, closed, misbehaving, and evicted P2P connections
  OUTBOUND conn to 127.0.0.1:15287: id=0, type=block-relay-only, network=0, total_out=1
  INBOUND conn from 127.0.0.1:45324: id=1, type=inbound, network=0, total_in=1
  MISBEHAVING conn id=1, message='getdata message size = 50001'
  CLOSED conn to 127.0.0.1:15287: id=0, type=block-relay-only, network=0, established=1231006505
  EVICTED conn to 127.0.0.1:45324: id=1, type=inbound, network=0, established=1612312312
  ```

ACKs for top commit:
  laanwj:
    re-ACK e3622a9692
  vasild:
    ACK e3622a9692
  sipa:
    utACK e3622a9692

Tree-SHA512: 1032dcac6fe0ced981715606f82c2db47016407d3accb8f216c978f010da9bc20453e24a167dcc95287f4783b48562ffb90f645bf230990e3df1b9b9a6d4e5d0
2025-02-05 15:30:52 +00:00
Hennadii Stepanov
407062f2ac
depends: Avoid using the -ffile-prefix-map compiler option
The `-ffile-prefix-map` compiler option implicitly enables
`-fprofile-prefix-map` in GCC or `-fcoverage-prefix-map` in Clang, which
can cause issues with coverage builds.

This change ensures that only the options necessary for build
reproducibility are applied.
2025-02-05 14:36:48 +00:00
merge-script
b9c241804c
Merge bitcoin/bitcoin#30226: test: add validation for gettxout RPC response
723440c5b8 test framework, wallet: rename get_scriptPubKey method to get_output_script (Alfonso Roman Zubeldia)
fa0232a3e0 test: add validation for gettxout RPC response (Alfonso Roman Zubeldia)

Pull request description:

  Added a new test in `test/functional/rpc_blockchain.py` to validate the gettxout RPC response. This new test ensures all response elements are verified, including `bestblock`, `confirmations`, `value`, `coinbase`, and `scriptPubKey` details.

  Also renamed the method `get_scriptPubKey` from `test/functional/test_framework/wallet.py` to the modern name `get_output_script` as suggested by maflcko (https://github.com/bitcoin/bitcoin/pull/30226#discussion_r1925491846)

ACKs for top commit:
  fjahr:
    reACK 723440c5b8
  maflcko:
    lgtm ACK 723440c5b8
  brunoerg:
    code review ACK 723440c5b8

Tree-SHA512: 3384578909d2e7548cef302c5b8a9fed5b82dfc942892503ad4a05e73f5cceafad1eab3af9a27e54aef3db7631f8935298d6b882c70d2f02a9a75b8e3c209b6c
2025-02-05 13:30:51 +00:00
merge-script
1334ca6c07
Merge bitcoin/bitcoin#31437: func test: Expand tx download preference tests
846a138728 func test: Expand tx download preference tests (Greg Sanders)

Pull request description:

  1. Check that outbound nodes are treated the same as whitelisted connections for
  the purposes of `getdata` delays

  2. Add test case that demonstrates download retries are preferentially
  given to outbound (preferred) connections
  even when multiple announcements are
  considered ready.

  `NUM_INBOUND` is a magic number large enough that it should fail over 90% of the time
  if the underlying outbound->preferred->PriorityComputer logic was broken. Bumping this
  to 100 peers cost another 14 seconds locally for the sub-test, so I made it pretty small.

ACKs for top commit:
  i-am-yuvi:
    tACK 846a138728 good catch
  maflcko:
    ACK 846a138728 🍕
  marcofleon:
    lgtm ACK 846a138728

Tree-SHA512: 337aa4dc33b5c0abeb4fe7e4cd5e389f7f53ae25dd991ba26615c16999872542391993020122fd255af4c7163f76c1d1feb2f2d6114f12a364c0360d4d52b8c3
2025-02-05 13:21:58 +00:00
merge-script
33932d30e3
Merge bitcoin/bitcoin#31784: test: added additional coverage to waitforblock and waitforblockheight rpc's
7e0db87d4f test: added additional coverage to waitforblock and waitforblockheight rpc's (kevkevinpal)

Pull request description:

  Similar to https://github.com/bitcoin/bitcoin/pull/31746

  This adds test coverage to the `waitforblock` and `waitforblockheight` rpc's by adding a test to assert we get an rpc error if we include a negative timeout

ACKs for top commit:
  Sjors:
    utACK 7e0db87d4f
  Prabhat1308:
    ACK [7e0db87](7e0db87d4f)
  brunoerg:
    code review ACK 7e0db87d4f
  BrandonOdiwuor:
    Code Review ACK 7e0db87d4f

Tree-SHA512: c3b1b3a525e91e0092b783d73d2401126e3b8792a394be00374258f20cf3d619498e6625d3aad5e5ced29509c5eac828ee03c4ee66ba405b91e89be7e8b07311
2025-02-05 10:38:00 +00:00
merge-script
2aa7be1744
Merge bitcoin/bitcoin#31358: depends: Avoid hardcoding host_prefix in toolchain file
d9c8aacce3 depends, refactor: Avoid hardcoding `host_prefix` in toolchain file (Hennadii Stepanov)

Pull request description:

  This PR allows the entire `depends/<host_prefix>` directory to be relocatable.

  Only `libevent` package configuration files are non-relocatable for the version `2.1.12-stable` we use now. However, this issue has been fixed upstream in 1f1593ff27 and friends.

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

ACKs for top commit:
  theuni:
    Neat. utACK d9c8aacce3
  ryanofsky:
    Code review ACK d9c8aacce3

Tree-SHA512: c4c340722e63fc1da36fba2b15f025a6e1d477da1991194d678f546f2f3ea9454e2f0ff054aae6ae6c332a0781a597c3ce63b9018b46b8c258033f0d19efbef3
2025-02-05 10:35:25 +00:00
ismaelsadeeq
386eecff5f
doc: add release notes 2025-02-04 11:57:56 -05:00
ismaelsadeeq
3eaa0a3b66
miner: init: add -blockreservedweight startup option
- Prevent setting the value of `-blockreservedweight` below
  a safety value of 2000.
2025-02-04 11:53:11 -05:00
ismaelsadeeq
777434a2cd
doc: rpc: improve getmininginfo help text
- The reserved weight of the coinbase transaction is an estimate and
  may not reflect the exact value; it can be lower.

- It should be clear that `currentblockweight` includes the reserved coinbase transaction weight.
  whereas `currentblocktx` does not account for the coinbase transaction count.

- Also clarify `m_last_block_num_txs` and `m_last_block_weight`
2025-02-04 11:53:11 -05:00
ismaelsadeeq
c8acd4032d
init: fail to start when -blockmaxweight exceeds MAX_BLOCK_WEIGHT 2025-02-04 11:53:11 -05:00
ismaelsadeeq
5bb31633cc
test: add -blockmaxweight startup option functional test 2025-02-04 11:53:11 -05:00
ismaelsadeeq
2c7d90a6d6
miner: bugfix: fix duplicate weight reservation in block assembler
- This commit renamed coinbase_max_additional_weight to block_reserved_weight.

- Also clarify that the reservation is for block header, transaction count
  and coinbase transaction.
2025-02-04 11:53:03 -05:00
MarcoFalke
fa5a02bcfa
ci: Use clang-20 for sanitizer tasks 2025-02-04 17:05:17 +01:00
brunoerg
bb0879ddab test: check scanning field from getwalletinfo
During a rescan, check that `getwalletinfo` returns
properly information (the scanning field) about it.
2025-02-04 10:48:20 -03:00
merge-script
94ca99ac51
Merge bitcoin/bitcoin#31666: multi-peer orphan resolution followups
7426afbe62 [p2p] assign just 1 random announcer in AddChildrenToWorkSet (glozow)
4c1fa6b28c test fix: make peer who sends MSG_TX announcement non-wtxidrelay (glozow)
2da46b88f0 pass P2PTxInvStore init args to P2PInterface init (glozow)
e3bd51e4b5 [doc] how unique_parents can be empty (glozow)
32eb6dc758 [refactor] assign local variable for wtxid (glozow)
18820ccf6b multi-announcer orphan handling test fixups (glozow)
c4cc61db98 [fuzz] GetCandidatePeers (glozow)
7704139cf0 [refactor] make GetCandidatePeers take uint256 and in-out vector (glozow)
6e4d392a75 [refactor] rename to OrphanResolutionCandidate to MaybeAdd* (glozow)
57221ad979 [refactor] move parent inv-adding to OrphanResolutionCandidate (glozow)

Pull request description:

  Followup to #31397.

  Addressing (in order):
  https://github.com/bitcoin/bitcoin/pull/31397#discussion_r1906077380
  https://github.com/bitcoin/bitcoin/pull/31397#discussion_r1881060842
  https://github.com/bitcoin/bitcoin/pull/31397#discussion_r1905994963
  https://github.com/bitcoin/bitcoin/pull/31397#discussion_r1905999581
  https://github.com/bitcoin/bitcoin/pull/31397#discussion_r1906001592
  https://github.com/bitcoin/bitcoin/pull/31397#discussion_r1905989913
  https://github.com/bitcoin/bitcoin/pull/31397#discussion_r1905920861
  https://github.com/bitcoin/bitcoin/pull/31658#pullrequestreview-2551617694
  https://github.com/bitcoin/bitcoin/pull/31397#discussion_r1917559601

ACKs for top commit:
  instagibbs:
    reACK 7426afbe62
  marcofleon:
    reACK 7426afbe62
  mzumsande:
    Code Review ACK 7426afbe62
  dergoegge:
    Code review ACK 7426afbe62

Tree-SHA512: bca8f576873fdaa20b758e1ee9708ce94e618ff14726864b29b50f0f9a4db58136a286d2b654af569b09433a028901fe6bcdda68dcbfea71e2d1271934725503
2025-02-04 10:10:29 +00:00
merge-script
6f5ae1a574
Merge bitcoin/bitcoin#31653: lint: Call more checks from test_runner
faf8fc5487 lint: Call lint_commit_msg from test_runner (MarcoFalke)
fa99728b0c lint: Move commit range printing to test_runner (MarcoFalke)
fa673cf344 lint: Call lint_scripted_diff from test_runner (MarcoFalke)

Pull request description:

  The lint `commit-script-check.sh` can not be called from the test_runner at all and must be called manually. Also, some checks require `COMMIT_RANGE` to be set.

  Fix all issues by moving two lint checks into the test_runner. Also, the proper commit range is passed to the checks by the test_runner, so that the user no longer has to do it.

ACKs for top commit:
  kevkevinpal:
    reACK [faf8fc5](faf8fc5487)
  willcl-ark:
    tACK faf8fc5487

Tree-SHA512: 78018adc618d997508c226c9eee0a4fada3899cdfd91587132ab1c0389aea69127bafc3a900e90e30aca2c6bae9dcd6e6188ef287e91413bc63ee66fb078b1af
2025-02-04 09:57:35 +00:00
0xb10c
e3622a9692
tracing: document that peer addrs can be >68 chars
A v3 onion address with a `:` and a five digit port has a length of
68 chars. As noted in
https://github.com/bitcoin/bitcoin/pull/25832#discussion_r1781040991
peers e.g. added via hostname might have a longer CNode::m_addr_name.
These might be cut off in tracing tools.
2025-02-04 10:25:39 +01:00
0xb10c
b19b526758
tracing: log_p2p_connections.bt example
A bpftrace script that logs information from the
net:*_connection tracepoints.

I've tested this script with bpftrace version 0.14.1 and v0.20.2.
2025-02-04 10:25:36 +01:00
0xb10c
caa5486574
tracing: connection closed tracepoint 2025-02-04 10:25:33 +01:00
0xb10c
b2ad6ede95
tracing: add misbehaving conn tracepoint 2025-02-04 10:25:22 +01:00
0xb10c
68c1ef4f19
tracing: add inbound connection eviction tracepoint 2025-02-04 10:25:14 +01:00
0xb10c
4d61d52f43
tracing: add outbound connection tracepoint 2025-02-04 10:25:04 +01:00
0xb10c
85b2603eec
tracing: add inbound connection tracepoint 2025-02-04 10:24:53 +01:00
kevkevinpal
7e0db87d4f test: added additional coverage to waitforblock and waitforblockheight rpc's 2025-02-03 09:07:52 -05:00
Hennadii Stepanov
f89f16846e
depends: Fix compiling libevent package on NetBSD 2025-02-03 09:20:43 +00:00
Hennadii Stepanov
1172bc4157
Merge bitcoin-core/gui#850: psbt: Use SIGHASH_DEFAULT when signing PSBTs
3e97ff9c5e gui, psbt: Use SIGHASH_DEFAULT when signing PSBTs (Ava Chow)

Pull request description:

  SIGHASH_DEFAULT should be used to indicate SIGHASH_DEFAULT for taproot inputs, and SIGHASH_ALL for all other input types. This avoids adding an unnecessary byte to the end of all Taproot signatures added to PSBTs signed in the GUI.

  See also bitcoin/bitcoin#22514

ACKs for top commit:
  Sjors:
    utACK 3e97ff9c5e
  pablomartin4btc:
    utACK 3e97ff9c5e
  hebasto:
    ACK 3e97ff9c5e, I have reviewed the code and it looks OK.

Tree-SHA512: f96f26b3a6959865cf23039afb5ffb7e454fb52ee39c510583851caf00a8a383cde69bc7e90db536addbdd498a02f4b001cbaf509d6d53c5f8601b3933786f6c
2025-02-02 09:49:19 +00:00
Ava Chow
85f96b01b7
Merge bitcoin/bitcoin#30909: wallet, assumeutxo: Don't Assume m_chain_tx_count, Improve wallet RPC errors
9d2d9f7ce2 rpc: Include assumeutxo as a failure reason of rescanblockchain (Fabian Jahr)
595edee169 test, assumeutxo: import descriptors during background sync (Alfonso Roman Zubeldia)
d73ae603d4 rpc: Improve importdescriptor RPC error messages (Fabian Jahr)
27f99b6d63 validation: Don't assume m_chain_tx_count in GuessVerificationProgress (Fabian Jahr)
42d5d53363 interfaces: Add helper function for wallet on pruning (Fabian Jahr)

Pull request description:

  A test that is added as part of #30455 uncovered this issue: The `GuessVerificationProgress` function is used during during descriptor import and relies on `m_chain_tx_count`. In #29370 an [`Assume` was added](0fd915ee6b) expecting the `m_chaint_tx_count` to be set. However, as the test uncovered, `GuessVerificationProgress` is called with background sync blocks that have `m_chaint_tx_count = 0` when they have not been downloaded and processed yet.

  The simple fix is to remove the `Assume`. Users should not be thrown off by the `Internal bug detected` error. The behavior of `importdescriptor` is kept consistent with the behavior for blocks missing due to pruning.

  The test by alfonsoromanz is cherry-picked here to show that the [CI errors](https://cirrus-ci.com/task/5110045812195328?logs=ci#L2535) should be fixed by this change.

  This PR also improves error messages returned by the `importdescriptors` and `rescanblockchain` RPCs. The error message now changes depending on the situation of the node, i.e. if pruning is happening or an assumutxo backgroundsync is active.

ACKs for top commit:
  achow101:
    ACK 9d2d9f7ce2
  mzumsande:
    Code Review ACK 9d2d9f7ce2
  furszy:
    Code review ACK 9d2d9f7ce2

Tree-SHA512: b841a9b371e5eb8eb3bfebca35645ff2fdded7a3e5e06308d46a33a51ca42cc4c258028c9958fbbb6cda9bb990e07ab8d8504dd9ec6705ef78afe0435912b365
2025-01-31 15:45:14 -05:00
Ava Chow
601a6a6917
Merge bitcoin/bitcoin#30965: kernel: Move block tree db open to block manager
0cdddeb224 kernel: Move block tree db open to BlockManager constructor (TheCharlatan)
7fbb1bc44b kernel: Move block tree db open to block manager (TheCharlatan)
57ba59c0cd refactor: Remove redundant reindex check (TheCharlatan)

Pull request description:

  Before this change the block tree db was needlessly re-opened during startup when loading a completed snapshot. Improve this by letting the block manager open it on construction. This also simplifies the test code a bit.

  The change was initially motivated to make it easier for users of the kernel library to instantiate a BlockManager that may be used to read data from disk without loading the block index into a cache.

ACKs for top commit:
  maflcko:
    re-ACK 0cdddeb224 🏪
  achow101:
    ACK 0cdddeb224
  mzumsande:
    re-ACK 0cdddeb224

Tree-SHA512: fe3d557a725367e549e6a0659f64259cfef6aaa565ec867d9a177be0143ff18a2c4a20dd57e35e15f97cf870df476d88c05b03b6a7d9e8d51c568d9eda8947ef
2025-01-31 15:28:06 -05:00
Ava Chow
eaf4b928e7
Merge bitcoin/bitcoin#31746: test: Added coverage to the waitfornewblock rpc
93747d934b test: Added coverage to the waitfornewblock rpc (kevkevinpal)

Pull request description:

  Added a test for the Negative timeout error if the rpc is given a negative value for its timeout arg

  This adds coverage to the `waitfornewblock` rpc

  you can check to see there is no coverage for this error by doing
  `grep -nri "Negative timeout" ./test/`

  and nothing shows up, you can also see by manually checking where we call `waitfornewblock` in the functional tests

ACKs for top commit:
  Sjors:
    tACK 93747d934b
  achow101:
    ACK 93747d934b
  brunoerg:
    code review ACK 93747d934b
  tdb3:
    ACK 93747d934b

Tree-SHA512: 45cf34312412d3691a39f003bcd54791ea16542aa3f5a2674d7499c9cc4039550b2cbd32cc3d4c5fe100d65cb05690594b10a0c42dfab63bcca3dac121bb195b
2025-01-31 14:45:50 -05:00
Ava Chow
992f37f2e1
Merge bitcoin/bitcoin#31600: rpc: have getblocktemplate mintime account for timewarp
e1676b08f7 doc: release notes (Sjors Provoost)
0082f6acc1 rpc: have mintime account for timewarp rule (Sjors Provoost)
79d45b10f1 rpc: clarify BIP94 behavior for curtime (Sjors Provoost)
0713548137 refactor: add GetMinimumTime() helper (Sjors Provoost)

Pull request description:

  #30681 fixed the `curtime` field of `getblocktemplate` to take the timewarp rule into account. However I forgot to do the same for the `mintime` field, which was hardcoded to use `pindexPrev->GetMedianTimePast()+1`.

  This PR adds a helper `GetMinimumTime()` and uses it for the `mintime` field.

  #31376 changed the `curtime` field to always account for the timewarp rule. This PR maintains that behavior.

  Note that `mintime` now always applies BIP94, including on mainnet. This makes future softfork activation safer.

  It could be backported to v28.

ACKs for top commit:
  fjahr:
    tACK e1676b08f7
  achow101:
    ACK e1676b08f7
  darosior:
    utACK e1676b08f7 on the code changes
  tdb3:
    brief code review re ACK e1676b08f7
  TheCharlatan:
    ACK e1676b08f7

Tree-SHA512: 0e322d8cc3b8ff770849bce211edcb5b6f55d04e5e0dee0657805049663d758f27423b047ee6363bd8f6c6fead13f974760f48b3321ea86f514f446e1b23231c
2025-01-31 14:39:36 -05:00
Cory Fields
12fa9511b5 build: simplify dependency graph
Allow the objects of static libs to be built in parallel rather than serially
based on their dependency ordering.

For more detail, see:
https://cmake.org/cmake/help/latest/prop_tgt/OPTIMIZE_DEPENDENCIES.html
2025-01-31 15:07:44 +00:00
Cory Fields
c4e498300c build: avoid unnecessary dependencies on generated headers
This prevents the generation of these headers from also depending on the
dependencies of the libs/binaries which consume them.

Specifically, this prevents generated test headers (such as
test/data/base58_encode_decode.json.h) from depending on the
dependencies of test_bitcoin (libcrc32c.a libcrc32c_sse42.a libleveldb.a)

Note that this is currently only relevant for Ninja.

For more detail, see:
https://cmake.org/cmake/help/latest/command/add_custom_command.html
2025-01-31 15:07:23 +00:00
Ryan Ofsky
8fa10edcd1
Merge bitcoin/bitcoin#31428: ci: Allow build dir on CI host
8888ee4403 ci: Allow build dir on CI host (MarcoFalke)

Pull request description:

  This is required to pass cross builds on to a different machine after the build.

  See for example https://github.com/bitcoin/bitcoin/pull/31176, but this pull will also allow someone to implement it outside this repo.

ACKs for top commit:
  davidgumberg:
    lgtm ACK 8888ee4403
  hebasto:
    re-ACK 8888ee4403.

Tree-SHA512: a1e2c32bc1b95efbd0b48287ac5b49e0e1bacbf5a5800845be5352bbdd3e17fa478e90348b2e94e95cf3ae863cdf75ab444089376588f6f8eec438f73a4b5b97
2025-01-30 19:34:00 -05:00
Ava Chow
809d7e763c
Merge bitcoin/bitcoin#31751: test: fix intermittent timeout in p2p_1p1c_network.py
152a2dcdef test: fix intermittent timeout in p2p_1p1c_network.py (Martin Zumsande)

Pull request description:

  The timeout is due to outstanding txrequests with python peers, which have the same timeout (`60s`) as the mempool sync timeout.
  I explained this in more detail in https://github.com/bitcoin/bitcoin/issues/31721#issuecomment-2620169640 and also mentioned there how to reproduce it.

  Fix this by disconnecting the python peers after they send their txns, they aren't needed after this point anyway because the main goal of the test is the sync between the 4 full nodes.

  Fixes #31721

ACKs for top commit:
  achow101:
    ACK 152a2dcdef
  instagibbs:
    reACK 152a2dcdef
  marcofleon:
    ACK 152a2dcdef
  glozow:
    reACK 152a2dcdef

Tree-SHA512: 908c58933d8e9fcca91425fce1b7c9c7cb7121a6d26840630e03a442356ad2a327d1e087df72a19caa97024ea827593e10f2ff93838f88939458e73df9857df0
2025-01-29 18:07:32 -05:00
glozow
7426afbe62 [p2p] assign just 1 random announcer in AddChildrenToWorkSet 2025-01-29 18:05:16 -05:00
glozow
4c1fa6b28c test fix: make peer who sends MSG_TX announcement non-wtxidrelay
Otherwise, it is not meaningful to test whether the announcement is
ignored, because *all* announcements of this type are ignored.
2025-01-29 18:05:16 -05:00
glozow
2da46b88f0 pass P2PTxInvStore init args to P2PInterface init 2025-01-29 18:05:16 -05:00
glozow
e3bd51e4b5 [doc] how unique_parents can be empty 2025-01-29 18:05:16 -05:00
glozow
32eb6dc758 [refactor] assign local variable for wtxid 2025-01-29 18:05:16 -05:00
glozow
18820ccf6b multi-announcer orphan handling test fixups 2025-01-29 18:05:16 -05:00