Compare commits

...

4 commits

Author SHA1 Message Date
Jon Atack
8b3ff7c58d
Merge cce0c5b416 into c5e44a0435 2025-04-29 11:55:48 +02:00
merge-script
c5e44a0435
Merge bitcoin/bitcoin#32369: test: Use the correct node for doubled keypath test
Some checks are pending
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Windows native, VS 2022 (push) Waiting to run
CI / Windows native, fuzz, VS 2022 (push) Waiting to run
CI / Linux->Windows cross, no tests (push) Waiting to run
CI / Windows, test cross-built (push) Blocked by required conditions
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
32d55e28af test: Use the correct node for doubled keypath test (Ava Chow)

Pull request description:

  #29124 had a silent merge conflict with #32350 which resulted in it using the wrong node. Fix the test to use the correct v22 node.

ACKs for top commit:
  maflcko:
    lgtm ACK 32d55e28af
  rkrux:
    ACK 32d55e28af
  BrandonOdiwuor:
    Code Review ACK 32d55e28af

Tree-SHA512: 1e0231985beb382b16e1d608c874750423d0502388db0c8ad450b22d17f9d96f5e16a6b44948ebda5efc750f62b60d0de8dd20131f449427426a36caf374af92
2025-04-29 09:59:42 +01:00
Ava Chow
32d55e28af test: Use the correct node for doubled keypath test 2025-04-28 14:44:17 -07:00
Jon Atack
cce0c5b416 Improve NODE_NETWORK_LIMITED documentation per BIP159 2025-02-12 14:46:32 -06:00
4 changed files with 7 additions and 8 deletions

View file

@ -693,7 +693,7 @@ public:
" \"b\" - BLOOM: peer can handle bloom-filtered connections (see BIP 111)\n"
" \"w\" - WITNESS: peer can be asked for blocks and transactions with witness data (SegWit)\n"
" \"c\" - COMPACT_FILTERS: peer can handle basic block filter requests (see BIPs 157 and 158)\n"
" \"l\" - NETWORK_LIMITED: peer limited to serving only the last 288 blocks (~2 days)\n"
" \"l\" - NETWORK_LIMITED: peer can serve at least the last 288 blocks (~2 days); see BIP 159\n"
" \"2\" - P2P_V2: peer supports version 2 P2P transport protocol, as defined in BIP 324\n"
" \"u\" - UNKNOWN: unrecognized bit flag\n"
" v Version of transport protocol used for the connection\n"

View file

@ -1132,8 +1132,8 @@ static bool CanServeBlocks(const Peer& peer)
return peer.m_their_services & (NODE_NETWORK|NODE_NETWORK_LIMITED);
}
/** Whether this peer can only serve limited recent blocks (e.g. because
* it prunes old blocks) */
/** Whether this is a BIP159 peer that can only serve limited recent blocks
* (e.g. because it prunes old blocks) */
static bool IsLimitedPeer(const Peer& peer)
{
return (!(peer.m_their_services & NODE_NETWORK) &&
@ -1506,7 +1506,7 @@ void PeerManagerImpl::FindNextBlocks(std::vector<const CBlockIndex*>& vBlocks, c
return;
}
// Don't request blocks that go further than what limited peers can provide
// Don't request blocks beyond the minimum number that BIP159 limited peers must be able to provide.
if (is_limited_peer && (state->pindexBestKnownBlock->nHeight - pindex->nHeight >= static_cast<int>(NODE_NETWORK_LIMITED_MIN_BLOCKS) - 2 /* two blocks buffer for possible races */)) {
continue;
}

View file

@ -321,9 +321,8 @@ enum ServiceFlags : uint64_t {
// NODE_COMPACT_FILTERS means the node will service basic block filter requests.
// See BIP157 and BIP158 for details on how this is implemented.
NODE_COMPACT_FILTERS = (1 << 6),
// NODE_NETWORK_LIMITED means the same as NODE_NETWORK with the limitation of only
// serving the last 288 (2 day) blocks
// See BIP159 for details on how this is implemented.
// NODE_NETWORK_LIMITED indicates that the node can serve at least the last
// 288 blocks (~2 days). See BIP159 for details on how this is implemented.
NODE_NETWORK_LIMITED = (1 << 10),
// NODE_P2P_V2 means the node supports BIP324 transport

View file

@ -87,7 +87,7 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
# 0.21.x and 22.x would both produce bad derivation paths when topping up an inactive hd chain
# Make sure that this is being automatically cleaned up by migration
node_master = self.nodes[1]
node_v22 = self.nodes[self.num_nodes - 5]
node_v22 = self.nodes[self.num_nodes - 3]
wallet_name = "bad_deriv_path"
node_v22.createwallet(wallet_name=wallet_name, descriptors=False)
bad_deriv_wallet = node_v22.get_wallet_rpc(wallet_name)