-
Notifications
You must be signed in to change notification settings - Fork 7
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
Change counterpartyInfo to channel #100
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start. I still feel like it was easier to wrap your head around when it was called counterparty info. If we were explaining this to a 3rd party, the first one sounds simpler imo:
- Each light client has a counterparty chain info associated with it.
- Each light client has a channel associated with it that carries some counterparty info where
channelId
equalsclientId
.
But if we need to do this to follow spec then I won't block it. There are a couple more things to do before we can merge this:
- Fix linting issues (
just lint
) - Have foundry tests all pass and codecov increase. (
just test-foundry
) - Regenerate abi (Probably
generate-abi
recepe in thejustfile
needs to be updated due to contract name change) - Update e2e tests
- Update benchmarks
We can take care of the last three after you take the first two?
src/ICSCore.sol
Outdated
mapping(string clientId => CounterpartyInfo info) private counterpartyInfos; | ||
contract ICSCore is IICS02Client, IICS04Channel, IICS02ClientErrors, Ownable { | ||
/// @dev channelId => counterpartyInfo | ||
mapping(string channelId => Channel channel) private channels; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CounterpartyInfo feels more descriptive ngl 😅. Because the same light client cannot have multiple channels on top in our implementation I think
src/msgs/IICS04ChannelMsgs.sol
Outdated
interface IICS04ChannelMsgs { | ||
/// @notice Channel information. | ||
/// @custom:spec | ||
/// https://github.com/cosmos/ibc/blob/67fe813f7e4ec603a7c5dec35bc654f3b012afda/spec/micro/README.md?plain=1#L91 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link should be updated?
Co-authored-by: srdtrk <[email protected]>
…lidity-ibc-eureka into aditya/counterparty-to-channel
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #100 +/- ##
==========================================
+ Coverage 95.33% 96.84% +1.51%
==========================================
Files 11 11
Lines 450 539 +89
==========================================
+ Hits 429 522 +93
+ Misses 21 17 -4 ☔ View full report in Codecov by Sentry. |
Description
This PR renames
counterpartyInfo
tochannel
Moreover it does not assume that the counterpartyId is necessarily a clientID. I think here the logic looks much more in-line with IBC-go and hopefully will do a lot to remove the confusions raised in the referenced spec issue.
For now, I have a single contract implementing ICS02 and ICS04 specs since ICS04 doesn't have too many additional functions. I can rename the file to
CoreRouter
to make this clearer rather than ICS02Client.TODO:
ref: cosmos/ibc#1164
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.