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

Problem: ibc keeper interface is not used in relayer precompile #1219

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

mmsqe
Copy link
Collaborator

@mmsqe mmsqe commented Oct 24, 2023

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Summary by CodeRabbit

  • New Feature: Integrated Inter-Blockchain Communication (IBC) functionality, enhancing the software's ability to interact with different blockchain networks.
  • Refactor: Updated the relayer contract address and improved the 'call_rly_cmd' function for better flexibility and efficiency.
  • Test: Enhanced the 'prepare_network' function to use dynamic port values, improving the reliability of integration tests.
  • Refactor: Replaced specific package dependencies with a more general 'IbcKeeper' interface, increasing code maintainability and future-proofing the software.

These changes aim to improve the software's interoperability, flexibility, and maintainability, providing a more robust and user-friendly experience.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 24, 2023

Walkthrough

This update integrates Inter-Blockchain Communication (IBC) functionality into the codebase, modifies the relayer contract, and updates the test configurations. It also refactors the call_rly_cmd function to be more flexible and starts the "relayer-demo" process dynamically.

Changes

File Summary
.../configs/ibc_rly.jsonnet Updated the precompiled_contract_address field in the chains array of the relayer object.
integration_tests/ibc_utils.py Removed the os module import, added an optional hostchain parameter to the call_rly_cmd function, and updated the prepare_network function to start the "relayer-demo" process dynamically.
x/cronos/.../precompiles/relayer.go Removed the ibckeeper package import, added the cronosevents and types package imports, and updated the RelayerContract struct and NewRelayerContract function to use types.IbcKeeper.
x/cronos/types/interfaces.go Added several import statements for IBC-related packages and introduced a new IbcKeeper interface for IBC operations.

🐇

"In the land of code, where the shadows lie,

An update comes, under the digital sky.

IBC's call, we now heed,

With dynamic relays, we proceed.

Contracts change, tests refine,

In the end, all will align.

So hop along, don't be shy,

In the land of code, where the shadows lie." 🌙


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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 help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

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.json

@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #1219 (bcb20ba) into main (29ee38e) will increase coverage by 20.25%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1219       +/-   ##
===========================================
+ Coverage   16.70%   36.95%   +20.25%     
===========================================
  Files          79      115       +36     
  Lines        5766    10235     +4469     
===========================================
+ Hits          963     3782     +2819     
- Misses       4725     6080     +1355     
- Partials       78      373      +295     
Files Coverage Δ
x/cronos/keeper/precompiles/relayer.go 25.80% <100.00%> (ø)

... and 54 files with indirect coverage changes

@mmsqe mmsqe changed the title Problem: transfer message type is not supported in relayer precompile Problem: ibc keeper interface is not used in relayer precompile Oct 24, 2023
@mmsqe mmsqe marked this pull request as ready for review October 24, 2023 06:55
@mmsqe mmsqe requested a review from a team as a code owner October 24, 2023 06:55
@mmsqe mmsqe requested review from leejw51crypto and thomas-nguy and removed request for a team October 24, 2023 06:55
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 ed22664 and 758a5ed.
Files selected for processing (4)
  • integration_tests/configs/ibc_rly.jsonnet (1 hunks)
  • integration_tests/ibc_utils.py (3 hunks)
  • x/cronos/keeper/precompiles/relayer.go (2 hunks)
  • x/cronos/types/interfaces.go (2 hunks)
Files skipped from review due to trivial changes (3)
  • integration_tests/configs/ibc_rly.jsonnet
  • integration_tests/ibc_utils.py
  • x/cronos/keeper/precompiles/relayer.go
Additional comments: 2
x/cronos/types/interfaces.go (2)
  • 23-26: The new imports are related to the IBC (Inter-Blockchain Communication) module. Ensure that these packages are used in the codebase and are not left unused.

  • 98-116: The new IbcKeeper interface is introduced to handle IBC operations. It includes methods for client creation, update, upgrade, misbehaviour submission, connection and channel management, packet reception, acknowledgement, and timeout handling. This interface is a good practice for encapsulating IBC related operations and providing a clear contract for any struct that implements it.

@mmsqe mmsqe enabled auto-merge October 25, 2023 07:06
@mmsqe mmsqe added this pull request to the merge queue Oct 25, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 25, 2023
@mmsqe mmsqe added this pull request to the merge queue Oct 25, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 25, 2023
@mmsqe mmsqe added this pull request to the merge queue Oct 25, 2023
Merged via the queue into crypto-org-chain:main with commit f9d69a7 Oct 25, 2023
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.

2 participants