Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

[TASK] Event watcher for relayer #81

Open
5 tasks
salman01zp opened this issue Sep 27, 2023 · 0 comments
Open
5 tasks

[TASK] Event watcher for relayer #81

salman01zp opened this issue Sep 27, 2023 · 0 comments

Comments

@salman01zp
Copy link
Contributor

salman01zp commented Sep 27, 2023

Overview

Add event watcher for relayer which will watch for the Vanchor deposit event and create lc-proposal and send them to pallet light-proposal-handler

/// Light Client Proposal.
///
/// On Vanchor deposit event the [`LightClientProposal`] sends a light storage proofs along with block headers to tangle
///  Tangle verifies this storage proofs and creates Anchor update proposals for each connected chains
/// The format of the proposal is:
/// ```text
/// ┌────────────────────┬─────────────────┬─────────────────────┐
/// │                    │                 │                     │
/// │    BlockHeader     │  Storage proof  │    Storage proof    │
/// │                    │     Root        │      Leaf Index      │
/// └────────────────────┴─────────────────┴─────────────────────┘
/// ```
#[derive(Proposal, Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct LightProposal {
    block_header: BlockHeader,
    merkle_root_proof: Vec<u8>,
    leaf_idx_proof: Vec<u8>,
}

Task Checklist

  • Event watcher for deposit event (featured-flag)
  • Query Tangle to see when the block header has been relayed.
  • Fetch storage proofs for merkle-root and leaf-idx
  • Construct BlockHeader
  • Construct LightProposal and send to pallet light-proposal-handler
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant