-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backport: merge bitcoin#19763, #20653, #20756, #19315, #20646, #21015, #19771, #21425, #21236, #21198, #21707, #21785, #21506, #22107, partial bitcoin#21186, merge gui#226, partial gui#206 (networking backports: part 2) #5964
Conversation
c79f8b5 fix: keep ADDRS outside (UdjinM6) a39065b test: fix incorrect nServices assertion, use NODE_NETWORK value (Kittywhiskers Van Gogh) 0e78555 fix: add missing check for sending addrs (UdjinM6) 3cd6937 fix: test nodes should use mocktime (UdjinM6) acbbe8c fix: relayed addresses should use mocktime (UdjinM6) Pull request description: ## Issue being fixed or feature implemented `p2p_addr_relay.py` is broken but we don't see it in CI because it doesn't test everything it should atm. This weird behaviour was discovered by @kwvg while preparing #5964. ## What was done? Bring back the missing check and fix the test. Borrowed one fix from #5964 to make this PR complete. ## How Has This Been Tested? Run `p2p_addr_relay.py` ## Breaking Changes n/a ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: kwvg: ACK c79f8b5 Tree-SHA512: a88f9c3563205b092ebd9ab7e8f0c034b6ef5bef2adbf57c269c444ef334e519e30d028325e73e99de025654a0dbd94baad033fb1538896e85572d4db2a00b23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, see a couple of nits below + it would be nice if commit messages for gui backports would say merge bitcoin-core/gui#<number> ....
(and not just merge gui#<number>
). This would turn them into clickable links making PR review a bit easier ;)
This pull request has conflicts, please rebase. |
Yes; please do not use non-standard messages. My script assumes for gui
and for non-gui
|
comment was moved to net.h in 678df63 (dashpay#4888) and removed entirely in 796353a (dashpay#5771). the comment is being restored back to where it is upstream, in CNode::RelayAddrsWithConn.
… functional tests
…idth_{to, from} in peer details excludes: - 142807a
…er details area
… std::chrono types
…class ConnectionDirection
Dash uses a lot more CNode::RelayAddrsWithConn checks than Bitcoin (esp. since a483122 (dashpay#4888)), so bitcoin#21186 will not adequately cover the removal of RelayAddrsWithConn usages. When possible to query with RelayAddrsWithPeer, that should be used, as that value is the most reliable, else we rely on the former mutual exclusivity of IsBlockOnlyConn and RelayAddrsWithConn to fill in the blanks where a more reliable query isn't available. Note: To prevent builds from breaking, a change has been made in InstantSend code despite it breaking functionality. A commit later will repair it by creating a way to access RelayAddrsWithPeer.
Since bitcoin#21186, mutual exclusivity is not a given (i.e. RelayAddrsWithConn != !IsBlockOnlyConn), we should use RelayPeersWithConn for a definitive answer and since relying on a no-longer-true property breaks InstantSend, let's fetch the right answer instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK e89c555
range diff looks like; when we look at this range diff we see; a clean rebase on develop (a47635b) as well as only metadata and whitespace diffs
also, prior commit passed CI: 39f686c
-: ---------- > 1: 663774c544 feat: implement Read Write Locks in threading
-: ---------- > 2: 069282611c refactor: make CActiveMasternodeManager::cs SharedMutex and private
-: ---------- > 3: 436a5783c7 Merge bitcoin/bitcoin#22736: log, sync: change lock contention from preprocessor directive to log category
-: ---------- > 4: 9eec4cc2e1 Merge #20288: script, doc: contrib/seeds updates
-: ---------- > 5: 455bb2e117 Merge #20329: docs/descriptors.md: Remove hardened marker in the path after xpub
-: ---------- > 6: d01973cc08 Merge #20491: refactor: Drop noop gcc version checks
-: ---------- > 7: def356e2cb Merge #20512: doc: Add bash as an OpenBSD dependency
-: ---------- > 8: d186b3714a Merge #20587: [doc] Tidy up Tor doc (more stringent)
-: ---------- > 9: 41505e64aa Merge #20588: Remove unused and confusing CTransaction constructor
-: ---------- > 10: b193c63fed Merge #20611: Move TX_MAX_STANDARD_VERSION to policy
-: ---------- > 11: eba325d7a2 Merge #16551: test: Test that low difficulty chain fork is rejected
-: ---------- > 12: 1995d2e7ca Merge #20451: lint: run mypy over contrib/devtools
-: ---------- > 13: c8653387b1 Merge #21112: ci: use Focal for macOS cross builds
-: ---------- > 14: 14a67ee85e Merge #20182: ci: Build with --enable-werror by default, and document exceptions
-: ---------- > 15: 0c38cc325e fix: drop -static-libstc++ from depends/hosts/{linux,mingw32}.mk which is clang-only
-: ---------- > 16: a47635baad feat: drop symbol check from CI to unify with bitcoin, keep it for qt5 only
1: e22300fd85 = 17: 017d1b40e3 merge bitcoin#19763: don't relay to the address' originator
2: d6be4814dd = 18: d0c596e91d merge bitcoin#20653: Move addr relay comment in net to correct place
3: d5dcae3991 = 19: b76e029e44 merge bitcoin#20756: Add missing field (permissions) to the getpeerinfo help
4: f389f0412b ! 20: 1d4f10a378 merge bitcoin#19315: Allow outbound & block-relay-only connections in functional tests
@@ test/functional/test_framework/test_node.py: class TestNode():
## test/functional/test_runner.py ##
@@ test/functional/test_runner.py: BASE_SCRIPTS = [
- 'wallet_coinbase_category.py --descriptors',
'feature_filelock.py',
'feature_loadblock.py',
+ 'p2p_dos_header_tree.py',
+ 'p2p_add_connections.py',
'p2p_blockfilters.py',
'p2p_message_capture.py',
5: 329b1f161d = 21: e109c0042a merge bitcoin#20646: refer to BIPs 339/155 in feature negotiation
6: d09fbb855f ! 22: 3e8ba24c87 partial gui#206: Display fRelayTxes and bip152_highbandwidth_{to, from} in peer details
@@ Metadata
Author: Kittywhiskers Van Gogh <[email protected]>
## Commit message ##
- partial gui#206: Display fRelayTxes and bip152_highbandwidth_{to, from} in peer details
+ partial bitcoin-core/gui#206: Display fRelayTxes and bip152_highbandwidth_{to, from} in peer details
excludes:
- 142807af8b82e2372a03df893c50df4f4a96aca4
7: 344409d62f ! 23: 8b204c4c82 merge gui#226: Add "Last Block" and "Last Tx" rows to peer details area
@@ Metadata
Author: Kittywhiskers Van Gogh <[email protected]>
## Commit message ##
- merge gui#226: Add "Last Block" and "Last Tx" rows to peer details area
+ merge bitcoin-core/gui#226: Add "Last Block" and "Last Tx" rows to peer details area
## src/qt/forms/debugwindow.ui ##
@@
8: a1d27a6543 ! 24: 62a7311fe4 merge bitcoin#21015: Make all of net_processing (and some of net) use std::chrono types
@@ src/net.cpp: void CConnman::CalculateNumConnectionsChangedStats()
torNodes++;
- if(pnode->m_last_ping_time > 0)
- statsClient.timing("peers.ping_us", pnode->m_last_ping_time, 1.0f);
-+ {
-+ const auto last_ping_time = count_microseconds(pnode->m_last_ping_time);
-+ if (last_ping_time > 0)
-+ statsClient.timing("peers.ping_us", last_ping_time, 1.0f);
-+ }
++ const auto last_ping_time = count_microseconds(pnode->m_last_ping_time);
++ if (last_ping_time > 0)
++ statsClient.timing("peers.ping_us", last_ping_time, 1.0f);
}
ReleaseNodeVector(vNodesCopy);
for (const std::string &msg : getAllNetMessageTypes()) {
@@ src/net_processing.cpp: bool PeerManagerImpl::SendMessages(CNode* pto)
// Detect whether this is a stalling initial-headers-sync peer
if (pindexBestHeader->GetBlockTime() <= GetAdjustedTime() - nMaxTipAge) {
- if (count_microseconds(current_time) > state.nHeadersSyncTimeout && nSyncStarted == 1 && (nPreferredDownload - state.fPreferredDownload >= 1)) {
-+ if (current_time > state.m_headers_sync_timeout && nSyncStarted == 1 && (nPreferredDownload - state.fPreferredDownload >= 1)) {
++ if (current_time > state.m_headers_sync_timeout && nSyncStarted == 1 && (nPreferredDownload - state.fPreferredDownload >= 1)) {
// Disconnect a peer (without the noban permission) if it is our only sync peer,
// and we have others we could be using instead.
// Note: If all our peers are inbound, then we won't
9: c3bf489478 = 25: 5c4c7c55f8 merge bitcoin#19771: Replace enum CConnMan::NumConnections with enum class ConnectionDirection
10: 4d07aca113 = 26: ba1df91d8d merge bitcoin#21425: Pass PeerManagerImpl members only once
11: ad0e4a9e43 = 27: d34d2c4efb merge bitcoin#21236: Extract addr send functionality into MaybeSendAddr()
12: ed45286ffa = 28: 39384ba461 merge bitcoin#21198: Address outstanding review comments from PR20721
13: ac9cd5e96e = 29: 6d27db58d1 merge bitcoin#21707: Extend functional tests for addr relay
14: 60f20cf82e = 30: 03ab144b8f merge bitcoin#21785: Fix intermittent issue in p2p_addr_relay.py
15: 3303178bd3 ! 31: 4844e729e2 merge bitcoin#21506: make NetPermissionFlags an enum class
@@ src/net_processing.cpp: bool PeerManagerImpl::SendMessages(CNode* pto)
@@ src/net_processing.cpp: bool PeerManagerImpl::SendMessages(CNode* pto)
// Detect whether this is a stalling initial-headers-sync peer
if (pindexBestHeader->GetBlockTime() <= GetAdjustedTime() - nMaxTipAge) {
- if (current_time > state.m_headers_sync_timeout && nSyncStarted == 1 && (nPreferredDownload - state.fPreferredDownload >= 1)) {
+ if (current_time > state.m_headers_sync_timeout && nSyncStarted == 1 && (nPreferredDownload - state.fPreferredDownload >= 1)) {
- // Disconnect a peer (without the noban permission) if it is our only sync peer,
+ // Disconnect a peer (without NetPermissionFlags::NoBan permission) if it is our only sync peer,
// and we have others we could be using instead.
16: 38f57e048a = 32: 26c39f5b92 net: replace RelayAddrsWithConn check with !IsBlockOnlyConn
17: 4061f9818e = 33: 5478001a81 partial bitcoin#21186: Move addr data into net_processing
18: 34f509b9d3 = 34: 2e55327f55 net: introduce CanRelayAddrs as RelayAddrsWithConn substitute
19: 39f686c3c8 = 35: e89c555b0f merge bitcoin#22107: rename GetSystemTimeInSeconds to GetTimeSeconds
, bitcoin#22211, bitcoin#22387, bitcoin#21528, bitcoin#22616, bitcoin#22604, bitcoin#22960, bitcoin#23218 (networking backports: part 3) 1fedf47 test: add type annotation for `ADDRS` in `p2p_addrv2_relay` (Kittywhiskers Van Gogh) 022b76f merge bitcoin#23218: Use mocktime for ping timeout (Kittywhiskers Van Gogh) 45d9e58 merge bitcoin#22960: Set peertimeout in write_config (Kittywhiskers Van Gogh) 06e909b merge bitcoin#22604: address rate-limiting follow-ups (Kittywhiskers Van Gogh) 60b3e08 merge bitcoin#22616: address relay fixups (Kittywhiskers Van Gogh) 8b8fbc5 merge bitcoin#22618: Small follow-ups to 21528 (Kittywhiskers Van Gogh) 18fe765 merge bitcoin#21528: Reduce addr blackholes (Kittywhiskers Van Gogh) c1874c6 net_processing: gate `m_tx_relay` access behind `!IsBlockOnlyConn()` (Kittywhiskers Van Gogh) 602d13d merge bitcoin#22387: Rate limit the processing of rumoured addresses (Kittywhiskers Van Gogh) fe66202 merge bitcoin#22211: relay I2P addresses even if not reachable (by us) (Kittywhiskers Van Gogh) 7e08db5 merge bitcoin#22306: Improvements to p2p_addr_relay.py (Kittywhiskers Van Gogh) ff3497c merge bitcoin#21843: enable GetAddr, GetAddresses, and getnodeaddresses by network (Kittywhiskers Van Gogh) 51edeb0 merge bitcoin#21594: add network field to getnodeaddresses (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Dependency for #5982 * Population of `ADDRS` in `p2p_addr`(`v2`)`_relay` in Dash is done in the test object ([source](https://github.com/dashpay/dash/blob/0a62b9f985866249964ed703108a8dc617c73ba3/test/functional/p2p_addrv2_relay.py#L42-L49)) as opposed to upstream, where it is done in the global state ([source](https://github.com/maflcko/bitcoin-core/blob/d930c7f5b091687eb4208a5ffe8a2abe311d8054/test/functional/p2p_addrv2_relay.py#L23-L35)). This is because Dash specifically relies on `self.mocktime` instead of Bitcoin, which will work with simply sampling current time (`time.time()`). * [bitcoin#22211](bitcoin#22211) adds changes ([source](https://github.com/bitcoin/bitcoin/pull/22211/files#diff-d3d7b1bb23f25a96c9c7444a79159ad1799895565f99efebf1618e41e886bd53R44-R46)) that add usage of `ADDRS` outside the test object. That, alongside with other considerations, resulted in [dash#5967](#5967) and a discussion ([source](https://github.com/dashpay/dash/pull/5967/files#r1548101561)) * Eventually, following the footsteps of [dash#5967](#5967), `ADDRS` was defined outside but setup within the test object. This worked just fine ([build](https://gitlab.com/dashpay/dash/-/jobs/6594036014)) but displeased the linter ([build](https://gitlab.com/dashpay/dash/-/jobs/6594035886)) because `ADDRS` type could not be implicitly determined solely on usage in the global scope. * An attempt to correct this was done by realignment with upstream ([commit](262d006)), which pleased the linter ([build](https://gitlab.com/dashpay/dash/-/jobs/6597322521)) but broken the test ([build](https://gitlab.com/dashpay/dash/-/jobs/6597322548)) for the reasons as mentioned above. * Therefore, to keep the linter happy, `ADDRS` has been annotated as a `List[CAddress]` (which involved importing `List` but that's fine) ([commit](cb6d36d)) * Working on [bitcoin#21528](bitcoin#21528) proved challenging due to differences in Dash's and Bitcoin's approach to relaying and the workarounds used to accommodate for that. * Bitcoin conditionally initializes `m_tx_relay` ([source](https://github.com/amitiuttarwar/bitcoin/blob/3f7250b328b8b2f5d63f323702445ac5c989b73d/src/net.cpp#L2989-L2991)) and can always check if transaction relaying is permitted by checking if it's initialized ([source](https://github.com/amitiuttarwar/bitcoin/blob/3f7250b328b8b2f5d63f323702445ac5c989b73d/src/net_processing.cpp#L1820-L1826)). * Dash unconditionally initializes it ([source](https://github.com/dashpay/dash/blob/0a62b9f985866249964ed703108a8dc617c73ba3/src/net.h#L605-L607)). Earlier, Dash used to check if it's _appropriate_ to relay transactions by checking if it can relay addresses ([source](https://github.com/dashpay/dash/blob/dc6f52ac99a3b6fb8b3dfe37db4d6db1f7b1e719/src/net_processing.cpp#L2134-L2140)), which at the time, simply meant, it wasn't a block-only connection ([source](https://github.com/dashpay/dash/blob/dc6f52ac99a3b6fb8b3dfe37db4d6db1f7b1e719/src/net.h#L568-L572)). * This mutual exclusivity no longer held true in [dash#5964](#5964) and therefore, some transaction relay decisions were bound to **not** being a block-only connection ([commit](26c39f5)) but some were left behind, adopting `RelayAddrsWithPeer()` ([source](https://github.com/dashpay/dash/blob/0a62b9f985866249964ed703108a8dc617c73ba3/src/net_processing.cpp#L2215-L2221)), which, to be noted, is determined by the initialization status of `Peer::m_addr_known` ([source](https://github.com/dashpay/dash/blob/0a62b9f985866249964ed703108a8dc617c73ba3/src/net_processing.cpp#L839-L842)), which, so far, was pegged to **not** block-relay connection status ([source](https://github.com/dashpay/dash/blob/0a62b9f985866249964ed703108a8dc617c73ba3/src/net_processing.cpp#L1319)). * [bitcoin#21528](bitcoin#21528) got rid of `RelayAddrsWithPeer()` and replaced it with `Peer::m_addr_relay_enabled` ([source](https://github.com/amitiuttarwar/bitcoin/blob/3f7250b328b8b2f5d63f323702445ac5c989b73d/src/net_processing.cpp#L237-L251)), which is setup using `Peer::SetupAddressRelay()` ([source](https://github.com/amitiuttarwar/bitcoin/blob/3f7250b328b8b2f5d63f323702445ac5c989b73d/src/net_processing.cpp#L637-L643)). This means, rather than defining the address relay status during construction, it is setup during the first address-related message (i.e. `ADDR`, `ADDRV2`, `GETADDR`) ([source](https://github.com/amitiuttarwar/bitcoin/blob/3f7250b328b8b2f5d63f323702445ac5c989b73d/src/net_processing.cpp#L227-L236)). * Meaning, until the first addr-related message happens, the state is has not been determined and defaults to `false`. Because some `m_tx_relay` usage still piggybacked on addr-relay permission to determine tx-relay, if a transaction message is processed before an address message is processed, there will be a false-negative condition. The transaction relay logic won't run since it's expecting that if transactions can be relayed, so can addresses and checks for address relaying but believes that it cannot do address relaying, borrowing that state for transaction relaying, despite address relaying permissions actually being indeterminate since it hasn't had a chance to validate its eligibility. * There were two approaches, run `SetupAddressRelay()` as early in the connection as possible to substitute for the "determine at construction" behaviour and change no other conditional statements... and break address-related tests _or_ move the remaining conditional transaction relay logic to use **not** block-only connection checks instead. * We've gone with the latter, resulting in some changes where the condition only changes form but is the same (`RelayAddrsWithPeer()` > `Peer::m_addr_relay_enabled`) ([source](109c5a9#diff-6875de769e90cec84d2e8a9c1b962cdbcda44d870d42e4215827e599e11e90e3L2131-L2134)) but other changes where the condition itself has been changed (`RelayAddrsWithPeer()` > `!CNode::IsBlockOnlyConn()`) ([source](109c5a9#diff-6875de769e90cec84d2e8a9c1b962cdbcda44d870d42e4215827e599e11e90e3R2256-R2259)) * This does mean that in [dash#5982](#5982), `Peer::m_block_relay_only` is introduced to be the counterpart to `Peer::m_addr_relay_enabled` ([source](https://github.com/dashpay/dash/blame/45b48dae0a66fd918834d012cc8e1e17b5824abe/src/net_processing.cpp#L321-L322)) to account for some `CConnman` logic being moved into `PeerManager` ([source](https://github.com/dashpay/dash/blame/45b48dae0a66fd918834d012cc8e1e17b5824abe/src/net_processing.cpp#L2186-L2195)), which, in a way, reverts [dash#5339](#5339) but also, doesn't, since it moves the information into `Peer` instead of reinstating it into `CNode`. * This was eventual since the underlying presumption that `CNode::IsAddrRelayPeer() == !CNode::IsBlockOnlyConn()` no longer holds true (also because `CNode::IsAddrRelayPeer()` doesn't exist anymore). Special thanks to @UdjinM6 for help with understanding Dash-specifics with respect to functional tests through help on [dash#5964](#5964) and [dash#5967](#5967) ## Breaking Changes None expected. RPC changes have been introduced in `getnodeaddresses`, where a new input `network`, can filter addresses based on desired network and a new output, also `network`, will associate the address with the origin network. This change is expected to be backwards-compatible. ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK 1fedf47 Tree-SHA512: 533d33f79a0d9fd730073b3b9a58baf1dd3b0c95823e765c88a43cc974970ed3609bf1863c63ac7fc5586d1437e5250b0a2d3005468da09e407110a412bd0264
, bitcoin#22340, bitcoin#20799, bitcoin#25147, bitcoin#20764, bitcoin-core/gui#206 (BIP152 backports) 1cbf3b9 merge bitcoin-core/gui#206: Display fRelayTxes and bip152_highbandwidth_{to, from} in peer details (Kittywhiskers Van Gogh) 2390621 merge bitcoin#20764: cli -netinfo peer connections dashboard updates (Kittywhiskers Van Gogh) 06a6f84 merge bitcoin#25147: follow ups to bitcoin#20799 (removing support for v1 compact blocks) (Kittywhiskers Van Gogh) 6274a57 merge bitcoin#20799: Only support version 2 compact blocks (Kittywhiskers Van Gogh) f4ce573 merge bitcoin#22340: Use legacy relaying to download blocks in blocks-only mode (Kittywhiskers Van Gogh) 73b8f84 merge bitcoin#22147: p2p: Protect last outbound HB compact block peer (Kittywhiskers Van Gogh) 2ce4818 merge bitcoin#20599: Tolerate sendheaders and sendcmpct messages before verack (Kittywhiskers Van Gogh) 799214b merge bitcoin#19776: expose high bandwidth mode state via getpeerinfo (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Version 2 of BIP152 high-bandwidth mode/compact blocks implements SegWit support. As Dash does not implement SegWit, there has never been a need to implement v2 (and therefore, have all the code necessary to support both v1 and v2, that gets removed as part of making support v2 only). * Despite that, the changes surrounding removing support for both versions (that in our case, do not apply as we never have supported v2) refactor the code in other ways and influence their behaviour. In the interest of upstream alignment, those changes have been backported. * [bitcoin#19776](bitcoin#19776) doesn't seem to work on its own without successive backports, specifically [bitcoin#20799](bitcoin#20799), despite the latter being a later backport. <details> <summary>19776-only p2p_compactblocks.py run (9f2c868)</summary> ``` dash@825a14c32b73:/src/dash$ ./test/functional/p2p_compactblocks.py 2024-06-09T12:29:09.777000Z TestFramework (INFO): Initializing test directory /tmp/dash_func_test_kb2nr5oe 2024-06-09T12:29:16.341000Z TestFramework (INFO): Testing SENDCMPCT p2p message... 2024-06-09T12:29:31.432000Z TestFramework (INFO): Testing compactblock construction... 2024-06-09T12:29:40.068000Z TestFramework (INFO): Testing compactblock requests... 2024-06-09T12:29:44.597000Z TestFramework (INFO): Testing getblocktxn handler... 2024-06-09T12:29:59.808000Z TestFramework (INFO): Testing compactblock requests/announcements not at chain tip... 2024-06-09T12:30:03.855000Z TestFramework (INFO): Testing handling of incorrect blocktxn responses... 2024-06-09T12:30:05.868000Z TestFramework (INFO): Testing reconstructing compact blocks from all peers... 2024-06-09T12:30:09.389000Z TestFramework (INFO): Testing end-to-end block relay... 2024-06-09T12:30:10.404000Z TestFramework (INFO): Testing handling of invalid compact blocks... 2024-06-09T12:30:12.418000Z TestFramework (INFO): Testing invalid index in cmpctblock message... 2024-06-09T12:30:14.384000Z TestFramework (INFO): Testing high-bandwidth mode states via getpeerinfo... 2024-06-09T12:30:16.893000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "/src/dash/test/functional/test_framework/test_framework.py", line 158, in main self.run_test() File "./test/functional/p2p_compactblocks.py", line 849, in run_test self.test_highbandwidth_mode_states_via_getpeerinfo() File "./test/functional/p2p_compactblocks.py", line 791, in test_highbandwidth_mode_states_via_getpeerinfo hb_test_node.send_and_ping(msg_block(block)) File "/src/dash/test/functional/test_framework/p2p.py", line 579, in send_and_ping self.sync_with_ping(timeout=timeout) File "/src/dash/test/functional/test_framework/p2p.py", line 596, in sync_with_ping self.wait_until(test_function, timeout=timeout) File "/src/dash/test/functional/test_framework/p2p.py", line 487, in wait_until wait_until_helper(test_function, timeout=timeout, lock=p2p_lock, timeout_factor=self.timeout_factor) File "/src/dash/test/functional/test_framework/util.py", line 249, in wait_until_helper if predicate(): File "/src/dash/test/functional/test_framework/p2p.py", line 484, in test_function assert self.is_connected AssertionError 2024-06-09T12:30:17.396000Z TestFramework (INFO): Stopping nodes 2024-06-09T12:30:18.400000Z TestFramework (WARNING): Not cleaning up dir /tmp/dash_func_test_kb2nr5oe 2024-06-09T12:30:18.401000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/dash_func_test_kb2nr5oe/test_framework.log 2024-06-09T12:30:18.401000Z TestFramework (ERROR): 2024-06-09T12:30:18.401000Z TestFramework (ERROR): Hint: Call /src/dash/test/functional/combine_logs.py '/tmp/dash_func_test_kb2nr5oe' to consolidate all logs 2024-06-09T12:30:18.401000Z TestFramework (ERROR): 2024-06-09T12:30:18.401000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log. 2024-06-09T12:30:18.402000Z TestFramework (ERROR): https://github.com/dashpay/dash/issues 2024-06-09T12:30:18.402000Z TestFramework (ERROR): ``` </details> <details> <summary>20799-incl p2p_compactblocks.py run (aa116c4)</summary> ``` dash@825a14c32b73:/src/dash$ ./test/functional/p2p_compactblocks.py 2024-06-09T12:34:27.169000Z TestFramework (INFO): Initializing test directory /tmp/dash_func_test_7d65lmhz 2024-06-09T12:34:32.695000Z TestFramework (INFO): Testing SENDCMPCT p2p message... 2024-06-09T12:34:51.288000Z TestFramework (INFO): Testing compactblock construction... 2024-06-09T12:34:55.325000Z TestFramework (INFO): Testing compactblock requests... 2024-06-09T12:34:59.861000Z TestFramework (INFO): Testing getblocktxn handler... 2024-06-09T12:35:07.460000Z TestFramework (INFO): Testing compactblock requests/announcements not at chain tip... 2024-06-09T12:35:09.503000Z TestFramework (INFO): Testing handling of incorrect blocktxn responses... 2024-06-09T12:35:11.519000Z TestFramework (INFO): Testing reconstructing compact blocks from all peers... 2024-06-09T12:35:15.039000Z TestFramework (INFO): Testing end-to-end block relay... 2024-06-09T12:35:16.055000Z TestFramework (INFO): Testing handling of invalid compact blocks... 2024-06-09T12:35:17.062000Z TestFramework (INFO): Testing invalid index in cmpctblock message... 2024-06-09T12:35:19.139000Z TestFramework (INFO): Testing high-bandwidth mode states via getpeerinfo... 2024-06-09T12:35:22.159000Z TestFramework (INFO): Stopping nodes 2024-06-09T12:35:23.163000Z TestFramework (INFO): Cleaning up /tmp/dash_func_test_7d65lmhz on exit 2024-06-09T12:35:23.163000Z TestFramework (INFO): Tests successful ``` </details> * The backport of [bitcoin-core/gui#206](bitcoin-core/gui#206) is a continuation of 3e8ba24 from [dash#5964](#5964) * The backport of [bitcoin#20764](bitcoin#20764) is a continuation of bd934c7 from [dash#6034](#6034) ## Breaking changes * The `getpeerinfo` RPC returns two new boolean fields, `bip152_hb_to` and `bip152_hb_from`, that respectively indicate whether we selected a peer to be in compact blocks high-bandwidth mode or whether a peer selected us as a compact blocks high-bandwidth peer. High-bandwidth peers send new block announcements via a `cmpctblock` message rather than the usual inv/headers announcements. See BIP 152 for more details. * Blocks-only mode will use legacy relaying instead of BIP152 high-bandwidth mode ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 1cbf3b9 PastaPastaPasta: utACK 1cbf3b9 knst: utACK 1cbf3b9 Tree-SHA512: 5947b622d8d57a1dc9445cd6e07d4ad690379416d0fcf04ed574269975d1beb704691a79ff081341f3c800cf11869d401f1ed90baa5449f371f9ce658f2d2e95
Additional Information
p2p_addr_relay.py
fails because ofassert_equal(total_ipv4_received, num_ipv4_addrs * ipv4_branching_factor)
wherenot(0 == 20)
. It only works with bitcoin#21707.getpeerinfo
now includes help text for thepermissions
return value and a debug RPC calledaddconnection
has been introduced.Breaking Changes
None observed.
Checklist: