Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

core/authority-discovery: Enable authorities to discover each other #3452

Merged
merged 23 commits into from
Sep 6, 2019

Commits on Aug 21, 2019

  1. node/runtime: Add authority-discovery as session handler

    The srml/authority-discovery module implements the OneSessionHandler in
    order to keep its authority set in sync. This commit adds the module to
    the set of session handlers.
    mxinden committed Aug 21, 2019
    Configuration menu
    Copy the full SHA
    f72e1cb View commit details
    Browse the repository at this point in the history
  2. core/network: Make network worker return Dht events on poll

    Instead of network worker implement the Future trait, have it implement
    the Stream interface returning Dht events.
    
    For now these events are ignored in build_network_future but will be
    used by the core/authority-discovery module in subsequent commits.
    mxinden committed Aug 21, 2019
    Configuration menu
    Copy the full SHA
    d34eb4f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    94a238a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7de7db7 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2019

  1. core/network: Finish NetworkWoker if NetworkService stream finished

    When the channel from network service to network worker is finished,
    also finish the network worker stream given that both network worker and
    network service have the same lifetime.
    mxinden committed Aug 22, 2019
    Configuration menu
    Copy the full SHA
    ed294de View commit details
    Browse the repository at this point in the history
  2. core/authority-discovery: Ensure being woken up on next interval tick

    Authority discovery implements the future trait. Polling this future
    always returns NotReady. The future uses Tokios timer crate to become
    proactive periodically, e.g. advertising its own external addresses.
    
    This commit ensures that the underlying Tokio task is always registered
    at the Tokio Reactor to be woken up on the next interval tick. This is
    achieved by making sure `interval.poll` returns `NotReady` at least
    once within each `AuthorityDiscovery.poll` execution.
    mxinden committed Aug 22, 2019
    Configuration menu
    Copy the full SHA
    fbc3a5b View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2019

  1. core/authority-discovery: Adjust interval to be proactive on

    Kademlia's default time-to-live for Dht records is 36h, republishing
    records every 24h. Given that a node  could restart at any point in
    time, one can not depend on the republishing process, thus starting to
    publish  own external addresses should happen on an interval < 36h.
    
    In addition have the first tick of the interval be at the beginning not
    after an interval duration.
    mxinden committed Aug 27, 2019
    Configuration menu
    Copy the full SHA
    9de2655 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2019

  1. core/authority-discovery: Implement unit tests

    Abstract NetworkService via NetworkProvider trait to be able to mock it
    within the unit tests. In addition add basic unit test for
    `publish_own_ext_addresses`, `request_addresses_of_others` and
    `handle_dht_events`.
    mxinden committed Aug 29, 2019
    Configuration menu
    Copy the full SHA
    5d1042d View commit details
    Browse the repository at this point in the history
  2. core/authority-discovery: Publish and query on different intervals

    Split the global `AuthorityDiscovery.interval` into two intervals:
    `publish_interval` and `query_interval`. Dht entries of other
    authorities can change at any point in time. Thereby one should query
    more often than publish.
    mxinden committed Aug 29, 2019
    Configuration menu
    Copy the full SHA
    4421bad View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2019

  1. *: Remove abstract type AuthorityId replaced by newtype Vec<u8>

    The authority discovery module treats an authority identifier as an
    opaque string. Thus the type abstraction `AuthorityId` is unnecessary,
    bloating the `core/service` construction code.
    mxinden committed Aug 30, 2019
    Configuration menu
    Copy the full SHA
    76db412 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2d025e0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    56da02c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1a5f974 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2019

  1. *: Instantiate authority discovery within node/cli

    Instead of instantiating the authority discovery module within
    core/service, this commit instantiates authority discovery within
    node/cli. The authority discovery module depends on the srml authority
    discovery module, which depends on the im online module, as well as
    session, ...
    
    With the former approach all these dependencies were enforced on any
    substrate implementation. With the latter approach these dependencies
    are optional.
    mxinden committed Sep 2, 2019
    Configuration menu
    Copy the full SHA
    32214d9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2f5c938 View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2019

  1. Configuration menu
    Copy the full SHA
    30bd78e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1a376bf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c5d5a90 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2019

  1. Configuration menu
    Copy the full SHA
    d162540 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    024687e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9c8534c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2e954eb View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2019

  1. Configuration menu
    Copy the full SHA
    c39c50e View commit details
    Browse the repository at this point in the history