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

feat: dead peer detection #264

Merged
merged 1 commit into from May 15, 2023
Merged

Conversation

maqi
Copy link
Member

@maqi maqi commented May 11, 2023

This PR contains the work of detection dead peers and remove it from the kad.

Note: this relies on flying requests among nodes. i.e. the detection only works when there is data/requests being exchanged among the network.
A quiet network, say startup a network of 25 nodes locally, then kill one of it, won't trigger the detection.

@reviewpad
Copy link

reviewpad bot commented May 11, 2023

AI-Generated Summary: This pull request introduces dead peer detection for the network module. The changes include adding a dependency on lru_time_cache and updating Cargo.lock and safenode/Cargo.toml accordingly. In addition, new code has been added to safenode/src/network/event.rs and safenode/src/network/mod.rs to detect dead peers, remove them from the list of known peers and handle potential outgoing connection errors. The SwarmDriver struct now also includes an LruCache for keeping track of potential dead peers.

@reviewpad reviewpad bot requested a review from bochaco May 11, 2023 12:00
@reviewpad reviewpad bot added Small Pull request is small waiting-for-review labels May 11, 2023
@reviewpad
Copy link

reviewpad bot commented May 11, 2023

Reviewpad Report

⚠️ Warnings

  • Please link an issue to the pull request

@reviewpad
Copy link

reviewpad bot commented May 12, 2023

AI-Generated Summary: This pull request includes a new feature for dead peer detection in the safenode's networking module. The changes include 42 new lines of code, which modifies 4 files: Cargo.lock, safenode/Cargo.toml, safenode/src/network/event.rs, and safenode/src/network/mod.rs. Among these changes, the LruCache dependency has been added, which is used to maintain a cache for potential dead peers. This new dead peer detection leads to faster get_closest_peers results and ensures a corrected partially targeted replication.

safenode/src/network/event.rs Show resolved Hide resolved
safenode/src/network/event.rs Show resolved Hide resolved
safenode/src/network/event.rs Show resolved Hide resolved
safenode/src/network/mod.rs Show resolved Hide resolved
@joshuef joshuef added this pull request to the merge queue May 15, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 15, 2023
@joshuef joshuef added this pull request to the merge queue May 15, 2023
Merged via the queue into maidsafe:main with commit 9dd1eb5 May 15, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Small Pull request is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants