Misconfigured Socket plus misconfigured Transmitter could lead to to duplicate PacketIds.
Set to severity of low because it could fit in Smart contract unable to operate or Damage to users/protocol due to griefing,
but is unlikely to happen.
- (Accidentally) deploy a
Socketcontract on a new chain with the sameSlugas another chain - or deploy a second version of a
Socketcontract on the same chain - (Accidentally) allow a
Transmitterto also process (e.g. Seal) thisSocket - Or do this on purpose if
Transmitters would be permissionless - Assume the same
capacitorAddressis used (this can happen if a deterministic deployment of Switchboards is used) - Then duplicate
PacketIdwill be created because it is build of localSlug, localcapacitorAddressand localpacketCount - Assume the FastSwitchboard is used
- Do an
attest()on the destionation chain with the duplicatePacketId - Now addition
attest()s are done and a message could be accepted that maybe should not have been accepted
Consider storing more information in PacketId, for example make it a hash and include the root.
This would be more robust.
The function attest() keeps record of attested messages via PacketId.
The PacketId is build of local Slug, local capacitorAddress and local packetCount, so only stores general information
from the source chain.
function attest(bytes32 packetId_,...) ... {
...
if (isAttested[watcher][packetId_]) revert AlreadyAttested();
...
isAttested[watcher][packetId_] = true;
...
}function _encodePacketId(...) ... {
return
bytes32(
(uint256(chainSlug) << 224) |
(uint256(uint160(capacitorAddress_)) << 64) |
packetCount_
);
}