Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Implement validation over leaf caching for substrate chains #490

Open
salman01zp opened this issue May 3, 2023 · 1 comment
Open
Assignees
Labels
difficulty: medium 🚩 p3 🔵 Issues should be resolved eventually task ✔️

Comments

@salman01zp
Copy link
Contributor

Use a local Merkle tree instance in the relayer to validate the leaves against the Merkle root on the chain. You can use the Merkle tree found in: https://github.com/webb-tools/zero-knowledge-gadgets/blob/master/arkworks/native-gadgets/src/merkle_tree.rs.

Each time we add a leaf, it should be imperative to check the state of our local tree against the state on-chain. If it matches, we can proceed. If it doesn't match we need to:

Clear our cache
Start over (fetch all the events using the fast sync for events)
Rebuild the tree
Validate and continue until we get this right.

Evm implementation for reference: #354

@salman01zp salman01zp self-assigned this May 3, 2023
@shekohex shekohex added p3 🔵 Issues should be resolved eventually and removed p2 🟡 Issue should be resolved soon labels May 4, 2023
@shekohex
Copy link
Collaborator

shekohex commented May 4, 2023

Decreased the priority as this feature is not actually need right now, but it is good to have in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium 🚩 p3 🔵 Issues should be resolved eventually task ✔️
Projects
Status: Not Started 🕧
Development

No branches or pull requests

2 participants