From 147645deb09c899d876c1454062664a91c2cce17 Mon Sep 17 00:00:00 2001 From: Stefano Angieri Date: Mon, 14 Oct 2024 16:09:51 +0200 Subject: [PATCH] minor fixes --- spec/core/v2/ics-004-packet-semantics/README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/spec/core/v2/ics-004-packet-semantics/README.md b/spec/core/v2/ics-004-packet-semantics/README.md index ea8f8e9f7..f4137aa32 100644 --- a/spec/core/v2/ics-004-packet-semantics/README.md +++ b/spec/core/v2/ics-004-packet-semantics/README.md @@ -16,7 +16,6 @@ TODO : - Rename file - Improve conditions set / think about more condition an proper presentation - Review Ack and Timeout carefully -- FROM Race condition UP to END ## Synopsis @@ -158,7 +157,7 @@ Additionally, the ICS-04 specification defines a set of conditions that the impl #### Permissioning -- Channels should be permissioned to the application registered on the local router. Thus only the modules registered on the local router, and so associated with the channel, should be able to send or receive on it. +- Channels should be permissioned to the application registered on the local router. Thus only the modules registered on the local router should be able to send or receive on it. #### Fungibility conservation @@ -929,8 +928,9 @@ function timeoutPacket( ) { // Channel and Client Checks channel = getChannel(packet.channelSourceId) - client = router.clients[channel.clientId] + assert(client !== null) + client = router.clients[channel.clientId] assert(client !== null) // verify we sent the packet and haven't cleared it out yet @@ -945,7 +945,7 @@ function timeoutPacket( asert(packet.timeoutTimestamp > 0 && proofTimestamp >= packet.timeoutTimestamp) // verify there is no packet receipt --> receivePacket has not been called - receiptPath = packetReceiptPath(packet.channelDestId, packet.sequence,relayer) + receiptPath = packetReceiptPath(packet.channelDestId, packet.sequence) merklePath = applyPrefix(channel.keyPrefix, receiptPath) assert(client.verifyNonMembership( client.clientState, @@ -959,7 +959,7 @@ function timeoutPacket( success=cbs.OnTimeoutPacket(packet.channelSourceId,payload) // Note that payload includes the version. The application is required to inspect the version to route the data to the proper callback abortUnless(success) - channelStore.delete(packetCommitmentPath(packet.channelSourceId, packet.sequence, relayer)) + channelStore.delete(packetCommitmentPath(packet.channelSourceId, packet.sequence)) // Event Emission // See fields emitLogEntry("timeoutPacket", { @@ -979,8 +979,6 @@ Packets MUST be acknowledged or timed-out in order to be cleaned-up. #### Reasoning about race conditions -TODO - ##### Timeouts / packet confirmation There is no race condition between a packet timeout and packet confirmation, as the packet will either have passed the timeout height prior to receipt or not.