[pull] master from bitcoin:master#1016
Merged
pull[bot] merged 4 commits intomrpeertopeer:masterfrom Mar 2, 2026
Merged
Conversation
If the following two events happen: * (likely) the automatic 10 initial connections are not made to all networks * (unlikely) the network-specific logic kicks in almost immediately. It is using exponential distribution with a mean of 5 minutes (`rng.rand_exp_duration(EXTRA_NETWORK_PEER_INTERVAL)`). So if both happen, then the 11th connection may not be the expected private broadcast, but a network-specific connection. Fix this by retrieving the connection type from `destinations_factory()`. This is more flexible because it allows connections to happen in any order and does not break if e.g. the 11th connection is not the expected first private broadcast. This also makes the test run faster: before: 19-44 sec now: 10-25 sec because for example there is no need to wait for the initial 10 automatic outbound connections to be made in order to proceed. Fixes: #34387
I2P addresses must use port=0, otherwise `bitcoind` refuses to connect. The test `p2p_private_broadcast.py` cannot simulate connections to I2P peers, so the I2P proxy is set to a dummy `127.0.0.1:1`. Still it is good to pick I2P addresses and attempt connections to increase coverage. However the test uses port=8333 for I2P addresses and thus the connection attempts fail for the "wrong" reason: ``` Error connecting to ...i2p:8333, connection refused due to arbitrary port 8333 ``` Using the proper port=0 makes the failures: ``` Error connecting to ...i2p:0: Cannot connect to 127.0.0.1:1 ``` which will make possible simulated I2P connections once we have a test I2P proxy.
…e_broadcast.py da7f70a test: use port 0 for I2P addresses in p2p_private_broadcast.py (Vasil Dimov) a8ebcfd test: let connections happen in any order in p2p_private_broadcast.py (Vasil Dimov) 67696b2 net: extend log message to include attempted connection type (Vasil Dimov) Pull request description: If the following two events happen: * (likely) the automatic 10 initial connections are not made to all networks * (unlikely) the network-specific logic kicks in almost immediately. It is using exponential distribution with a mean of 5 minutes (`rng.rand_exp_duration(EXTRA_NETWORK_PEER_INTERVAL)`). So if both happen, then the 11th connection may not be the expected private broadcast, but a network-specific connection. Fix this by retrieving the connection type from `destinations_factory()`. This is more flexible because it allows connections to happen in any order and does not break if e.g. the 11th connection is not the expected first private broadcast. This also makes the test run faster: before: 19-44 sec now: 10-25 sec because for example there is no need to wait for the initial 10 automatic outbound connections to be made in order to proceed. Fixes: #34387 ACKs for top commit: achow101: ACK da7f70a andrewtoth: ACK da7f70a mzumsande: Code Review ACK da7f70a Tree-SHA512: 7c293e59c15c148a438e0119343b05eb278205640658c99336d4caf4848c5bae92b48e15f325fa616cbc9d5f394649abfa02406a76e802cffbd3d312a22a6885
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )