Skip to content

Refactor light client #1081

@haerdib

Description

@haerdib

As a preparatory step for #1080, the light client probably needs some refactoring. It should be refactored such that:

  • it's easy to initialize and access the light clients.
  • the validation of a block header should be adaptable for each light client.
  • each light client has its own, independent state
  • each light client only needs to validate the headers of one parentchain.

Keep in mind:
The light clients may need to communicate with each other in the near future (e.g. the relay-chain light client needs to tell the parachain light-client that this header has been finalized).

Optional, may be done in this issue only if it doesn't cause much overhead work. Otherwise, to be solved in a separate issue:

  • Separate the ExtrinsicSender. Extrinsic Montior from the LightClient.

I'd imagine something that allows the following:

let validator = Validator::new(This proof and This proof to be checked);
// or that way:
let mut validator_two = Validator::new();
validator_two.add_grandpa_proof_check();

let light_client = LightClient::init(Validator, State);

light_client.validate(parentchain_header)?;

Further reading for Light Client and Extrinsic Sender:
https://integritee.atlassian.net/wiki/spaces/INTEGRITEE/pages/294486119/Light+Client
https://integritee.atlassian.net/wiki/spaces/INTEGRITEE/pages/294518849/Extrinsics+Sender
https://integritee.atlassian.net/wiki/spaces/INTEGRITEE/pages/294455675/Extrinsic+Monitor

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions