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

docs: ics20 hooks #2465

Merged
merged 13 commits into from
Mar 20, 2024
Merged

docs: ics20 hooks #2465

merged 13 commits into from
Mar 20, 2024

Conversation

robert-zaremba
Copy link
Member

@robert-zaremba robert-zaremba commented Mar 20, 2024

Description

closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • added appropriate labels to the PR
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Summary by CodeRabbit

  • Documentation
    • Added comprehensive documentation for the x/uibc module, focusing on IBC functionality and ICS20 hooks for token transfers.

@robert-zaremba robert-zaremba requested a review from a team as a code owner March 20, 2024 14:36
Copy link
Contributor

coderabbitai bot commented Mar 20, 2024

Warning

Rate Limit Exceeded

@robert-zaremba has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 3 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 0c9caa9 and 41c61cb.

Walkthrough

The x/uibc module enhances the Inter-Blockchain Communication (IBC) protocol by introducing ICS20 hooks for token transfers. This update focuses on expanding the functionality, allowing for a more versatile handling of token transfers across different blockchain networks. It encompasses a broad range of aspects including conceptual design, processing flows, protocol definitions, and compatibility considerations with existing IBC applications, aiming to streamline and enrich the cross-chain interaction experience.

Changes

Files Change Summary
.../uibc/README.md Introduced ICS20 hooks for token transfers, including design and examples
.../uibc/.../proto/... Added proto definitions for the new IBC functionality
.../uibc/.../msgs/... Updated to support new IBC Apps hooks messages
.../uibc/.../compatibility/... Detailed compatibility with existing IBC Apps hooks
.../uibc/.../limitations/... Outlined limitations of the current implementation

🐇✨
In the world of chains that bind and link,
A hop, a skip, a leap across the brink.
With tokens flowing, swift and sure,
The uibc module opens a door.
🌌🔗 Across the cosmos, connections weave,
A tapestry of trade, in which we believe.
🎉🐰 Let's celebrate the paths anew,
With every transfer, connections renew.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 083a9d1 and fe5e8d4.
Files selected for processing (3)
  • x/uibc/README.md (1 hunks)
  • x/uibc/uics20/ibc_module.go (1 hunks)
  • x/uibc/uics20/memo_handler.go (1 hunks)
Additional comments: 2
x/uibc/uics20/memo_handler.go (1)
  • 78-78: The addition of the condition to check if fallbackReceiver is the same as receiver and setting fallbackReceiver to nil if true is a logical improvement. It prevents unnecessary fallback actions when the receiver is already the intended recipient. Ensure that the rest of the code gracefully handles a nil fallbackReceiver.
x/uibc/uics20/ibc_module.go (1)
  • 53-55: The update to revert the transfer and send tokens to the fallback_addr upon hook execution failure, instead of ignoring the transfer, significantly enhances error handling and transfer behavior. Ensure thorough testing and verification of the system's behavior with these new error handling mechanisms to prevent any unintended side effects.

x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
robert-zaremba and others added 2 commits March 20, 2024 18:46
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between fe5e8d4 and 21eb9e6.
Files selected for processing (1)
  • x/uibc/README.md (1 hunks)

x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 13

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 21eb9e6 and fb23acd.
Files selected for processing (1)
  • x/uibc/README.md (1 hunks)
Additional comments: 1
x/uibc/README.md (1)
  • 16-16: Consider simplifying the phrase "a variety of use cases, including cross-chain swaps, which are an extremely powerful primitive" for clarity.

Perhaps: "use cases such as cross-chain swaps, a powerful feature."

x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@robert-zaremba robert-zaremba added the skip-e2e-test Skip the e2e tests label Mar 20, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 7

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between fb23acd and 20712af.
Files selected for processing (1)
  • x/uibc/README.md (1 hunks)

x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.38%. Comparing base (7f05ad4) to head (27bfad0).
Report is 413 commits behind head on main.

❗ Current head 27bfad0 differs from pull request most recent head 41c61cb. Consider uploading reports for the commit 41c61cb to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2465      +/-   ##
==========================================
- Coverage   75.38%   69.38%   -6.01%     
==========================================
  Files         100      185      +85     
  Lines        8025    10909    +2884     
==========================================
+ Hits         6050     7569    +1519     
- Misses       1589     2712    +1123     
- Partials      386      628     +242     
Files Coverage Δ
x/uibc/uics20/ibc_module.go 53.01% <ø> (ø)
x/uibc/uics20/memo_handler.go 68.88% <ø> (ø)

... and 174 files with indirect coverage changes

robert-zaremba and others added 3 commits March 20, 2024 20:36
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 20712af and 40e19d0.
Files selected for processing (1)
  • x/uibc/README.md (4 hunks)
Additional comments: 16
x/uibc/README.md (16)
  • 11-12: The table of contents correctly outlines the major sections of the document, ensuring easy navigation for readers.
  • 20-20: The explanation of how users can define ICS20 hook instructions in the ICS20 transfer Memo field is clear and informative.
  • 24-24: The introduction to the ICS20 packet data Memo field and its purpose is well-explained, providing context for the subsequent details on hook execution.
  • 26-28: The conditions for triggering hook execution are clearly stated, including the requirements for the memo field and the fallback_addr.
  • 29-30: The explanation of the fallback address's role and its recommendation for use is clear and highlights the importance of error handling in hook execution.
  • 32-39: The hooks processing flow is well-documented, providing a step-by-step overview of the process from quota checks to hook message execution.
  • 43-50: The ICS20Memo message definition is concise and clearly explains the structure and purpose of each field.
  • 55-65: The section on supported messages provides clear guidelines on the types of messages that can be included in the ICS20Memo, along with validation requirements.
  • 66-66: The note on adjusting token amounts in messages due to potential transfer fees is an important detail that ensures clarity and accuracy in transactions.
  • 68-92: The examples provided for valid and invalid Memo Hooks are helpful for understanding how the hooks work in practice and the importance of correct memo structuring.
  • 118-120: The compatibility section with IBC Apps Hooks is informative, explaining the similarities and potential future support for IBC Apps wasm hooks.
  • 124-124: The limitation regarding the IBC receiver and the "operator" in the Memo.messages is clearly stated, setting expectations for protocol behavior.
  • 139-139: The explanation of how inflows and outflows are measured using the AvgKeeper and the importance of tracking these metrics for quota management is well-documented.
  • 169-169: The clarification that a total_quota or token_quota parameter set to zero is considered as unlimited is an important detail for understanding quota management.
  • 196-196: The description of the Messages RPC providing access for changing module parameters is clear and concise.
  • 200-200: The explanation of the Queries RPC allowing for querying of module parameters and current outflow sums is informative and straightforward.

x/uibc/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 7

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 40e19d0 and 0c9caa9.
Files selected for processing (1)
  • x/uibc/README.md (4 hunks)

x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Show resolved Hide resolved
x/uibc/README.md Show resolved Hide resolved
x/uibc/README.md Outdated Show resolved Hide resolved
x/uibc/README.md Show resolved Hide resolved
robert-zaremba and others added 2 commits March 20, 2024 20:56
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@robert-zaremba robert-zaremba merged commit ded07e7 into main Mar 20, 2024
8 of 16 checks passed
@robert-zaremba robert-zaremba deleted the robert/ics20-hooks-docs branch March 20, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-e2e-test Skip the e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants