Skip to content

Conversation

fedekunze
Copy link
Contributor

@fedekunze fedekunze commented Aug 17, 2020

Description

closes: #6993


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.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@codecov
Copy link

codecov bot commented Aug 17, 2020

Codecov Report

Merging #7066 into master will decrease coverage by 0.99%.
The diff coverage is 52.74%.

@@            Coverage Diff             @@
##           master    #7066      +/-   ##
==========================================
- Coverage   55.60%   54.60%   -1.00%     
==========================================
  Files         457      547      +90     
  Lines       27440    37130    +9690     
==========================================
+ Hits        15257    20275    +5018     
- Misses      11083    15196    +4113     
- Partials     1100     1659     +559     

@colin-axner
Copy link
Contributor

I can take over this pr, I think it makes sense to not add an additional callback and use OnTimeoutPacket callback instead since from the sending chain shouldn't care specifically why the packet was timed out, just that it was timed out. This reduces the amount of callbacks app modules need to do.

cc/ @cwgoes thoughts? Also, this was not specified in the ICS spec so I think it should be updated there

@colin-axner colin-axner self-assigned this Aug 18, 2020
@@ -266,28 +266,6 @@ func (k Keeper) TimeoutOnClose(
return err
}

k.deletePacketCommitment(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was an unreachable bug that we didn't close ordered channels upon timeout


// Type implements sdk.Msg
func (msg MsgTimeoutOnClose) Type() string {
return "timeout_on_close_packet"
Copy link
Contributor

Choose a reason for hiding this comment

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

it is a little strange to use timeout_on_close_packet for MsgTimeoutOnClose ?

@colin-axner colin-axner marked this pull request as ready for review August 18, 2020 14:32
Copy link
Contributor Author

@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.

implementation LGTM, a few nits only. Thanks @colin-axner!

}, true},
{"success: UNORDERED timeout out of order packet", func() {
// setup uses an UNORDERED channel
clientA, clientB, _, _, channelA, channelB := suite.coordinator.Setup(suite.chainA, suite.chainB)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

nit, without the comment, it is not intuitive that the channels are unordered. Maybe consider renaming it or adding a boolean arg?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, I'm thinking we will likely have more channel types in the future, so a bool or different function names wouldn't make sense. Instead I could add a third arg that would be like channeltypes.ORDERED. This is a fairly large line diff change and I think would be easier to review in a followup, I can add it to the wishlist and address it when I begin to untangle ibc-transfer from testing.

@fedekunze
Copy link
Contributor Author

ACK. @colin-axner can you approve and merge the PR?

@fedekunze fedekunze requested a review from colin-axner August 20, 2020 11:14
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.

ACK

}

// Perform application logic callback
// NOTE: MsgTimeout and MsgTimeoutOnClose use the same "OnTimeoutPacket"
Copy link
Contributor

Choose a reason for hiding this comment

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

For now, I think using the same callback is fine

@fedekunze fedekunze merged commit 16435a0 into master Aug 20, 2020
@fedekunze fedekunze deleted the fedekunze/6993-timeoutonclose branch August 20, 2020 11:20
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.

Add TimeoutOnClose usage support
3 participants