The MessageDispatcher method description specifies: " MessageDispatcher
s MUST revert if toChainId
is not supported."
This requires the smart contract to store the supported receiving chain-ids. However, please consider the following case:
- MessageDispatcher and MessageExecutor functionalities are coded in the same smart contract
- Dispatcher/Executor contract deployed on EVM such that the contract address is identical on each chain
In this case the executor does not need to verify that the chain-id is supported, but instead compares the sender address to the receiverās own address. This is because if the address is identical, the code is identical and so the dispatcher must be supported. Without the revert ātoChainId not supportedā, we could deploy an immutable contract (without owner-keys) that can later handle messages from and to new EVM chains on which the identical contract was deployed with the same address without the need of a permissioned addition of chain-ids.
From a user perspective, the cross-chain message would be ālostā if they enter a chain id that either does not exist or does not have the dispatcher/executor contract deployed yet. Entering a wrong chain id, arguably, is a similar irreversible mistake as if one had entered a wrong receiver address for token transfers and, hence, we might deem it acceptable.
Looking forward to get your views on this.