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

fix: never ban trusted peers #11254

Merged
merged 2 commits into from
Oct 1, 2024
Merged

fix: never ban trusted peers #11254

merged 2 commits into from
Oct 1, 2024

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Sep 26, 2024

closes #11244

on a fatal connection err (which also currently has a bug), we ended up removing trusted peers.

this adds an additional check and only removes the peer from the set if it isn't trusted

@mattsse mattsse added C-bug An unexpected or incorrect behavior A-networking Related to networking in general labels Sep 26, 2024
crates/net/network/src/peers.rs Outdated Show resolved Hide resolved
@@ -1896,6 +1902,64 @@ mod tests {
assert!(!peers.peers.contains_key(&peer));
}

#[tokio::test]
async fn test_fatal_outgoing_connection_error_trusted() {
let peer = PeerId::random();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let peer = PeerId::random();
let trusted_peer = PeerId::random();

nitpick, helps to follow along a bit better

Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
@mattsse mattsse enabled auto-merge October 1, 2024 07:25
@mattsse mattsse added this pull request to the merge queue Oct 1, 2024
Merged via the queue into main with commit f51ac78 Oct 1, 2024
35 checks passed
@mattsse mattsse deleted the matt/never-remove-trusted-perrs branch October 1, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-networking Related to networking in general C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A pre-configured trusted peer will not be retried if it is banned at startup.
2 participants