[Fix] Handle changing IPs of trusted peers#4229
Draft
Conversation
Collaborator
|
We can assume one IP address per validator. |
ljedrz
reviewed
Apr 24, 2026
Comment on lines
+1065
to
+1069
| if let Some(aleo_addr) = c.last_known_aleo_addr { | ||
| if self.is_connected_address(aleo_addr) { | ||
| return None; | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
The more robust (and simpler) way to check whether there's already a peer connected with the given Aleo address is to use Resolver::get_peer_ip_for_address - the Resolver only ever holds the addresses of connected peers.
ljedrz
requested changes
Apr 24, 2026
Collaborator
ljedrz
left a comment
There was a problem hiding this comment.
This seems like the exact kind of issue that would manifest in the way we've observed. My suggestion is to use a preexisting tool, but other than that, the approach is sound.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR aims to tackle (some of) #4228. But there are some open questions that need to be addressed.
It makes the following changes:
handle_trusted_validatorsnow properly waits for connection attempts to succeed/fail and prints any associated errors. We already do this for bootstrap peers, and most likely forgot to make the change for the other function.CandidatePeersnow track the last known Aleo address. This way, we can detect when a peer changes IP addresses.Discussion/Open Questions: