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

Fixes for Packet Ack #6036

Merged
merged 2 commits into from
Apr 20, 2020
Merged

Fixes for Packet Ack #6036

merged 2 commits into from
Apr 20, 2020

Conversation

jackzampolin
Copy link
Member

Copy link
Member

@AdityaSripal AdityaSripal left a 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 🎉

Copy link
Member

@AdityaSripal AdityaSripal left a 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())),
Copy link
Member

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 {
Copy link
Member

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)
Copy link
Member

@AdityaSripal AdityaSripal Apr 20, 2020

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

Copy link
Collaborator

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?

Copy link
Collaborator

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

utACK

@jackzampolin
Copy link
Member Author

This is good to go!

@fedekunze
Copy link
Collaborator

some tests are failing

@jackzampolin
Copy link
Member Author

I've fixed the tests locally. They should be g2g.

@alessio alessio added the A:automerge Automatically merge PR once all prerequisites pass. label Apr 20, 2020
Copy link
Contributor

@alessio alessio left a comment

Choose a reason for hiding this comment

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

ACKd

@mergify mergify bot merged commit 793c6f1 into master Apr 20, 2020
@mergify mergify bot deleted the jack/packet-ack branch April 20, 2020 22:37
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants