-
Notifications
You must be signed in to change notification settings - Fork 639
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
Move channel back to counterparty #7842
base: feat/ibc-eureka
Are you sure you want to change the base?
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.
Thanks! This is going to be very nice! 🙌
The general structure and logic seems straightforward and understandable. I have some questions on naming that I left in comments.
// client identifier | ||
string client_id = 1; | ||
// counterparty merkle prefix | ||
repeated bytes merkle_prefix = 2; |
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.
To avoid confusion, I would also name this counterparty_merkle_prefix.
Or restructure the message like this:
string client_id = 1;
CounterpartyInfo counterparty = 2;
// resolveV2Identifiers returns the client identifier and the counterpartyInfo for the client given the packetId | ||
// Note: For fresh eureka channels, the client identifier and packet identifier are the same. | ||
// For aliased channels, the packet identifier will be the original channel ID and the counterpartyInfo will be constructed from the channel | ||
func (k *Keeper) resolveV2Identifiers(ctx context.Context, portId string, packetId string) (string, clienttypes.CounterpartyInfo, error) { |
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.
I think maybe the name could be better here. If I have to read the comment to understand what the function does for me, I consider it a code smell :)
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.
After seeing it used further down I am even more confused. Is it taking in packetId or a client id?
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.
Yea this was because it could also be an original channelID for aliasing, in which case I still need to retrieve the original clientiD
@@ -14,9 +14,9 @@ message Packet { | |||
// with a later sequence number. | |||
uint64 sequence = 1; | |||
// identifies the sending chain. | |||
string source_channel = 2; | |||
string source_id = 2; |
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.
It will be the last time I bring this up (I hope), but what is the reason we don't want to name source and destination identifier client_id (as in source_client_id)? Can it be anything else?
return 0, "", errorsmod.Wrap(types.ErrChannelNotFound, sourceChannel) | ||
} | ||
// lookup counterparty and clientid from packet identifiers | ||
clientID, counterparty, err := k.resolveV2Identifiers(ctx, payloads[0].SourcePort, sourceId) |
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.
I thought this function was taking in a packet identifier? But it is taking in the source (client) identifier?
Description
closes: #7739
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.
docs/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.