pokt-network / pocket

Official implementation of the Pocket Network Protocol v1
https://pokt.network
MIT License
61 stars 33 forks source link

[IBC] Implement ICS-23 CommitmentProof verification for the SMT #845

Closed h5law closed 1 year ago

h5law commented 1 year ago

Description

Summary generated by Reviewpad on 29 Jun 23 20:46 UTC

This pull request includes various changes across multiple files.

In the README.md file, a new section titled "ICS-23 Vector Commitments" was added under the "Components" section, along with a link to the ICS-23 specification. Additionally, the link to the ICS-24 specification was updated to point to the ics24.md file.

In the go.sum file, new dependencies were added for the libraries github.com/cosmos/gogoproto and github.com/h5law/ics23/go, with specific version tags. The existing dependency on github.com/pokt-network/smt was also updated to a newer version.

The ics23.md file provides implementation details of ICS-23 Vector Commitments, including the benefits of using the cosmos/ics23 library and the changes made for Pocket's implementation. It also explains the proof verification process for membership and non-membership proofs, accompanied by flowchart diagrams. The implementation logic can be found in the file proofs_ics23.go.

A new file proofs_ics23_test.go was added to the ibc/store package, containing test functions for generating and verifying commitment proofs using the ICS23 library. The tests cover membership and non-membership proofs for a sparse Merkle tree.

The go.mod file shows various changes, including the addition of replace directives for modules github.com/cosmos/ics23/go and github.com/regen-network/gocuke, updates to module versions, and the addition of a new module github.com/cosmos/gogoproto.

The file proofs_ics23.go is a new addition to the ibc/store package, containing functions and constants for verifying membership and non-membership in a Sparse Merkle Tree.

Lastly, in the file where the NextCode constant is defined, it was updated to a new value and a new constant and error function were added.

Please review these changes in the pull request.

Issue

Fixes #841

Type of change

Please mark the relevant option(s):

List of changes

Testing

Required Checklist

If Applicable Checklist

h5law commented 1 year ago

🚨 I HAVE REWRITTEN HISTORY 🚨

@Olshansk I went through all the comments, and rebased off of main. The PR is now much smaller without all the unecissary files from other PRs.