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: filter out disconnected nodes on Node/(Content Enr) response #1036

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

KolbyML
Copy link
Member

@KolbyML KolbyML commented Nov 25, 2023

What was wrong?

during devconnect Mike brought up glados's cartographer was trying to ping 1800 enrs, because trin nodes were returning disconnect nodes.

I don't think we should remove the last resort of using disconnected nodes to initialize a RFC/RFN. Since the last resort will only be used if there are 0 connected nodes in the whole routing table which should only happen on startup.

in short I believe this is the right solution

This can also be in glados audits

image

In this picture the Trin node is returning Enr's of disconnected nodes which haven't run for over a month. The trin node returned these because it sorted by distance without filtering out disconnected first. This PR adds the filter so that should no longer happen.

How was it fixed?

by filtering out disconnected nodes by status

I applied to filter to both the Nodes response and the Content Enr Response

@KolbyML KolbyML self-assigned this Nov 25, 2023
@KolbyML KolbyML force-pushed the filter-disconnected-nodes branch 2 times, most recently from 63fbbf5 to c8ebd0e Compare November 26, 2023 00:44
Copy link
Member

@ogenev ogenev left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Collaborator

@njgheorghita njgheorghita 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! But I'd recommend waiting for a review from @mrferris since iiuc he was working on this during devconnect and he might have found some gotchas that I'm missing

portalnet/src/overlay_service.rs Outdated Show resolved Hide resolved
@KolbyML KolbyML force-pushed the filter-disconnected-nodes branch 2 times, most recently from 0dff9ee to 576d5d3 Compare November 27, 2023 15:09
@KolbyML KolbyML changed the title fix: filter out disconnected nodes on Node response fix: filter out disconnected nodes on Node/(Content Enr) response Nov 27, 2023
@KolbyML KolbyML force-pushed the filter-disconnected-nodes branch from 576d5d3 to 1e721ca Compare November 27, 2023 18:37
@KolbyML KolbyML merged commit f966e71 into ethereum:master Nov 27, 2023
2 checks passed
@KolbyML KolbyML deleted the filter-disconnected-nodes branch January 22, 2025 07:51
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.

4 participants