Skip to content
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

go/p2p/peermgmt/backup: Prevent overwriting TTL when restoring peers #5469

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

peternose
Copy link
Contributor

@peternose peternose commented Nov 24, 2023

If the peer address of a seed node was added to the libp2p address book before peer manager restored backup peer addresses, its permanent TTL was replaced with the TTL for recently connected peers.

When running tests locally, the bootstrap client is created before peers are restored. So this bug was probably the reason why we observed the following error in our logs:

{"caller":"client.go:463","err":"failed to open stream: failed to dial: no addresses","level":"debug","method":"advertise","module":"p2p/rpc/client","msg":"failed to call method","peer_id":"12D3KooWBpWUqSb8u8AQewueVMmfK2E81pA76xd8srHyK5cLo18A","protocol":"/oasis/bootstrap/1.0.0","ts":"2023-11-23T11:17:33.064203232Z"}

If the peer address of a seed node was added to the libp2p address book
before peer manager restored backup peer addresses, its permanent TTL
was replaced with the TTL for recently connected peers.
@peternose peternose marked this pull request as ready for review November 24, 2023 12:14
Copy link
Member

@kostko kostko left a comment

Choose a reason for hiding this comment

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

Also please backport.

@peternose peternose added the c:bug Category: bug label Nov 24, 2023
@peternose peternose enabled auto-merge November 24, 2023 12:21
@peternose peternose merged commit 29e80d5 into master Nov 24, 2023
@peternose peternose deleted the peternose/bugfix/ttl-overwrite branch November 24, 2023 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:bug Category: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants