Skip to content

feat: integrate ics23 in cometbft client contract #378

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

Merged

Conversation

ljoss17
Copy link
Contributor

@ljoss17 ljoss17 commented Mar 24, 2025

This PR is currently a work in progress.

Status

Update Cairo contract by adding a Array<ProofSpec> field to Comet client state and required starknet::Store implementations.

Use ICS23 implementation for Comet client verify_membership

ljoss17 and others added 4 commits April 3, 2025 11:35
…nel` (#381)

* Implement ProtoMessage encoding for ConnectionEnd

* Use encode_repeated_field for version in Connectionend ProtoMessage

* Implement ProtoMessage encoding for ChannelEnd

* Implement Into StateValue

* Add test for CommitmentProof decoding

* Update test_commitment_decode in Cairo

* scarb fmt in cairo-libs

* Add encode and decode test for CommitmentProof

* Add felt252_to_u8_array implementation to ICS23 Cairo utils

* WIP: fix Connection Open Ack proof verification

* Fix commitment verification

* Use MockClient instead of CometClient for Cairo tests

* Remove assert_owner from TokenTransfer contract

* Optimisations in cairo-contracts

* Optimisations in cairo-libs

* Cleanup

* Optimise while loops

* use starknet-devnet with higher gas limit

* Fix compilation error due to return value in loop

* Fix Starknet Store custom implementations

* Implement verify_non_membership

* Fix ICS23 verify_non_membership implementation

* Implement i128 protobuf encoding and decoding

* Fix ArrayAsProtoMessage encode_raw

* Replace while i != len

* Improve lexicographical_cmp loop

* Format long arrays in tests

* refactor next_power_of_two

* Replace encode and decode u64 from to bytearray with u128

---------

Co-authored-by: Ranadeep Biswas <[email protected]>
@ljoss17 ljoss17 marked this pull request as ready for review April 16, 2025 10:49
@ljoss17 ljoss17 requested a review from rnbguy April 16, 2025 10:49
Copy link
Member

@rnbguy rnbguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rnbguy rnbguy changed the title Update cairo to integrate ics23 feat: integrate ics23 in cometbft client contract Apr 16, 2025
@rnbguy rnbguy merged commit fb4d9d4 into luca_joss/integrate-ics23 Apr 16, 2025
9 checks passed
@rnbguy rnbguy deleted the luca_joss/update-cairo-to-integrate-ics23 branch April 16, 2025 12:46
rnbguy added a commit that referenced this pull request Apr 16, 2025
* Update relayer to integrate ICS23

* taplo fix

* Fix build_packet_from_send_packet_event

* Clean-up

* feat: integrate ics23 in cometbft client contract (#378)

* Update Cairo contracts and libs to use ICS23

* taplo fix

* Fix Cairo warnings and test

* scarb fmt

* Temporary STATE_PROOF() implementation

* feat: implement `ProtoMessage` encoding for `ConnectionEnd` and `Channel` (#381)

* Implement ProtoMessage encoding for ConnectionEnd

* Use encode_repeated_field for version in Connectionend ProtoMessage

* Implement ProtoMessage encoding for ChannelEnd

* Implement Into StateValue

* Add test for CommitmentProof decoding

* Update test_commitment_decode in Cairo

* scarb fmt in cairo-libs

* Add encode and decode test for CommitmentProof

* Add felt252_to_u8_array implementation to ICS23 Cairo utils

* WIP: fix Connection Open Ack proof verification

* Fix commitment verification

* Use MockClient instead of CometClient for Cairo tests

* Remove assert_owner from TokenTransfer contract

* Optimisations in cairo-contracts

* Optimisations in cairo-libs

* Cleanup

* Optimise while loops

* use starknet-devnet with higher gas limit

* Fix compilation error due to return value in loop

* Fix Starknet Store custom implementations

* Implement verify_non_membership

* Fix ICS23 verify_non_membership implementation

* Implement i128 protobuf encoding and decoding

* Fix ArrayAsProtoMessage encode_raw

* Replace while i != len

* Improve lexicographical_cmp loop

* Format long arrays in tests

* refactor next_power_of_two

* Replace encode and decode u64 from to bytearray with u128

---------

Co-authored-by: Ranadeep Biswas <[email protected]>

---------

Co-authored-by: Ranadeep Biswas <[email protected]>

* Correctly handle errors when decoding struct related to proof specs

---------

Co-authored-by: Ranadeep Biswas <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants