Skip to content

[Refactor] More high-level network cleanups#3754

Merged
vicsn merged 10 commits intoProvableHQ:stagingfrom
ljedrz:refactor/more_high_lvl_net
Aug 5, 2025
Merged

[Refactor] More high-level network cleanups#3754
vicsn merged 10 commits intoProvableHQ:stagingfrom
ljedrz:refactor/more_high_lvl_net

Conversation

@ljedrz
Copy link
Collaborator

@ljedrz ljedrz commented Jul 25, 2025

This PR is a direct follow-up to #3713, continuing with a refactoring sweep of the higher-level network layer around the Router.

A summary of the changes:

  • remove the notion of a restricted peer in favor of the banning feature, which is targeting the same issue (connection spam), but is faster to trigger and has a wider reach
  • RADIO_SILENCE_IN_SECS is renamed to MAX_RADIO_SILENCE_SECS
  • the collection of trusted peers is removed in favor of enhancing the Peer object with a trusted flag
  • several heartbeat and outbound methods are refactored for brevity and improved performance
  • a few peer-related Router methods are removed
  • peers can no longer have their node type or version updated without reconnecting (this may have been considered, but has never been possible - the node must be restarted in order for either to change)

Note: I currently only removed the updates to the RESTRICTED metric; should the metric be removed altogether, or perhaps show the number of banned peers instead?

ljedrz added 6 commits July 25, 2025 09:16
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
@ljedrz ljedrz requested review from kaimast and vicsn July 25, 2025 07:42
@ljedrz
Copy link
Collaborator Author

ljedrz commented Jul 25, 2025

One test has failed, looking into it 🕵️.

All good now 👌.

Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Copy link
Contributor

@kaimast kaimast left a comment

Choose a reason for hiding this comment

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

Just a few minor comments. Looks great!

Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
@ljedrz ljedrz requested a review from kaimast July 29, 2025 08:02
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
@ljedrz ljedrz requested a review from kaimast July 30, 2025 07:54
@kaimast
Copy link
Contributor

kaimast commented Aug 4, 2025

Looks great now. I had one minor bit but we can also merge as it.

@vicsn vicsn merged commit b6576c1 into ProvableHQ:staging Aug 5, 2025
2 checks passed
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.

3 participants