Skip to content

fix(net): ban peer on fatal error#543

Merged
mattsse merged 1 commit intomainfrom
matt/ban-on-fatal-error
Dec 20, 2022
Merged

fix(net): ban peer on fatal error#543
mattsse merged 1 commit intomainfrom
matt/ban-on-fatal-error

Conversation

@mattsse
Copy link
Collaborator

@mattsse mattsse commented Dec 20, 2022

Ban peers that we cannot connect to due to protocol/network-related errors.

@mattsse mattsse requested a review from Rjected as a code owner December 20, 2022 15:21
@mattsse mattsse added A-networking Related to networking in general C-bug An unexpected or incorrect behavior labels Dec 20, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #543 (6b02432) into main (80b34a9) will increase coverage by 0.10%.
The diff coverage is 89.47%.

@@            Coverage Diff             @@
##             main     #543      +/-   ##
==========================================
+ Coverage   72.53%   72.64%   +0.10%     
==========================================
  Files         243      243              
  Lines       24584    24622      +38     
==========================================
+ Hits        17833    17886      +53     
+ Misses       6751     6736      -15     
Impacted Files Coverage Δ
crates/net/network/src/error.rs 50.00% <ø> (+50.00%) ⬆️
crates/net/network/src/peers/manager.rs 74.34% <89.47%> (+3.44%) ⬆️
crates/stages/src/stages/bodies.rs 93.38% <0.00%> (-0.38%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

Makes sense, if we get disconnected due to UselessPeer (or another fatal err) then we probably won't ever be able to connect and should not attempt connecting again

@mattsse
Copy link
Collaborator Author

mattsse commented Dec 20, 2022

Exactly, we might even be banned on the other side after the first fatal error.

@mattsse mattsse merged commit 7184e4d into main Dec 20, 2022
@mattsse mattsse deleted the matt/ban-on-fatal-error branch December 20, 2022 17:04
emhane added a commit that referenced this pull request Jan 8, 2026
Closes #519

---------

Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
Co-authored-by: Emilia Hane <emiliaha95@gmail.com>
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.

3 participants