cosmos / ibc-rs

Rust implementation of the Inter-Blockchain Communication (IBC) protocol.
Apache License 2.0
182 stars 74 forks source link

imp(ibc-testkit): Tendermint proof verifications via integration test #1146

Closed rnbguy closed 3 months ago

rnbguy commented 3 months ago

Closes: #398

Description

Adds integration tests for combinations of MockHost and TendermintHost.

Since it includes TendermintHost, these tests also exercise commitment proof validations in Tendermint light clients.

The PR also includes a unit test for minimal proof validations.

Additionally, to maintain the ics23 proof spec, a main_store is introduced in MockGenericContext - that stores the IBC store root at IBC commitment prefix path. The blocks are now generated with the root of the main_store.

To keep the proof retrieval minimal, I had to modify the ProvableContext::get_proof of MockIbcStore. Before it returned the encoded bytes of a singleCommitmentProof. Now it returns the encoded bytes of MerkleProofs, which is essentially a list of CommitmentProofs corresponding to a MerklePath.

Two shortcomings of basecoin_store:


PR author checklist:

Reviewer checklist:

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 88.26896% with 164 lines in your changes are missing coverage. Please review.

Project coverage is 66.33%. Comparing base (05ea5fa) to head (410b8ad).

Files Patch % Lines
ibc-testkit/src/relayer/utils.rs 89.22% 90 Missing :warning:
ibc-testkit/src/relayer/context.rs 74.38% 73 Missing :warning:
ibc-testkit/src/relayer/integration.rs 99.16% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## feat/refactor-testkit #1146 +/- ## ========================================================= + Coverage 64.36% 66.33% +1.96% ========================================================= Files 221 223 +2 Lines 21216 22397 +1181 ========================================================= + Hits 13656 14856 +1200 + Misses 7560 7541 -19 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.