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

use new port router with OnAcknowledgementPacket #7108

Merged

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented Aug 8, 2024

Description

closes: #7031
ref: #7043


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 the 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 and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

@colin-axner colin-axner marked this pull request as ready for review August 8, 2024 15:12
panic(errorsmod.Wrap(err, "failed to unwrap acknowledgement"))
}

return ack, incentivizedAck.AppAcknowledgement
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note: we return ack we unmarshaled as our ack. This is because it expects to unmarshal this value in OnAcknowledgement

Copy link

sonarqubecloud bot commented Aug 8, 2024

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

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

This looks amazing, thanks for adding really detailed docstrings on those interfaces. Super happy with this PR and the progress we've made this week! 🚀 🚀 🚀

ctx sdk.Context,
channelVersion string,
packet channeltypes.Packet,
acknowledgement []byte,
relayer sdk.AccAddress,
) error {
for i := len(im.cbs) - 1; i >= 0; i-- {
Copy link
Contributor

Choose a reason for hiding this comment

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

this ended up looking super clean with these 2 interfaces for wrapping, nice job!


// AcknowledgementWrapper is an optional interface which should be implemented by middlewares which wrap the acknowledgement
// to ensure backwards compatibility.
type AcknowledgementWrapper interface {
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 we can add a type assertion for ics29

@@ -131,12 +131,29 @@ type VersionWrapper interface {
WrapVersion(cbVersion, underlyingAppVersion string) string
// UnwrapVersionUnsafe is required in order to remove middleware wiring and the ICS4Wrapper
// while maintaining backwards compatibility. It will be removed in the future.
// Applications should unwrap the provided version with into their application version.
// Applications should unwrap the provided version with into their application version.
// and the underlying application version. If they are unsuccessful they should return an error.
// UnwrapVersionUnsafe will be used during opening handshakes and channel upgrades when the version
// is still being negotiated.
UnwrapVersionUnsafe(string) (cbVersion, underlyingAppVersion string, err error)
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 we can add a type assertion for ics27

@colin-axner colin-axner merged commit 0ea612a into feat/port-router Aug 8, 2024
24 of 25 checks passed
@colin-axner colin-axner deleted the colin/7031-portrouter-onacknowledgementpacket branch August 8, 2024 15:50
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.

2 participants