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: disallowed loop connections #7719

Merged
merged 17 commits into from
Oct 4, 2022
Merged

Conversation

pompon0
Copy link
Contributor

@pompon0 pompon0 commented Sep 29, 2022

  • disallowed loop connections on the connection::Pool level. Added a test for it
  • replaced a debug_assert in Edge::build_hash with panic-free handling
  • improved handling of LastEdge message to prevent accepting irrelevant edges.

@pompon0 pompon0 requested a review from a team as a code owner September 29, 2022 08:56
Copy link
Contributor

@matklad matklad left a comment

Choose a reason for hiding this comment

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

Broadly OK, it its probably worth it to add more comments around ok conditiosn.

tracing::info!(target: "network", ?err, "Closing connection to {}", self.peer_info);
} else {
tracing::error!(target: "network", ?err, "Closing connection to {}", self.peer_info);
Copy link
Contributor

Choose a reason for hiding this comment

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

Heh, good catch!

chain/network/src/peer/peer_actor.rs Outdated Show resolved Hide resolved
chain/network/src/peer/peer_actor.rs Show resolved Hide resolved
chain/network/src/peer_manager/tests.rs Outdated Show resolved Hide resolved
chain/network/src/peer_manager/tests.rs Show resolved Hide resolved
@matklad
Copy link
Contributor

matklad commented Oct 4, 2022

CI is failing

@near-bulldozer near-bulldozer bot merged commit 40101c1 into master Oct 4, 2022
@near-bulldozer near-bulldozer bot deleted the gprusak-tier1-loop-connection branch October 4, 2022 16:50
nikurt pushed a commit that referenced this pull request Nov 9, 2022
- disallowed loop connections on the connection::Pool level. Added a test for it
- replaced a debug_assert in Edge::build_hash with panic-free handling
- improved handling of LastEdge message to prevent accepting irrelevant edges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants