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

feat: add packet forward middleware #2381

Merged
merged 3 commits into from
Jan 19, 2024

Conversation

udit-gulati
Copy link
Contributor

@udit-gulati udit-gulati commented Jan 6, 2024

Description

Adds the packet forward middleware. Useful for applications like https://ibc.fun/.


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

  • New Features

    • Integrated packet forwarding middleware for enhanced network communication capabilities.
  • Enhancements

    • Expanded application module to include packet forwarding support.

@udit-gulati udit-gulati requested a review from a team as a code owner January 6, 2024 12:17
Copy link
Contributor

coderabbitai bot commented Jan 6, 2024

Walkthrough

The codebase has been updated to include a new middleware for packet forwarding in the app.go file. This involves integrating a packet forwarding functionality into the IBC (Inter-Blockchain Communication) module stack, which necessitates changes to imports, module basics, and the New function to support the PacketForwardKeeper. These modifications collectively enhance the application's capability to handle and route IBC packets.

Changes

File Path Change Summary
app/app.go Added packet forwarding middleware imports, updated module basics, and integrated packet forwarding in the IBC stack.

Poem

🐇💻 CodeRabbit hopping through the code,
📦 Forwarding packets, lightening the load.
🌐 IBC's new path, we now applaud,
🚀 For chains to converse, without a prod.

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.
  • 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 from git 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: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 10647b5 and 436b609.
Files ignored due to filter (2)
  • go.mod
  • go.sum
Files selected for processing (1)
  • app/app.go (11 hunks)
Additional comments: 11
app/app.go (11)
  • 104-106: The import paths for the packet forwarding middleware have been added correctly and there are no conflicts with existing imports.

  • 209-209: The packetforward module has been correctly added to the moduleBasics slice.

  • 276-285: The keepers for the packet forwarding middleware are declared correctly, following the established naming conventions and pointer usage.

  • 346-346: The store key for the packet forwarding middleware has been added correctly and follows the naming conventions.

  • 567-574: The comments added provide a clear description of the middleware stack for ICS20, including the packet forwarding middleware's position in the stack.

  • 588-611: The packet forwarding middleware is correctly integrated into the IBC middleware stack with appropriate parameters for retries and timeouts.

  • 743-743: The packet forwarding middleware's AppModule is registered correctly within the module manager.

  • 784-784: The packet forwarding middleware is added to the BeginBlockers in the correct sequence.

  • 803-803: The packet forwarding middleware is added to the EndBlockers in the correct sequence.

  • 827-827: The packet forwarding middleware is added to the InitGenesis in the correct sequence.

  • 1173-1173: The subspace for the packet forwarding middleware is correctly initialized in the ParamsKeeper with the appropriate key table.

Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

@@ -1138,6 +1170,7 @@ func initParamsKeeper(
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibcexported.ModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)
paramsKeeper.Subspace(packetforwardtypes.ModuleName).WithKeyTable(packetforwardtypes.ParamKeyTable())
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not required in v7.1.1 (x/params is migrated out due to SDK v0.51 deprecation).

It is fine being here, just not used

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the comment @Reecepbcups .
Paramspace is still working in v0.47 and v0.50. I'm not sure if the IBC requires it or not.

Copy link
Member

Choose a reason for hiding this comment

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

I've checked Osmosis, which migrated to v0.47 recently, and they also setup PFM

Copy link
Member

Choose a reason for hiding this comment

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

I mean, their Osmosis PFM integration also uses params keeper.

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: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 0865307 and 75afb45.
Files ignored due to path filters (2)
  • go.mod is excluded by: !**/*.mod
  • go.sum is excluded by: !**/*.sum
Files selected for processing (1)
  • app/app.go (12 hunks)
Additional comments: 12
app/app.go (12)
  • 104-106: The import statements for the packet forward middleware and related packages have been added correctly.
  • 209-209: The packetforward.AppModuleBasic{} has been correctly added to the moduleBasics slice.
  • 276-285: The PacketForwardKeeper has been correctly added to the UmeeApp struct as a pointer, which is consistent with the other keepers.
  • 346-346: The packetforwardtypes.StoreKey has been correctly added to the storeKeys slice.
  • 586-615: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [567-612]

The integration of the packet forward middleware into the IBC module stack is done correctly, with attention to the middleware order in the stack.

  • 589-600: The PacketForwardKeeper is initialized properly with the necessary dependencies and configuration.
  • 744-744: The packetforward.NewAppModule is correctly added to the module manager.
  • 785-785: The packetforwardtypes.ModuleName is correctly added to the beginBlockers slice.
  • 804-804: The packetforwardtypes.ModuleName is correctly added to the endBlockers slice.
  • 828-828: The packetforwardtypes.ModuleName is correctly added to the initGenesis slice.
  • 845-845: The packetforwardtypes.ModuleName is correctly added to the orderMigrations slice.
  • 1175-1175: The previous comments regarding the packetforwardtypes.ModuleName subspace are still valid and no further action is required.

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Attention: 213 lines in your changes are missing coverage. Please review.

Comparison is base (7f05ad4) 75.38% compared to head (75afb45) 68.50%.
Report is 350 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2381      +/-   ##
==========================================
- Coverage   75.38%   68.50%   -6.89%     
==========================================
  Files         100      180      +80     
  Lines        8025    13321    +5296     
==========================================
+ Hits         6050     9125    +3075     
- Misses       1589     3591    +2002     
- Partials      386      605     +219     
Files Coverage Δ
ante/ante.go 66.66% <100.00%> (+18.45%) ⬆️
ante/fee.go 80.00% <100.00%> (+1.64%) ⬆️
ante/spam_prevention.go 75.92% <ø> (ø)
app/inflation/inflation.go 100.00% <100.00%> (ø)
app/upgradev3/migrations.go 84.21% <ø> (+5.94%) ⬆️
sdkclient/tx/sign.go 0.00% <ø> (ø)
util/coin/utoken.go 100.00% <100.00%> (ø)
util/genmap/genmap.go 100.00% <100.00%> (ø)
util/ibc/ibc.go 58.82% <ø> (ø)
util/sdkutil/events.go 0.00% <ø> (ø)
... and 46 more

... and 114 files with indirect coverage changes

@robert-zaremba robert-zaremba merged commit 45f10a1 into umee-network:main Jan 19, 2024
25 of 27 checks passed
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.

3 participants