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

ICS3 connection handshake protocol (message processing logic) #188

Merged
merged 39 commits into from
Sep 3, 2020

Conversation

adizere
Copy link
Member

@adizere adizere commented Jul 31, 2020

Closes: cosmos/ibc-rs#127
Closes: cosmos/ibc-rs#119 (already closed)

Ready for review.

The most significant part left open is adding more unit tests.

Also, in case you're wondering, the PartialEq additions in the last commit are necessary to fix integration tests (see failures here, file relayer-cli/tests/integration.rs).

Description


For contributor use:

  • Unit tests written
  • Added test to CI if applicable
  • Updated CHANGELOG_PENDING.md
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments
  • Re-reviewed Files changed in the Github PR explorer

@adizere adizere marked this pull request as ready for review August 6, 2020 16:06
@adizere adizere changed the title WIP: ICS3 connection handshake message processing logic (core & context) ICS3 connection handshake protocol (message processing logic) Aug 7, 2020
Split the protocol into per message submodules

Extract verification in separate submodule

Other changes as per ADR003
@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2020

Codecov Report

Merging #188 into master will increase coverage by 21.1%.
The diff coverage is 48.9%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    informalsystems/hermes#188      +/-   ##
=========================================
+ Coverage    13.6%   34.8%   +21.1%     
=========================================
  Files          69      78       +9     
  Lines        3752    5038    +1286     
  Branches     1374    1714     +340     
=========================================
+ Hits          513    1755    +1242     
- Misses       2618    3076     +458     
+ Partials      621     207     -414     
Impacted Files Coverage Δ
modules/src/context.rs 12.3% <0.0%> (ø)
modules/src/events.rs 0.0% <ø> (ø)
modules/src/ics02_client/events.rs 0.0% <ø> (ø)
modules/src/ics02_client/raw.rs 0.0% <0.0%> (ø)
modules/src/ics03_connection/error.rs 12.0% <0.0%> (-21.4%) ⬇️
...ules/src/ics03_connection/handler/conn_open_try.rs 0.0% <0.0%> (ø)
modules/src/ics03_connection/handler/verify.rs 0.0% <0.0%> (ø)
modules/src/ics04_channel/error.rs 23.0% <0.0%> (-2.0%) ⬇️
modules/src/ics04_channel/packet.rs 0.0% <0.0%> (ø)
modules/src/ics07_tendermint/client_def.rs 0.0% <0.0%> (ø)
... and 130 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 788c36b...d68daed. Read the comment docs.

modules/src/address.rs Show resolved Hide resolved
modules/src/context.rs Show resolved Hide resolved
modules/src/ics02_client/client_def.rs Outdated Show resolved Hide resolved
modules/src/ics03_connection/handler.rs Outdated Show resolved Hide resolved
modules/src/ics07_tendermint/client_state.rs Show resolved Hide resolved
modules/src/ics24_host/introspect.rs Outdated Show resolved Hide resolved
modules/src/ics24_host/mod.rs Outdated Show resolved Hide resolved
modules/src/mock_client/mod.rs Show resolved Hide resolved
modules/src/context_mock.rs Show resolved Hide resolved
modules/src/ics02_client/client_def.rs Outdated Show resolved Hide resolved
modules/src/ics02_client/client_def.rs Outdated Show resolved Hide resolved
modules/src/ics02_client/client_def.rs Show resolved Hide resolved
modules/src/ics02_client/client_def.rs Show resolved Hide resolved
modules/src/ics02_client/client_def.rs Outdated Show resolved Hide resolved
modules/src/ics02_client/client_type.rs Outdated Show resolved Hide resolved
modules/src/ics02_client/client_type.rs Show resolved Hide resolved
modules/src/ics02_client/mod.rs Outdated Show resolved Hide resolved
modules/src/ics23_commitment/commitment.rs Outdated Show resolved Hide resolved
@adizere adizere merged commit cf6c815 into master Sep 3, 2020
@adizere adizere deleted the adi/ics03_core branch September 3, 2020 15:21
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
…logic) (informalsystems#188)

* First processing logic for ICS 03 (#160).

* Fix for temporary pick_version().

* First attempt at the process_try_msg function.

* Sketch for proof verification in process_try_msg. Removed Connection* traits.

* Added logic for the Try message.

* Logic for processing ICS3 confirm msg. Cosmetic improvements

* Adapting code to new architecture based on contexts.

* Refactored, new terminology, added events.

* WIP: Adding tests

* Higher-level interface for the context.

* One chunk of proof verification is done

* Implementation of ics3 verify_proofs done.

* Addressing Romain's concerns.

* Tests for conn open init message processing.

* Fixes for integration tests: PartialEq for identifiers.

* More changes cf adr003 and code reorg

* Move info to new  context and context_mock modules

* migrate conn-open-init to new infra

* Refine client and connection mock context

* Fix conn_open_try handler

* Create new mock_client

* remove mocks.rs

* Add global chain context

* Uncomment tests

* Cleanup

* Started to fill client verification functions.

Started TryFromRaw for connection messages.

Some work on commitment prefix, path, root.

* Add try_from for connection messages and remove new()

* Add test for try dispatch

* Some changes to mock context setup

* Some cleanup

* Review comments

* Mark mocks as `#[cfg(test)]

* Fix clippy warnings

* Remove use of clone in a Debug impl

Co-authored-by: Anca Zamfir <zamfiranca@gmail.com>
Co-authored-by: Romain Ruetschi <romain@informal.systems>
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.

4 participants