Skip to content

Commit 9deea3e

Browse files
committed
add recv packet multipayload details
1 parent b660681 commit 9deea3e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spec/IBC_V2/core/ics-004-packet-semantics/PACKET_HANDLER.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ RecvPacket Preconditions:
119119
RecvPacket Postconditions:
120120

121121
- A packet receipt is stored under the specified ICS24 with the `destClientId` and `sequence`
122-
- All receiving application(s) as identified by the destPort(s) in the payload(s) have executed their recvPacket logic
122+
- All receiving application(s) as identified by the destPort(s) in the payload(s) have executed their recvPacket logic. If **any** of the payloads return an error during processing, then all application state changes for all payloads **must** be reverted. If all payloads are processed successfully, then all applications state changes are written. This ensures atomic execution for the payloads batched together in a single packet.
123+
- If any payload returns an error, then the single `SENTINEL ERROR ACKNOWLEDGEMENT` is written using `WriteAcknowledgment`. If all payloads succeed and return an app-specific acknowledgement, then each app acknowledgement is included in the list of `AppAcknowledgement` in the final packet `Acknowledgement` in the **exact** order that their corresponding payloads were included in the packet.
124+
125+
NOTE: It is possible for applications to process their payload asynchronously to the `RecvPacket` transaction execution. In this case, the IBC core handler **must** await all applications returning their individual application acknowledgements before writing the acknowledgement with app acknowledgements in the order of their corresponding payloads in the original packet **not** the order in which the applications return their asynchronous acknowledgements which may be different orders. IBC allows multiple payloads intended for the same application to be batched in the same packet. Thus, if an implementation wishes to support multiple payloads and asynchronous acknowledgements together, then there must be a way for core IBC to know which payload a particular acknowledgment is being written for. This may be done by providing the index of the payload list during `recvPacket` application callback, so that the application can return the same index when writing the acknowledgment so that it can be placed in the right order. Otherwise, implementations may simply block asynchronous acknowledgment support for multi-payload packets
123126

124127
RecvPacket Errorconditions:
125128

0 commit comments

Comments
 (0)