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

Remove the OCap system #2186

Merged
merged 7 commits into from
May 11, 2022
Merged

Remove the OCap system #2186

merged 7 commits into from
May 11, 2022

Conversation

plafer
Copy link
Contributor

@plafer plafer commented May 5, 2022

Closes: cosmos/ibc-rs#45
Closes: #2116

Description

This PR removes everything "object capability" in the modules. Notably, there is now only 1 function to bind a module to a port (PortKeeper::bind_module_to_port(module_id, port_Id)), and 1 function to lookup a module by port (PortReader::lookup_module_by_port(port_id)).

We currently don't support transferring ownership of a port or releasing a port.


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests: integration (for Hermes) or unit/mock tests (for modules).
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@hu55a1n1 hu55a1n1 self-assigned this May 6, 2022
@hu55a1n1 hu55a1n1 mentioned this pull request May 9, 2022
7 tasks
Copy link
Member

@adizere adizere left a comment

Choose a reason for hiding this comment

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

This is a very satisfying PR! Pre-approved.

@@ -18,6 +18,31 @@ Implementation of the Inter-Blockchain Communication Protocol ([IBC]) module.

See documentation on [docs.rs][docs-link].

## Divergence from the Interchain Standards (ICS)
Copy link
Member

Choose a reason for hiding this comment

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

Tip-top, thanks for taking the care to describe this!

Copy link
Member

@hu55a1n1 hu55a1n1 left a comment

Choose a reason for hiding this comment

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

Thanks, @plafer! 🙏 There's nothing like a PR that has more deletions than additions! I added some suggestions and comments.

modules/README.md Outdated Show resolved Hide resolved
modules/src/core/ics05_port/context.rs Show resolved Hide resolved
modules/src/mock/context.rs Show resolved Hide resolved
Test {
name: "Good parameters".to_string(),
ctx: context
.with_client(&ClientId::default(), client_height)
.with_connection(ConnectionId::default(), connection_end)
.with_port_capability(packet.destination_port.clone())
.with_port(packet.destination_port.clone())
Copy link
Member

Choose a reason for hiding this comment

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

IIUC, I don't think we need to set a port mapping to test handshakes, so we should be able to remove most of them.

Co-authored-by: Shoaib Ahmed <sufialhussaini@gmail.com>
Copy link
Member

@hu55a1n1 hu55a1n1 left a comment

Choose a reason for hiding this comment

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

🙏

@plafer plafer merged commit 3aed2d9 into master May 11, 2022
@plafer plafer deleted the plafer/2159-ocap branch May 11, 2022 18:10
hu55a1n1 added a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Remove capabilities

* changelog

* Start documenting where we diverge from spec

* Update modules/README.md

Co-authored-by: Shoaib Ahmed <sufialhussaini@gmail.com>

* remove MockContext::with_port

* cippy tests

Co-authored-by: Shoaib Ahmed <sufialhussaini@gmail.com>
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.

Document how ibc-rs diverges from the IBC spec
3 participants