kad: expose API to save and restore local provider state across restarts#544
Open
WilliamNwoke wants to merge 1 commit intoparitytech:masterfrom
Open
kad: expose API to save and restore local provider state across restarts#544WilliamNwoke wants to merge 1 commit intoparitytech:masterfrom
WilliamNwoke wants to merge 1 commit intoparitytech:masterfrom
Conversation
Collaborator
|
Hi @WilliamNwoke and thanks for looking into this! To understand the priority of reviewing, is this functionality something you need, or you are just fixing an issue in litep2p repo? Asking, because #493 is not high priority for Parity now. |
Author
It caught my attention and I'm just trying to fix it. Are there any high priority issues for parity here please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #493
Adds save/restore support for local Kademlia provider state to prevent full republish waves on node restart. Introduces
KademliaHandle::resume_providing(key, quorum, next_refresh_at)to reinsert providers without immediately republishing and schedule refreshes based on the persisted next refresh time, andKademliaHandle::local_providers()to asynchronously retrieve a snapshot of active providers with their next scheduled refreshInstantfor persistence before shutdown. This extends the store to track per-key refresh instants, adds corresponding commands and events (ResumeProviding,GetLocalProviders,LocalProviders), and wires them into the Kademlia event loop, enabling efficient restart behavior without unnecessary network traffic.