Skip to content

feat(net): temporarily ban bad peers#492

Merged
onbjerg merged 5 commits intomainfrom
matt/perf-improve-peer-handling
Dec 16, 2022
Merged

feat(net): temporarily ban bad peers#492
onbjerg merged 5 commits intomainfrom
matt/perf-improve-peer-handling

Conversation

@mattsse
Copy link
Collaborator

@mattsse mattsse commented Dec 16, 2022

Closes #488

when a peer falls below the banned threshold we should disconnect it and temporarily ban it.

@mattsse mattsse added the A-networking Related to networking in general label Dec 16, 2022
@mattsse mattsse requested a review from onbjerg December 16, 2022 16:41
@onbjerg onbjerg added the C-enhancement New feature or request label Dec 16, 2022
Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

looks good to me

@codecov-commenter
Copy link

Codecov Report

Merging #492 (650e291) into main (daaf039) will increase coverage by 0.08%.
The diff coverage is 74.07%.

@@            Coverage Diff             @@
##             main     #492      +/-   ##
==========================================
+ Coverage   73.18%   73.27%   +0.08%     
==========================================
  Files         241      241              
  Lines       24169    24333     +164     
==========================================
+ Hits        17689    17830     +141     
- Misses       6480     6503      +23     
Impacted Files Coverage Δ
crates/net/common/src/ban_list.rs 61.05% <0.00%> (-6.03%) ⬇️
crates/net/network/src/fetch/mod.rs 83.03% <ø> (ø)
crates/net/network/src/manager.rs 47.16% <0.00%> (ø)
crates/net/network/src/state.rs 51.03% <0.00%> (-0.43%) ⬇️
crates/net/network/src/peers/manager.rs 73.98% <81.54%> (+6.69%) ⬆️
crates/net/network/src/peers/reputation.rs 70.27% <100.00%> (+5.56%) ⬆️
crates/net/discv4/src/lib.rs 52.20% <0.00%> (+0.10%) ⬆️

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

@onbjerg onbjerg merged commit c1f124d into main Dec 16, 2022
@onbjerg onbjerg deleted the matt/perf-improve-peer-handling branch December 16, 2022 17:22
emhane added a commit to JoshdfG/reth that referenced this pull request Jan 5, 2026
…aradigmxyz#492)

Close paradigmxyz#481

Adds a `Custom` variant to `ConsensusError` that wraps an error trait
object, following the same pattern as `DatabaseError` in paradigmxyz#388. This
enables type-safe error handling between `ConsensusError` and custom L2
error types without matching on error strings.

Also removes `PartialEq` and `Eq` derives since `Arc<dyn Error>` can't
implement them, and fixes affected tests in downloaders.

cc @emhane

---------

Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Jan 9, 2026
)

Close #481

Adds a `Custom` variant to `ConsensusError` that wraps an error trait
object, following the same pattern as `DatabaseError` in #388. This
enables type-safe error handling between `ConsensusError` and custom L2
error types without matching on error strings.

Also removes `PartialEq` and `Eq` derives since `Arc<dyn Error>` can't
implement them, and fixes affected tests in downloaders.

cc @emhane

---------

Co-authored-by: Emilia Hane <elsaemiliaevahane@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-enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Temporarily ban bad peers

3 participants