Official discussion thread for Add ERC: Cross-Chain Messaging Gateway by Amxx · Pull Request #673 · ethereum/ERCs · GitHub
What is the purpose of the return argument (bytes4) in executeMessage
?
This is to mitigate selector clashes, to make sure the receiver acknowledges the protocol it’s engaging in.
What would be an example of an attack / things going wrong if the Gateway does not check the return value of executeMessage
?
I think I get it now, this is for ensuring that the Destination Gateway only can call the executeMessage
function of the receiving application and not something else.
I love this ERC!
This ERC uses a ‘push’ mechanism rather than a ‘pull’ mechanism for messaging. In my mind, a ‘push’ mechanism like the one described essentially uses a ‘pull’ mechanism under the hood - Whoever is calling the executeMessage
function is pulling the message from the Destination Gateway
. I don’t think there’s anything wrong with either approach; I just find it to be a useful mental model.
Links to reference implementation with Axelar Network and audits: