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

Sync cannot download explicitly requested forks as light client if necessary #3639

@rphmeier

Description

@rphmeier

#3633 introduced the beginning of an API for downloading important forks (according to the higher-level consensus algorithm). The problem is that some of these forks may be orphaned or too old for a full node to import.

#3629 is for GRANDPA to use this API

This API should be extended with a parameter where the consensus code can inform sync that it only needs the header-chain. This is the case for GRANDPA. The behavior of the sync code if only the headers are needed should be to:

  • attempt to download and import the chain as a full client, if the state of the common ancestor hasn't been pruned.
  • otherwise, download only the header chain of the fork. it could go through the client, but doesn't have to, as long as any callers of the sync_fork API receive the header chain.

Importing the header chain via the client (as a "sort-of-light" mode) would be a bit nicer w.r.t. continuity; otherwise if the caller of sync_fork wants to return those headers later on they'll have to maintain their own storage rather than using the shared client utilities.

That needs some investigation as to whether the client can be configured to sometimes act as a light client in import and sometimes not -- @svyatonik any thoughts on that point?

Metadata

Metadata

Assignees

No one assigned

    Labels

    I4-annoyanceThe client behaves within expectations, however this “expected behaviour” itself is at issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions