-
Notifications
You must be signed in to change notification settings - Fork 655
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
Callbacks Eureka #7934
base: main
Are you sure you want to change the base?
Callbacks Eureka #7934
Conversation
@@ -295,7 +295,7 @@ func (s *CallbacksTestSuite) AssertHasExecutedExpectedCallbackWithFee( | |||
|
|||
// GetExpectedEvent returns the expected event for a callback. | |||
func GetExpectedEvent( | |||
ctx sdk.Context, packetDataUnmarshaler porttypes.PacketDataUnmarshaler, remainingGas uint64, data []byte, srcPortID, |
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.
srcPortID not used
|
||
return IBCMiddleware{ | ||
app: packetDataUnmarshalerApp, | ||
writeAckWrapper: writeAckWrapper, |
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 allow writeAckWrapper to be nil and use chanKeeperV2 if so. cc: @srdtrk for feedback
TimeoutHeight: clienttypes.Height{}, | ||
TimeoutTimestamp: 0, |
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.
timeout values zeroed out everywhere. So we preserve interface, but contracts should not rely on these values for v2 packets
TimeoutHeight: clienttypes.Height{}, | ||
TimeoutTimestamp: 0, | ||
} | ||
// wrap the individual acknowledgement into the channeltypesv2.Acknowledgement since it implements the exported.Acknowledgement interface |
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.
wrapping in v2.Acknowledgement and v2.Acknowledgement implements exported.Acknowledgement interface
This is because the original receivePacket callback expects exported.Acknowledgement
TimeoutTimestamp: 0, | ||
} | ||
return im.contractKeeper.IBCOnAcknowledgementPacketCallback( | ||
cachedCtx, packetv1, acknowledgement, relayer, cbData.CallbackAddress, cbData.SenderAddress, payload.Version, |
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.
However, here acknowledgement callback just expects []byte
var writeAckWrapper api.WriteAcknowledgementWrapper | ||
if im.writeAckWrapper != nil { | ||
writeAckWrapper = im.writeAckWrapper | ||
} else { | ||
writeAckWrapper = im.chanKeeperV2 | ||
} |
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.
cc: @srdtrk this may simplify wiring
|
Description
The following is a cherrypick of relevant commits from #7927
Please pay close attention while reviewing this PR. It is recommended to review the ibc callbacks v1 middleware in parallel and ensure all equivalent checks and logic are being made
closes: #7855
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.