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

Update proof logic to use merged proofs #1898

Open
rianhughes opened this issue Jun 7, 2024 · 0 comments
Open

Update proof logic to use merged proofs #1898

rianhughes opened this issue Jun 7, 2024 · 0 comments
Assignees

Comments

@rianhughes
Copy link
Contributor

rianhughes commented Jun 7, 2024

Currently we handle left and right proofs separately but it seems that we need to merge the proofs. Implement the logic to merge and de-merge the proofs

You should implement two functions.

func mergeProofPaths(leftPath,rightPath []ProofNode) (mergedPath []ProofNode,error)
leftPath and rightPath are lists of ProofNodes, which define paths from the root node to some leaf
mergedPath represents the merged list of leftPath and rightPath, with no duplicates.

func splitProofPath(mergedPath []ProofNode) (leftPath,rightPath []ProofNode,error)
This function should do the reverse of mergeProofPaths, ie take a mergedPath, and split it into leftPath and rightPath.

It might be useful to look at this, and an example trie here. Note that ProofNodes are either Binary or Edge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant