-
Notifications
You must be signed in to change notification settings - Fork 370
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
Handler for channel open init #452
Conversation
Codecov Report
@@ Coverage Diff @@
## master informalsystems/hermes#452 +/- ##
=========================================
+ Coverage 13.6% 30.3% +16.6%
=========================================
Files 69 168 +99
Lines 3752 13417 +9665
Branches 1374 5327 +3953
=========================================
+ Hits 513 4071 +3558
- Misses 2618 9091 +6473
+ Partials 621 255 -366
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, @cezarad :)
I did a first pass over the PR and left some comments which are mostly stylistic, but it all looks very good already!
It looks the build is failing because of the formatting. You can reformat the whole project at once by running cargo fmt
in the ibc-rs
folder. Instructions for setting it up (assuming you have installed Rust via https://rustup.rs).
Co-authored-by: Romain Ruetschi <romain@informal.systems>
Co-authored-by: Romain Ruetschi <romain@informal.systems>
Co-authored-by: Romain Ruetschi <romain@informal.systems>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
I left a bunch of comments, please see inline.
A good practice you can experiment with in future: you can try to give your branches a specific name, to help identify them easily. For instance, instead of Cezara
in future you can give the branch the name/id of the issue it is addressing, e.g., adi/68_errors
or romac/backward-verif
Co-authored-by: Adi Seredinschi <adi@informal.systems>
Co-authored-by: Adi Seredinschi <adi@informal.systems>
Co-authored-by: Adi Seredinschi <adi@informal.systems>
Co-authored-by: Adi Seredinschi <adi@informal.systems>
Co-authored-by: Adi Seredinschi <adi@informal.systems>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patience with these reviewz! We're almost done there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks Cezara!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
* Initial documentation using mdbook (#542) * Added README page to the guide with instructions. Fix index page (#542) * Added more content mostly in the configuration section (#542) * Some cleaning up and adding some placeholder content to a few pages (#542) * Added information to the index page (#542) * Added more content, new sections (most under in transactions), added glossary (#542) * Added info to light client page, additional theme change and some structure refactor (#542) * Added content for keys. Updated some commands references. (#542) * Added tutorial section. Breakdown tutorial (#542) * More content to tutorial (#542) * Adding more content to tutorial (#542) * Update relay_packets.md * Adding more content, fixing content mostly in local chains file (#542) * Fixing some content to show hermes (#542) * Added content to the create-client section (#452) * Review sections 1-3 * Revew 3.1, remove loop_config, add config_example.toml * Small layout change * fix CLI examples * fixed and clarified ID parameters * Format bytearrays as hex-encoded strings in various commands * Formatting * Added 4.3.1 and 4.5.1 * fix query client doc * fix query client connections doc * Add the relayer_loop doc * Add documentation for tx raw connection commands and change from positional arguments to flags * Avoid duplicate tag name for ConnectionEnd, ChannelEnd, AnyConsensusState and AnyClientState * Fix JSON output in `tx raw` connection guide * Update guide following 1ed6147 * Remove tags on ChannelEnd and ConnectionEnd * Add documentation for query connection commands * json for client commands, fix in relayer loop doc * Add documentation for query channel(s) commands * Improve output of Python script a bit * Adding guide build CI workflow (#542) * tx packet section, changed packet-send to ft-transfer * Some css changes to better show few things (#542) * formatting * Work around gumdrop limitation which cuts off flags help text if too long * Add documentation for tx raw chan-* commands * Fix typo in e2e Python script * Adapt e2e script to new flags of tx conn commands * Add stub doc for tx raw chan-close-* commands * Fix typo * Improve tx raw conn-* doc * Improve tx raw chan-open-* doc * Only return a single result from Output type, to avoid unnecessary brackets in JSON output * Add diagrams to tx channel and tx connection pages * packet query docs * starting on feature summary * Fix typo * Adapt mermaid theme to mdbook theme * Add chan-close results to doc and to e2e script (disabled for now) * Rename events to listen mode and add listen command * File to support custom domain (#542) * Fix mermaid theme detection * Improve conn and chan diagrams * Adding step to install mdbook-mermaid (#542) * Adding step to install mdbook-mermaid on CI (#542) * Removing full path from config example (#542) * Remove log statement * Fixing type in guide.yml (#542) * renamed troubleshoot [test] * Look for default config in ~/.hermes/config.toml and update guide * Minor stylistic change * Added Help * Split dev-env script into setup-chains and init-clients * Breakdown of the relay packets into separate sections (#542) * Fixed links in help.md * Formatting * Fixing color for navigation buttons in mobile display (#542) * Fix gaia version (#542) * Added pre-requisite (Golang) needed for gaia (#542) * Adding more content to the local_chains page (#542) * remove order flag from tx chan clis * Add high level content in transactions * add clarification on identifiers and start cleaning 4.1.3 subsections * restructure tutorial * add relay path tutorial * Finish the channel close handshake commands referrence * remove forgotten wip * Move chan-close commands to their own section * Remove duplicate content * Moved miscellaneous into help. Consolidated the help section. * review 1-3 * Add section to install hermes via cargo install * Rename Setup page to Installation * Patching gaia * features and matrix * Add [[connections]] section to config.toml * Whitespace * Touch up feature matrix a bit * small nits * Uppercase feature descriptions * typo fix and added link * merge features in a new column in matrix, fix a few entries * cleanup * formatting * Index nits * Getting started, prereq * Fixed hyperlinks to installation.md * remove the operation instructions * Fixed tutorial URLS * Fixed URLS in commands and local_chains.md * Queries overview * Relayer CLI readme stripped down to essentials * changelog * review up to 5.2 * review 5.3 * review 5.4 * finish 5 review * Add instructions for running two relayers for bidirectional relaying * Fix broken links found with mdbook-linkcheck * Check for broken links on CI * Revert "Check for broken links on CI" This reverts commit c4f8509. * Main readme. Some fixes * Fix typo * Hermes <> IBC Relayer CLI * Fix a couple more typos * Unify Transactions and Queries index pages * Remove $ prefix in front of commands for easier copy-paste * fix concurrent packet relay section * Update title of two paths page * Disambiguation Hermes<>CLI * More explanation re: CLI * Nit in readme * Casing and descriptions * More casing * Formatting * Consistent casing in sidebar * nits * Unify notes * Nitpick * Minor stuff Co-authored-by: Andy Nogueira <me@andynogueira.dev> Co-authored-by: Ethan Buchman <ethan@coinculture.info> Co-authored-by: Anca Zamfir <zamfiranca@gmail.com> Co-authored-by: Adi Seredinschi <adi@informal.systems>
* handler for channel open init * formated * Update modules/src/ics04_channel/handler/chan_open_init.rs Co-authored-by: Romain Ruetschi <romain@informal.systems> * Update modules/src/ics04_channel/handler/chan_open_init.rs Co-authored-by: Romain Ruetschi <romain@informal.systems> * Update modules/src/ics04_channel/context.rs Co-authored-by: Romain Ruetschi <romain@informal.systems> * chan open init Romains comments * added port verification * chan open init * chan open init * minor fmt * chan open init * Update modules/src/ics04_channel/channel.rs Co-authored-by: Adi Seredinschi <adi@informal.systems> * Update modules/src/ics04_channel/channel.rs Co-authored-by: Adi Seredinschi <adi@informal.systems> * Update modules/src/ics04_channel/context.rs Co-authored-by: Adi Seredinschi <adi@informal.systems> * Update modules/src/ics04_channel/context.rs Co-authored-by: Adi Seredinschi <adi@informal.systems> * Update error.rs * Update modules/src/ics04_channel/error.rs Co-authored-by: Adi Seredinschi <adi@informal.systems> * Update modules/src/ics04_channel/channel.rs Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com> * Update modules/src/ics04_channel/context.rs Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com> * Update context.rs * minor * minor * test for port * connetion features * connetion features * connetion features * review comments * Small refactor to improve readability * Cleanup ics05_port::capabilities * Replace panic! with unwrap and avoid some clones in mock context * Avoid clones in MockContext::add_port * Only clone the channel id * Fix a couple comments Co-authored-by: Romain Ruetschi <romain@informal.systems> Co-authored-by: Adi Seredinschi <adi@informal.systems> Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
* Initial documentation using mdbook (informalsystems#542) * Added README page to the guide with instructions. Fix index page (informalsystems#542) * Added more content mostly in the configuration section (informalsystems#542) * Some cleaning up and adding some placeholder content to a few pages (informalsystems#542) * Added information to the index page (informalsystems#542) * Added more content, new sections (most under in transactions), added glossary (informalsystems#542) * Added info to light client page, additional theme change and some structure refactor (informalsystems#542) * Added content for keys. Updated some commands references. (informalsystems#542) * Added tutorial section. Breakdown tutorial (informalsystems#542) * More content to tutorial (informalsystems#542) * Adding more content to tutorial (informalsystems#542) * Update relay_packets.md * Adding more content, fixing content mostly in local chains file (informalsystems#542) * Fixing some content to show hermes (informalsystems#542) * Added content to the create-client section (informalsystems#452) * Review sections 1-3 * Revew 3.1, remove loop_config, add config_example.toml * Small layout change * fix CLI examples * fixed and clarified ID parameters * Format bytearrays as hex-encoded strings in various commands * Formatting * Added 4.3.1 and 4.5.1 * fix query client doc * fix query client connections doc * Add the relayer_loop doc * Add documentation for tx raw connection commands and change from positional arguments to flags * Avoid duplicate tag name for ConnectionEnd, ChannelEnd, AnyConsensusState and AnyClientState * Fix JSON output in `tx raw` connection guide * Update guide following 1ed6147 * Remove tags on ChannelEnd and ConnectionEnd * Add documentation for query connection commands * json for client commands, fix in relayer loop doc * Add documentation for query channel(s) commands * Improve output of Python script a bit * Adding guide build CI workflow (informalsystems#542) * tx packet section, changed packet-send to ft-transfer * Some css changes to better show few things (informalsystems#542) * formatting * Work around gumdrop limitation which cuts off flags help text if too long * Add documentation for tx raw chan-* commands * Fix typo in e2e Python script * Adapt e2e script to new flags of tx conn commands * Add stub doc for tx raw chan-close-* commands * Fix typo * Improve tx raw conn-* doc * Improve tx raw chan-open-* doc * Only return a single result from Output type, to avoid unnecessary brackets in JSON output * Add diagrams to tx channel and tx connection pages * packet query docs * starting on feature summary * Fix typo * Adapt mermaid theme to mdbook theme * Add chan-close results to doc and to e2e script (disabled for now) * Rename events to listen mode and add listen command * File to support custom domain (informalsystems#542) * Fix mermaid theme detection * Improve conn and chan diagrams * Adding step to install mdbook-mermaid (informalsystems#542) * Adding step to install mdbook-mermaid on CI (informalsystems#542) * Removing full path from config example (informalsystems#542) * Remove log statement * Fixing type in guide.yml (informalsystems#542) * renamed troubleshoot [test] * Look for default config in ~/.hermes/config.toml and update guide * Minor stylistic change * Added Help * Split dev-env script into setup-chains and init-clients * Breakdown of the relay packets into separate sections (informalsystems#542) * Fixed links in help.md * Formatting * Fixing color for navigation buttons in mobile display (informalsystems#542) * Fix gaia version (informalsystems#542) * Added pre-requisite (Golang) needed for gaia (informalsystems#542) * Adding more content to the local_chains page (informalsystems#542) * remove order flag from tx chan clis * Add high level content in transactions * add clarification on identifiers and start cleaning 4.1.3 subsections * restructure tutorial * add relay path tutorial * Finish the channel close handshake commands referrence * remove forgotten wip * Move chan-close commands to their own section * Remove duplicate content * Moved miscellaneous into help. Consolidated the help section. * review 1-3 * Add section to install hermes via cargo install * Rename Setup page to Installation * Patching gaia * features and matrix * Add [[connections]] section to config.toml * Whitespace * Touch up feature matrix a bit * small nits * Uppercase feature descriptions * typo fix and added link * merge features in a new column in matrix, fix a few entries * cleanup * formatting * Index nits * Getting started, prereq * Fixed hyperlinks to installation.md * remove the operation instructions * Fixed tutorial URLS * Fixed URLS in commands and local_chains.md * Queries overview * Relayer CLI readme stripped down to essentials * changelog * review up to 5.2 * review 5.3 * review 5.4 * finish 5 review * Add instructions for running two relayers for bidirectional relaying * Fix broken links found with mdbook-linkcheck * Check for broken links on CI * Revert "Check for broken links on CI" This reverts commit c4f8509. * Main readme. Some fixes * Fix typo * Hermes <> IBC Relayer CLI * Fix a couple more typos * Unify Transactions and Queries index pages * Remove $ prefix in front of commands for easier copy-paste * fix concurrent packet relay section * Update title of two paths page * Disambiguation Hermes<>CLI * More explanation re: CLI * Nit in readme * Casing and descriptions * More casing * Formatting * Consistent casing in sidebar * nits * Unify notes * Nitpick * Minor stuff Co-authored-by: Andy Nogueira <me@andynogueira.dev> Co-authored-by: Ethan Buchman <ethan@coinculture.info> Co-authored-by: Anca Zamfir <zamfiranca@gmail.com> Co-authored-by: Adi Seredinschi <adi@informal.systems>
Closes: informalsystems/ibc-rs#97
Description
ChanOpenInit returns the capability associated with the port's identity and channel's identity in the spec and the go version. Since the ChannelId is no longer visible in the handler probably the keeper should store the capability of the channel then there is no need for the handler to return a capability. Current version just returns the port capability (in the channel result) which respects the prototype in the spec but not the semantics.
ics04_channel/context.rs defines the interface for the context under which channels exists
ibc-rs/modules/src/mock/context.rs extends the store of MockContext with the stores required by channels: A map to store channels and a Map for the sequence numbers used by packets.
The only modification in ics03_connection/connection.rs is to create a connection useful for the test on ChanOpenInit
For contributor use:
docs/
) and code comments.Files changed
in the Github PR explorer.