dash/test/functional/test_framework
fanquake 6d44f36afd
Merge bitcoin/bitcoin#22096: p2p: AddrFetch - don't disconnect on self-announcements
5730a43703f7e5a5ca26245ba3b55fbdd027d0b6 test: Add functional test for AddrFetch connections (Martin Zumsande)
c34ad3309f93979b274a37de013502b05d25fad8 net, rpc: Enable AddrFetch connections for functional testing (Martin Zumsande)
533500d9072b7d5a36a6491784bdeb9247e91fb0 p2p: Add timeout for AddrFetch peers (Martin Zumsande)
b6c5d1e450dde6a54bd785504c923adfb45c7060 p2p: AddrFetch - don't disconnect on self-announcements (Martin Zumsande)

Pull request description:

  AddrFetch connections (old name: oneshots) are intended to be short-lived connections on which we ask a peer for addresses via `getaddr` and disconnect after receiving them.

  This is done by disconnecting after receiving the first `addr`. However, it is no longer working as intended, because nowadays, the first `addr` a typical bitcoin core node sends is its self-announcement.
  So we'll disconnect before the peer gets a chance to answer our `getaddr`.

  I checked that this affects both `-seednode` peers specified manually, and DNS seeds when AddrFetch is used as a fallback if DNS doesn't work for us.

  The current behavior of getting peers via AddrFetch when starting with an empty addrman would be to connect to the peer, receive its self-announcement and add it to addrman, disconnect, reconnect to the same peer again as a full outbound (no other addresses in addrman) and then receive more `addr`. This is silly and not in line with AddrFetch peer being intended to be short-lived peers. 

  Fix this by only disconnecting after receiving an `addr` message of size > 1.

  [Edit] As per review discussion, this PR now also adds a timeout after which we disconnect if we haven't received any suitable `addr`, and a functional test.

ACKs for top commit:
  amitiuttarwar:
    reACK 5730a43703f7e5a5ca26245ba3b55fbdd027d0b6
  naumenkogs:
    ACK 5730a43703f7e5a5ca26245ba3b55fbdd027d0b6
  jnewbery:
    ACK 5730a43703

Tree-SHA512: 8a81234f37e827705138eb254223f7f3b3bf44a06cb02126fc7990b0d231b9bd8f07d38d185cc30d55bf35548a6fdc286b69602498d875b937e7c58332158bf9
2024-05-27 12:18:23 -05:00
..
crypto merge bitcoin#28374: python cryptography required for BIP 324 functional tests 2024-03-05 21:43:22 +00:00
__init__.py
address.py Merge #19253: Tests: tidy up address.py and segwit_addr.py 2024-04-10 01:58:59 +07:00
authproxy.py Merge #19368: test: improve functional tests compatibility with BSD/macOS 2024-01-06 19:30:15 -06:00
bdb.py Merge #18836: wallet: upgradewallet fixes and additional tests 2024-05-10 13:59:59 +07:00
bip340_test_vectors.csv partial bitcoin#19953: Implement BIP 340-342 validation 2024-02-19 10:17:10 -06:00
blockfilter.py merge bitcoin#28374: python cryptography required for BIP 324 functional tests 2024-03-05 21:43:22 +00:00
blocktools.py Merge bitcoin/bitcoin#22308: wallet: Add missing BlockUntilSyncedToCurrentChain 2024-05-15 03:03:17 +07:00
coverage.py Merge bitcoin/bitcoin#22139: test: add type annotations to util.get_rpc_proxy 2023-12-03 20:13:09 -06:00
descriptors.py Merge #18032: rpc: Output a descriptor in createmultisig and addmultisigaddress 2023-04-06 20:15:47 +03:00
key.py Merge #19239: tests: move generate_wif_key to wallet_util.py 2024-03-09 03:00:27 +07:00
messages.py Merge #5978: backport: merge bitcoin#21594, #21843, #22306, #22211, #22387, #21528, #22616, #22604, #22960, #23218 (networking backports: part 3) 2024-04-15 10:49:14 -05:00
netutil.py test: disable ipv6 tests for now 2024-04-21 15:12:18 +03:00
p2p.py Merge #5978: backport: merge bitcoin#21594, #21843, #22306, #22211, #22387, #21528, #22616, #22604, #22960, #23218 (networking backports: part 3) 2024-04-15 10:49:14 -05:00
script_util.py Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
script.py merge bitcoin#28374: python cryptography required for BIP 324 functional tests 2024-03-05 21:43:22 +00:00
socks5.py
test_framework.py Merge #5981: backport: bitcoin#19136, #21063, #21277, #21302, partial #20267 - descriptor wallets part IV 2024-04-16 08:56:59 -05:00
test_node.py Merge bitcoin/bitcoin#22096: p2p: AddrFetch - don't disconnect on self-announcements 2024-05-27 12:18:23 -05:00
test_shell.py Merge #17378: TestShell: Fix typos & implement cleanups 2023-01-23 12:22:29 -06:00
util.py Merge #18836: wallet: upgradewallet fixes and additional tests 2024-05-10 13:59:59 +07:00
wallet_util.py Merge #19239: tests: move generate_wif_key to wallet_util.py 2024-03-09 03:00:27 +07:00
wallet.py (followup) bitcoin#19940 2024-04-23 09:15:20 -05:00