Skip to content

Expose API to save/restore the state of Kademlia provider refresh #493

@dmitry-markin

Description

@dmitry-markin

Problem Statement

When the number of published Kademlia content providers is in hundred thousands or millions, it takes considerable time to publish them all on the node restart. Because there is no need to publish providers that were published before the restart and shouldn't be refreshed yet, we can extend the Kademlia API so we can add providers without publishing them, providing a time when they should be refreshed. We should also be able to save the providers and their planned refresh time when node is shutting down.

Required Changes

To make this work, the following functionality should be added:

  1. KademliaHandle::resume_providing(key, refresh_time) that puts a provider in the local store and schedules its refresh.
  2. KademliaHandle::local_providers() -> (Key, Instant) that allows to save all local providers and their refresh times.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmediumRequires some knowledge of the codebase

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions