-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Fixes for Packet Ack #6036
Fixes for Packet Ack #6036
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.
ACK, another productive debugging session @jackzampolin 🎉
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.
Left some explanations for other reviewers
@@ -241,7 +241,8 @@ func (k Keeper) PacketExecuted( | |||
ctx.EventManager().EmitEvents(sdk.Events{ | |||
sdk.NewEvent( | |||
types.EventTypeRecvPacket, | |||
sdk.NewAttribute(types.AttributeKeyData, string(acknowledgement)), | |||
sdk.NewAttribute(types.AttributeKeyData, string(packet.GetData())), |
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.
We need the data along with acknowledgement to reconstruct packet on relayer side for `MsgAcknowledgement
@@ -250,7 +251,7 @@ func (cs ClientState) VerifyPacketAcknowledgement( | |||
return err | |||
} | |||
|
|||
if err := proof.VerifyMembership(consensusState.GetRoot(), path, acknowledgement); err != nil { | |||
if err := proof.VerifyMembership(consensusState.GetRoot(), path, channeltypes.CommitAcknowledgement(acknowledgement)); err != nil { |
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.
Leaf value is the hash of acknowledgement not ack itself
@@ -169,7 +169,7 @@ func NewHandler(k Keeper) sdk.Handler { | |||
|
|||
case channel.MsgAcknowledgement: | |||
// Lookup module by channel capability | |||
module, _, ok := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.DestinationPort, msg.Packet.DestinationChannel) | |||
module, _, ok := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) |
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.
Both MsgAcknowledgment
and MsgTimeout
are sent to the original sending chain so they must grab the module using packet's SourcePort/Channel
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.
can you add that comment on the code?
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.
utACK
This is good to go! |
some tests are failing |
I've fixed the tests locally. They should be g2g. |
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.
ACKd
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.
LGTM
cc @AdityaSripal @cwgoes @fedekunze