This is a very interesting question!
I looked at the native Polygon, Optimism, Arbitrum, and Nomad bridges to see what the lowest common denominator was, and found that the 1-to-1 (or really a kind of a multicast in the case of Nomad) was the best fit.
The current spec requires contracts on the sending chain to know the addresses of the contracts on the receiving chain. Why not also the receiving chain id?
That being said, perhaps that’s the answer: it’s optional. Some Relayers might ignore the chainId while others, like Hop, will use it.
This does mean, however, that Executors will need to include the sending chain id on the other side. For some that might be kind of redundant, and opens up for human error. But, if the contract is audited and re-used it’s far less likely.
I see you posted a response above
Yes, this is exactly the change that would be needed. You know- I think what we could do is add this to the spec, but also add something along the lines of:
Relayers MAY ignore the passed chainId if they are bound to a particular chain
But- we could require the Relayer to include the chainId in the Event (as you initially wrote). Likewise for the Executor.
Really, the critical thing about this spec is:
- A consistent call interface
- A consistent way to check the original sender / chain
We can allow Relayer and Executor implementations to take shortcuts in certain ways, as long as they adhere to the fundamentals.
Ok let’s review:
- Add a
relayCall
fxn - Add a
chainId
param to the relay, but allow the relay to ignore it - The relay should emit the target chain as part of the
relayed
event - The executor should include the receiving
chainId
in the event and append it to the calldata
I like these changes! @Pierrick curious to hear your thoughts too.
Chris- do you want to make a PR with the changes and tack your name on to the authors? It’d be great for you to be part of this.
I think these changes are straightforward, and we can update our code to match.