Skip to content

Conversation

@jonatack
Copy link
Member

Addnode peers connected to us via the cjdns network are currently not detected by CConnman::GetAddedNodeInfo(), i.e. fConnected is always false. This causes the following issues:

  • RPC getaddednodeinfo incorrectly shows them as not connected

  • CConnman::ThreadOpenAddedConnections() continually retries to connect them

Fix the issue and add a unit regression test. Extracted from #28248. Suggest running the test with:

./src/test/test_bitcoin -t net_peer_connection_tests -l test_suite

jonatack added 2 commits May 10, 2024 22:29
Addnode (manual) peers connected to us via the cjdns network are currently not
detected by CConnman::GetAddedNodeInfo(), i.e. fConnected is always false.

This causes the following issues:

- RPC `getaddednodeinfo` incorrectly shows them as not connected

- CConnman::ThreadOpenAddedConnections() continually retries to connect them
@DrahtBot
Copy link
Contributor

DrahtBot commented May 11, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK mzumsande, brunoerg, pinheadmz

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot DrahtBot added the P2P label May 11, 2024
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request May 13, 2024
Addnode (manual) peers connected to us via the cjdns network are currently not
detected by CConnman::GetAddedNodeInfo(), i.e. fConnected is always false.

This causes the following issues:

- RPC `getaddednodeinfo` incorrectly shows them as not connected

- CConnman::ThreadOpenAddedConnections() continually retries to connect them

Github-Pull: bitcoin#30085
Rebased-From: 684da97
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request May 13, 2024
@jonatack
Copy link
Member Author

jonatack commented May 13, 2024

This straightforward fix (5f53e6c) was previously ACKed by @vasild (#28248 (review) and Concept ACKed by @brunoerg (#28248 (comment)) with a request to add test coverage, which I've added here.

(Thank you @luke-jr for updating bitcoin knots.)

@vasild @brunoerg mind having a look (thanks!)

Copy link
Contributor

@mzumsande mzumsande left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK d0b0474

Copy link
Contributor

@brunoerg brunoerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crACK d0b0474

Copy link
Member

@pinheadmz pinheadmz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK d0b0474

Built and tested on arm/macOS. It's a simple fix to recognize CJDNS addresses in GetAddedNodeInfo(). Otherwise CService::IsValid() will fail because the CJDNS prefix is in a reserved range. Confirmed the test fails on master and passes with the branch.

Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

ACK d0b047494c28381942c09d0cca45baa323bfcffc
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmZE+NUACgkQ5+KYS2KJ
yTqRLA/+PTzgnOENcfPRDjRTqOrwzxdHPDW8xHu+m0VcLZO0Uv4HwIW8ArZk7DJB
va3z0Y4gIWYvpLwLR+pUlSFqsLKmgsi+gYSVkGK3sGBAGvTH8ibNfKWKdSxzQaAs
PHkutSbYFchel2aO7g/cVzNsD4IfbWvGMmxj2f4kNX0RcWG49IHi3xlMh7ppqn8x
NjS+Xl8kzCgz8oYPQVh7KMKOLEeu+FcoaKRrWhgkhWn6A+CNRbyxwcZYXWrx1oY5
uK+tgnnbvRoYaTg7BTluFfitOqUGPnsMWw52a+vPbtq0lMbtLGby6nPrDwlr1jCn
HPMxz4klxHoqYXJa138Exywyck0Ziu4eqeq/jzi1vQO4KBm6MaiHWrBpfjr/i5uS
Vc/eWPzlTHXktT4MDOb2Mtgfrcu35zQlaU4HMCkLnJGhtFDRhiab99kGHbq+h/LF
kVrePOsVStPNg0s5UwxQIYdEBw4UXePCCPRwe9xxi7UoGGq8mmX6W7AFFn90bepQ
n6a579L6y9olxEr0+Xh863B0esen6wh7znCIm8YJfBHoNJZmOe3tTiWNn0+HQF9e
lqat+HDHY6H24jWSSlqpIvYtHMMe/FeP/5rNldWIdLxIAl3Nc3RPnfmYOTnnZv7F
djr3j+Tk1sIl7hKNqYg9eFcoIzRyLqecJOPDxVrK3eCPVdM12OA=
=u4ll
-----END PGP SIGNATURE-----

pinheadmz's public key is on keybase

@pinheadmz
Copy link
Member

Confirmed this branch fixes the issue in production on mainnet as well:

$ bccli getaddednodeinfo
[
  {
    "addednode": "fc32:17ea:e415:c3bf:9808:149d:b5a2:c9aa",
    "connected": false,
    "addresses": [
    ]
  },
  {
    "addednode": "fcc7:be49:ccd1:dc91:3125:f0da:457d:8ce",
    "connected": true,
    "addresses": [
      {
        "address": "[fcc7:be49:ccd1:dc91:3125:f0da:457d:8ce]:8333",
        "connected": "outbound"
      }
    ]
  }
]

@fanquake fanquake merged commit dd42a5d into bitcoin:master May 16, 2024
@jonatack jonatack deleted the 2024-05-fix-cjdns-detection-in-GetAddedNodeInfo branch May 16, 2024 04:07
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request May 22, 2024
Addnode (manual) peers connected to us via the cjdns network are currently not
detected by CConnman::GetAddedNodeInfo(), i.e. fConnected is always false.

This causes the following issues:

- RPC `getaddednodeinfo` incorrectly shows them as not connected

- CConnman::ThreadOpenAddedConnections() continually retries to connect them

Github-Pull: bitcoin#30085
Rebased-From: 684da97
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request May 22, 2024
@fanquake
Copy link
Member

Backported to 27.x in #30092.

fanquake pushed a commit to fanquake/bitcoin that referenced this pull request May 23, 2024
glozow pushed a commit to glozow/bitcoin that referenced this pull request May 23, 2024
Addnode (manual) peers connected to us via the cjdns network are currently not
detected by CConnman::GetAddedNodeInfo(), i.e. fConnected is always false.

This causes the following issues:

- RPC `getaddednodeinfo` incorrectly shows them as not connected

- CConnman::ThreadOpenAddedConnections() continually retries to connect them

Github-Pull: bitcoin#30085
Rebased-From: 684da97
glozow pushed a commit to glozow/bitcoin that referenced this pull request May 23, 2024
Addnode (manual) peers connected to us via the cjdns network are currently not
detected by CConnman::GetAddedNodeInfo(), i.e. fConnected is always false.

This causes the following issues:

- RPC `getaddednodeinfo` incorrectly shows them as not connected

- CConnman::ThreadOpenAddedConnections() continually retries to connect them

Github-Pull: bitcoin#30085
Rebased-From: 684da97
glozow added a commit that referenced this pull request May 24, 2024
aa7e876 [doc] add draft release notes for 26.2rc1 (glozow)
21d9aaa p2p, bugfix: detect addnode cjdns peers in GetAddedNodeInfo() (Jon Atack)
ec5ce2f windeploy: Renew certificate (Ava Chow)
96d0e81 rpc: Reword SighashFromStr error message (MarcoFalke)
6685aff rpc: move UniValue in blockToJSON (willcl-ark)
7f45e00 depends: Fix build of Qt for 32-bit platforms (laanwj)
f9b76ba ci: Pull in qtbase5-dev instead of seperate low-level libraries (laanwj)
c587753 doc: Suggest installing dev packages for debian/ubuntu qt5 build (laanwj)
7ecdb08 ci: Bump s390x to ubuntu:24.04 (MarcoFalke)
d9ef6cf sign: don't assume we are parsing a sane Miniscript (Antoine Poinsot)
e4859c8 depends: fix mingw-w64 Qt DEBUG=1 build (fanquake)
bb46b90 Fix #29767, set m_synced = true after Commit() (nanlour)
bf5b6fc Throw error if invalid parameters passed to getnetworkhashps RPC endpoint (Jameson Lopp)
a81a922 [rpc, bugfix] Enforce maximum value for setmocktime (dergoegge)
d39ea51 Change Luke Dashjr seed to dashjr-list-of-p2p-nodes.us (Luke Dashjr)
c21bbcc [doc] archive 26.1 release notes (glozow)

Pull request description:

  Archives 26.1 release notes and adds draft release notes for 26.2rc1

  Also backports:
  - #29691
  - #29869
  - #28554
  - #29747
  - #29853
  - #29856
  - #29764
  - #29776
  - #29985
  - #30094
  - #29870
  - #30149
  - #30085

ACKs for top commit:
  stickies-v:
    re-ACK aa7e876, only changes are fixing commit msg and transifex reference
  willcl-ark:
    ACK aa7e876

Tree-SHA512: b81ba6092640de696d782114cdf43e7ed1d63ea0a3231cade30653c2743d87700e0f852a1b1fcc42ae313b2d4f004e6026ddbad87d58c2fde0a660e90026ed98
fanquake added a commit that referenced this pull request May 29, 2024
22701a4 doc: update manual pages for 27.1rc1 (fanquake)
9e91907 build: bump version to 27.1rc1 (fanquake)
9b4640c doc: update release-notes.md for 27.1 (fanquake)
80032d6 qt: 27.1rc1 translations update (Hennadii Stepanov)
423bd6d windeploy: Renew certificate (Ava Chow)
77b2321 depends: Fetch miniupnpc sources from an alternative website (Hennadii Stepanov)
31adcfa test: add GetAddedNodeInfo() CJDNS regression unit test (Jon Atack)
9cdb9ed p2p, bugfix: detect addnode cjdns peers in GetAddedNodeInfo() (Jon Atack)
3c26058 crypto: disable asan for sha256_sse4 with clang and -O0 (Cory Fields)
0ba11cf rpc: move UniValue in blockToJSON (willcl-ark)
dedf319 gui: don't permit port in proxy IP option (willcl-ark)
d1289a1 gui: fix create unsigned transaction fee bump (furszy)

Pull request description:

  Backports:
  * bitcoin-core/gui#812
  * bitcoin-core/gui#813
  * #30085
  * #30094
  * #30097
  * #30149
  * #30151

  Bump to 27.1rc1.

ACKs for top commit:
  stickies-v:
    re-ACK 22701a4
  willcl-ark:
    reACK 22701a4
  hebasto:
    re-ACK 22701a4.

Tree-SHA512: 6eca44ba7e6664eb4677646597dfdaf56a241c8c3e95e0ab8929ee2fc3671303fc6c2634d359b4523dbd452ac5e54fd1f4c7c2bf7e9c5209395f8cb3b4753fb3
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Jun 13, 2024
Addnode (manual) peers connected to us via the cjdns network are currently not
detected by CConnman::GetAddedNodeInfo(), i.e. fConnected is always false.

This causes the following issues:

- RPC `getaddednodeinfo` incorrectly shows them as not connected

- CConnman::ThreadOpenAddedConnections() continually retries to connect them

Github-Pull: bitcoin#30085
Rebased-From: 684da97
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Jun 13, 2024
@bitcoin bitcoin deleted a comment Sep 5, 2024
tomt1664 pushed a commit to tomt1664/elements that referenced this pull request Apr 1, 2025
…dedNodeInfo()

d0b0474 test: add GetAddedNodeInfo() CJDNS regression unit test (Jon Atack)
684da97 p2p, bugfix: detect addnode cjdns peers in GetAddedNodeInfo() (Jon Atack)

Pull request description:

  Addnode peers connected to us via the cjdns network are currently not detected by `CConnman::GetAddedNodeInfo()`, i.e. `fConnected` is always false. This causes the following issues:

  - RPC `getaddednodeinfo` incorrectly shows them as not connected

  - `CConnman::ThreadOpenAddedConnections()` continually retries to connect them

  Fix the issue and add a unit regression test. Extracted from #28248. Suggest running the test with:

  `./src/test/test_bitcoin -t net_peer_connection_tests -l test_suite`

ACKs for top commit:
  mzumsande:
    utACK d0b0474
  brunoerg:
    crACK d0b0474
  pinheadmz:
    ACK d0b0474

Tree-SHA512: a4d81425f79558f5792585611f3fe8ab999b82144daeed5c3ec619861c69add934c2b2afdad24c8488a0ade94f5ce8112f5555d60a1ce913d4f5a1cf5dbba55a
kwvg added a commit to kwvg/dash that referenced this pull request Apr 14, 2025
tomt1664 pushed a commit to tomt1664/elements that referenced this pull request Apr 21, 2025
…dedNodeInfo()

d0b0474 test: add GetAddedNodeInfo() CJDNS regression unit test (Jon Atack)
684da97 p2p, bugfix: detect addnode cjdns peers in GetAddedNodeInfo() (Jon Atack)

Pull request description:

  Addnode peers connected to us via the cjdns network are currently not detected by `CConnman::GetAddedNodeInfo()`, i.e. `fConnected` is always false. This causes the following issues:

  - RPC `getaddednodeinfo` incorrectly shows them as not connected

  - `CConnman::ThreadOpenAddedConnections()` continually retries to connect them

  Fix the issue and add a unit regression test. Extracted from #28248. Suggest running the test with:

  `./src/test/test_bitcoin -t net_peer_connection_tests -l test_suite`

ACKs for top commit:
  mzumsande:
    utACK d0b0474
  brunoerg:
    crACK d0b0474
  pinheadmz:
    ACK d0b0474

Tree-SHA512: a4d81425f79558f5792585611f3fe8ab999b82144daeed5c3ec619861c69add934c2b2afdad24c8488a0ade94f5ce8112f5555d60a1ce913d4f5a1cf5dbba55a
PastaPastaPasta added a commit to dashpay/dash that referenced this pull request Apr 22, 2025
, bitcoin#28078, bitcoin#27071, bitcoin#28077, bitcoin#28692, bitcoin#29813, bitcoin#30085, bitcoin#29833, partial bitcoin#24356 (networking backports: part 11)

5699158 merge bitcoin#29833: fix and improve logs (Kittywhiskers Van Gogh)
95a1853 merge bitcoin#30085: detect addnode cjdns peers in GetAddedNodeInfo() (Kittywhiskers Van Gogh)
9d959d7 merge bitcoin#29813: improve `-i2pacceptincoming` mention (Kittywhiskers Van Gogh)
5045fa3 merge bitcoin#28692: Delete i2p fuzz test (Kittywhiskers Van Gogh)
7b01e8b merge bitcoin#28077: also sleep after errors in Accept() & destroy the session if we get an unexpected error (Kittywhiskers Van Gogh)
0c42410 merge bitcoin#27071: Handle CJDNS from LookupSubNet() (Kittywhiskers Van Gogh)
821c11f merge bitcoin#28078: remove unneeded exports, use helpers over low-level code, use optional (Kittywhiskers Van Gogh)
d051929 refactor: replace external `::GetLocal()` usage (Kittywhiskers Van Gogh)
481175f merge bitcoin#27719: remove Tor link & generalize onion getnodeaddresses RPC (Kittywhiskers Van Gogh)
378ad01 merge bitcoin#25989: abort if i2p/cjdns are chosen via -onlynet but are unreachable (Kittywhiskers Van Gogh)
8b23bfb partial bitcoin#24356: replace CConnman::SocketEvents() with mockable Sock::WaitMany() (Kittywhiskers Van Gogh)
1a64e8d merge bitcoin#25286: remove duplicate categories from LogPrint output (Kittywhiskers Van Gogh)

Pull request description:

  ## Breaking Changes

  None expected.

  ## 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 5699158
  PastaPastaPasta:
    utACK 5699158

Tree-SHA512: b1ffc310574de5ec40d18aa4a453ef328d8f935c42d43a204c14fa264f099a106ddea793a018f56dcf75d9548fb06d1580c6aa1d90f66afa95089435e0b9606d
tomt1664 pushed a commit to tomt1664/elements that referenced this pull request Jun 24, 2025
…dedNodeInfo()

d0b0474 test: add GetAddedNodeInfo() CJDNS regression unit test (Jon Atack)
684da97 p2p, bugfix: detect addnode cjdns peers in GetAddedNodeInfo() (Jon Atack)

Pull request description:

  Addnode peers connected to us via the cjdns network are currently not detected by `CConnman::GetAddedNodeInfo()`, i.e. `fConnected` is always false. This causes the following issues:

  - RPC `getaddednodeinfo` incorrectly shows them as not connected

  - `CConnman::ThreadOpenAddedConnections()` continually retries to connect them

  Fix the issue and add a unit regression test. Extracted from #28248. Suggest running the test with:

  `./src/test/test_bitcoin -t net_peer_connection_tests -l test_suite`

ACKs for top commit:
  mzumsande:
    utACK d0b0474
  brunoerg:
    crACK d0b0474
  pinheadmz:
    ACK d0b0474

Tree-SHA512: a4d81425f79558f5792585611f3fe8ab999b82144daeed5c3ec619861c69add934c2b2afdad24c8488a0ade94f5ce8112f5555d60a1ce913d4f5a1cf5dbba55a
@bitcoin bitcoin locked and limited conversation to collaborators Sep 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants