Misconfigured Socket
plus misconfigured Transmitter
could lead to duplicate MsgId
s.
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
Socket
contract on a new chain with the sameSlug
as another chain - or deploy a second version of a
Socket
contract on the same chain - (Accidentally) allow a
Transmitter
to also process (e.g. Seal) thisSocket
- Or do this on purpose if
Transmitter
s would be permissionless - Then a duplicate
MsgId
will be created, becauseMsgId
is build of localSlug
and localmessageCount
. - Do an
execute()
on the destionation chain with the duplicateMsgId
- If it is slower than the original
MsgId
then it will be rejected. - If it is faster than the original
MsgId
then it will be processed and the originalMsgId
will be rejected. - This would lead to DOS / Griefing
Consider using packedMessage
as the parameter for messageExecuted[]
.
This would be more robust.
The function execute()
keeps record of processed messages via MsgId
.
The MsgId
is build of local Slug
and local messageCount
, so only stores general information
from the source chain.
function execute(...) ... {
if (messageExecuted[messageDetails_.msgId])
revert MessageAlreadyExecuted();
messageExecuted[messageDetails_.msgId] = true;
...
}
function _encodeMsgId(uint256 slug_) internal returns (bytes32) {
return bytes32((uint256(uint32(slug_)) << 224) | messageCount++);
}