From 6321e3532688feb387435e907c9a33ace589cfd1 Mon Sep 17 00:00:00 2001 From: Jun Kimura Date: Mon, 25 Nov 2024 17:27:47 +0900 Subject: [PATCH] IBC-14: clarify which sequence commitments are stored Signed-off-by: Jun Kimura --- contracts/core/04-channel/IBCChannelHandshake.sol | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contracts/core/04-channel/IBCChannelHandshake.sol b/contracts/core/04-channel/IBCChannelHandshake.sol index 535eed30..10208a78 100644 --- a/contracts/core/04-channel/IBCChannelHandshake.sol +++ b/contracts/core/04-channel/IBCChannelHandshake.sol @@ -324,6 +324,9 @@ contract IBCChannelHandshake is IBCModuleManager, IIBCChannelHandshake, IIBCChan channelStorage.nextSequenceRecv = 1; channelStorage.nextSequenceAck = 1; channelStorage.recvStartSequence.sequence = 1; + + // Differ from the ICS-004 spec, we only store the commitment of the next sequence recv. + // This is because, in the current spec, the next sequence send and ack are not needed for the verification on the counterparty chain. getCommitments()[IBCCommitment.nextSequenceRecvCommitmentKey(portId, channelId)] = keccak256(abi.encodePacked((bytes8(uint64(1))))); }