Skip to content

Commit a0b5cb4

Browse files
feat(zkgm): consitency: reuse packet commitment key for in-flight packets
1 parent b83914a commit a0b5cb4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

evm/contracts/apps/ucs/03-zkgm/Zkgm.sol

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import "solady/utils/EfficientHashLib.sol";
1818
import "../../Base.sol";
1919
import "../../../core/04-channel/IBCPacket.sol";
2020
import "../../../core/05-port/IIBCModule.sol";
21+
import "../../../core/24-host/IBCCommitment.sol";
2122

2223
import "./IEurekaModule.sol";
2324
import "./IZkgmERC20.sol";
@@ -1044,8 +1045,10 @@ contract UCS03Zkgm is
10441045
)
10451046
);
10461047
// Guaranteed to be unique by the above sendPacket
1047-
bytes32 packetHash = IBCPacketLib.commitPacket(sentPacket);
1048-
inFlightPacket[packetHash] = ibcPacket;
1048+
bytes32 commitmentKey = IBCCommitment.batchPacketsCommitmentKey(
1049+
IBCPacketLib.commitPacket(sentPacket)
1050+
);
1051+
inFlightPacket[commitmentKey] = ibcPacket;
10491052
return ZkgmLib.ACK_EMPTY;
10501053
}
10511054

0 commit comments

Comments
 (0)