Skip to content

Conversation

@algorandskiy
Copy link
Contributor

@algorandskiy algorandskiy commented Dec 17, 2025

Summary

Some p2p nodes report the following

{
    "file": "p2p.go",
    "function": "github.com/algorand/go-algorand/network/p2p.(*serviceImpl).DialPeersUntilTargetCount",
    "level": "warning",
    "line": 322,
    "msg": "failed to connect to peer 12D3KooWRAqPqP9fb4Y3MoSuReXt6DfZeKgmUnb8vW1pKiVz8VjB: failed to dial: failed to dial 12D3KooWRAqPqP9fb4Y3MoSuReXt6DfZeKgmUnb8vW1pKiVz8VjB: no addresses",
    "name": "",
    "time": "2025-12-16T18:11:14.290014Z"
}

That is an indication of missing address component in AddrInfo data struct representing peerstore peer entry.

Cause: peerstore adds peers with AddressTTL expiration TTL, and then ReplacePeerList updates it without refreshing addresses. libp2p will expire addresses in background but preserve peerID (see https://github.com/libp2p/go-libp2p/blob/master/p2p/host/peerstore/pstoremem/addr_book.go#L54).

To fix, call AddAddrs on update.

Test Plan

Added a unit test checking ReplacePeerList stores addresses after a simulated expiration.

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.69%. Comparing base (6ee2e7c) to head (dc0d476).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
network/p2p/peerstore/peerstore.go 33.33% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6518      +/-   ##
==========================================
- Coverage   47.87%   47.69%   -0.19%     
==========================================
  Files         662      655       -7     
  Lines       87934    87855      -79     
==========================================
- Hits        42095    41899     -196     
- Misses      43076    43181     +105     
- Partials     2763     2775      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@algorandskiy algorandskiy force-pushed the pavel/network-p2p-peerstore-no-addr branch from a2dd2c8 to 5f7448f Compare December 17, 2025 01:52
@algorandskiy algorandskiy merged commit 5159152 into algorand:master Dec 18, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants