Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8545 +/- ##
==========================================
+ Coverage 57.58% 57.63% +0.05%
==========================================
Files 317 317
Lines 22666 22668 +2
==========================================
+ Hits 13052 13065 +13
+ Misses 9006 8998 -8
+ Partials 608 605 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR expands the packet handling functionality to support sending multiple payloads atomically in the same IBC packet. Key changes include:
- Adding support for asynchronous payloads via a new NewAsyncMockPayload function and handling of async packet result status in the mock IBC module.
- Refactoring endpoint methods (MsgSendPacket and MsgSendPacketWithSender) to accept variadic payload parameters for multiple payload support.
- Updating tests and keeper logic to validate and manage multiple payloads as well as updating error messaging for payload validation.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| testing/mock/v2/mock.go | Introduces NewAsyncMockPayload to support async payloads. |
| testing/mock/v2/ibc_module.go | Updates OnRecvPacket to detect async payloads and return corresponding status. |
| testing/endpoint_v2.go | Refactors MsgSendPacket and MsgSendPacketWithSender to support multiple payloads. |
| modules/core/04-channel/v2/types/* | Adjusts payload validation and error messages to reflect multi-payload support. |
| modules/core/04-channel/v2/keeper/* and msg_server.* | Updates acknowledgement, packet, and message server logic to handle multiple payloads. |
| modules/apps/transfer/v2/transfer_test.go | Adds tests for transfer flows with multiple payloads. |
| CHANGELOG.md | Adds changelog entry documenting multi-payload packet support. |
Comments suppressed due to low confidence (2)
testing/mock/v2/mock.go:38
- [nitpick] Consider adding a comment documenting NewAsyncMockPayload to clarify its purpose, its behavior, and how it differs from NewMockPayload and NewErrorMockPayload.
func NewAsyncMockPayload(sourcePort, destPort string) channeltypesv2.Payload {
testing/endpoint_v2.go:24
- [nitpick] Update the function documentation for MsgSendPacket to clearly specify that it now accepts multiple payloads and describe the expected behavior when multiple payloads are provided.
func (endpoint *Endpoint) MsgSendPacket(timeoutTimestamp uint64, payloads ...channeltypesv2.Payload) (channeltypesv2.Packet, error) {
|
bugbot run |
There was a problem hiding this comment.
✅ BugBot reviewed your changes and found no bugs!
BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.
Was this report helpful? Give feedback by reacting with 👍 or 👎
gjermundgaraba
left a comment
There was a problem hiding this comment.
This looks very good! I left a couple of nits and minor cleanups with the tests. Feel free to merge if you agree with these and get the fixed 👍
| } | ||
|
|
||
| // Validate the acknowledgement against the payload length | ||
| if ack.Success() { |
There was a problem hiding this comment.
nit: could be a single if statement
There was a problem hiding this comment.
I left as is, because i find it more readable as to why the check exists
| var ( | ||
| path *ibctesting.Path | ||
| packet types.Packet | ||
| payload types.Payload |
There was a problem hiding this comment.
I don't think this does anything. There is already a payload in the test function itself that is set with payload := ....
There was a problem hiding this comment.
If it's never going to change, but you need access to it, you could just set it once at the top and use it as you do already. But right now I think it will always be empty.
| var ( | ||
| packet types.Packet | ||
| ack types.Acknowledgement | ||
| packet types.Packet |
There was a problem hiding this comment.
In this one, it does get set in the test function itself, but as far as I can tell, it never changes, so you could just set it once here and use it directly and not reset it every test
There was a problem hiding this comment.
The payloads are getting modulated in the test cases
| var ( | ||
| path *ibctesting.Path | ||
| packet types.Packet | ||
| payload types.Payload |
There was a problem hiding this comment.
same deal here, I believe
|
|
||
| func (s *TypesTestSuite) TestMsgSendPacketValidateBasic() { | ||
| var msg *types.MsgSendPacket | ||
| var payload types.Payload |
There was a problem hiding this comment.
This one doesn't look like it's used in the test function itself, so probably don't need to define it here?
There was a problem hiding this comment.
It gets used in the test cases
Description
closes: IBCGO-2371
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/) if anything is changed.godoccomments if relevant.Files changedin the GitHub PR explorer.