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

Feature: replace ibc-hook with middleware #511

Merged
merged 6 commits into from
May 27, 2022

Conversation

thomas-nguy
Copy link
Collaborator

👮🏻👮🏻👮🏻 !!!! 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! :)

@thomas-nguy thomas-nguy requested a review from a team as a code owner May 26, 2022 02:41
@thomas-nguy thomas-nguy requested review from devashishdxt and adu-crypto and removed request for a team May 26, 2022 02:41
@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #511 (f429bba) into main (48dd672) will increase coverage by 0.27%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #511      +/-   ##
==========================================
+ Coverage   39.63%   39.91%   +0.27%     
==========================================
  Files          31       30       -1     
  Lines        1607     1596      -11     
==========================================
  Hits          637      637              
+ Misses        924      913      -11     
  Partials       46       46              
Impacted Files Coverage Δ
x/cronos/keeper/keeper.go 68.86% <100.00%> (+3.60%) ⬆️

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

🎉awesome.
I guess the problem statement here is: Problem: custom ibc-go fork used? the docs can perhaps have a brief update: https://github.com/crypto-org-chain/cronos/blob/main/docs/architecture/adr-002.md and https://github.com/crypto-org-chain/cronos/blob/main/docs/architecture/adr-004.md that the middleware implementation will override OnRecvPacket, OnAcknowledgmentPacket, and OnTimeoutPacket?

One potential thing to check is that there's a missing test for timeouts etc.: #398 -- we can see where it's at with the QA team... if ready soon, maybe we can merge the missing integration test first and run it against this?

@thomas-nguy thomas-nguy changed the title Feature: replace ibc-hook with middleware [WIP]Feature: replace ibc-hook with middleware May 26, 2022
@@ -76,3 +79,10 @@ type EvmKeeper interface {
) (sdk.Coins, error)
ChainID() *big.Int
}

// ICS4Wrapper defines the expected ICS4Wrapper for middleware
type ICS4Wrapper interface {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this seems not used anywhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes this can be removed for now (this is needed if we need to write a "full" middleware)

Copy link
Collaborator

@yihuang yihuang left a comment

Choose a reason for hiding this comment

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

LGTM

@thomas-nguy thomas-nguy changed the title [WIP]Feature: replace ibc-hook with middleware Feature: replace ibc-hook with middleware May 26, 2022
@thomas-nguy thomas-nguy changed the title Feature: replace ibc-hook with middleware [WIP]Feature: replace ibc-hook with middleware May 26, 2022
@thomas-nguy thomas-nguy changed the title [WIP]Feature: replace ibc-hook with middleware Feature: replace ibc-hook with middleware May 26, 2022
@thomas-nguy
Copy link
Collaborator Author

I will merge this PR first as the current integration tests are passing.

I will work on the integration tests for ibc timeout/failure in another PR
#514

Copy link
Contributor

@adu-crypto adu-crypto left a comment

Choose a reason for hiding this comment

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

lgtm

@thomas-nguy thomas-nguy merged commit a267979 into crypto-org-chain:main May 27, 2022
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.

4 participants