Closed jtriley-eth closed 2 years ago
Thanks.
It is was indeed modified from https://github.com/opengsn/forwarder/blob/master/contracts/BaseRelayRecipient.sol,
Apart from conforming to the standard, is there a legit case to be made to allow "non trusted forwarder" to call this function, hence maybe increase the attack surface? Does the standard have an engineering compromise to an use case that is not highlighted here?
CC @d10r for more thoughts
In the case of forwardBatchCall
the trusted forwarder is the only address that's expected to call the function, so no, there is no other use case here.
However, making this EIP-2771 compliant would make meta-transactions possible on other relevant functions on the Host. For example, at the moment, the only function supporting meta-transactions is forwardBatchCall
, but if the _getTransactionSigner()
function is used in callAgreement
, batchCall
and callAppAction
, then there would be no need for a forwardBatchCall
and it would make things like one-off agreement calls or app action calls easier to use with meta-transactions.
I see, at the time, the thinking was that the only meta transaction entry point is forwardBatchCall
. There ware also some ergonomic reason, in biconomy at the time, you need to whitelist the function you want to allow "forwarding", in that case listing one (forwardBatchCall) seemed a "clean" choice.
Gotta think about this again, we could enable that standard behavior for forwardBatchCall, seems harmless. But enabling more "forwardable" entry points in host seems in conflict with other approaches we are doing:
user/forwarder -> host.[callAgreement,callAppAction,batchCall]
or
user/forwarder -> agreement forwarder -> host.forwardBatchCall
or
user -> token -> host.tokenBatchCall??
thx @JoshuaTrujillo15 for pointing out. The requirement indeed makes sense in the examples you describe.
I don't think however it's worth the effort to make forwardBatchCall
compliant, would be a purely academic exercise w/o any practical benefit, given that it's there exclusively for calls via forwarder.
Imo we should stick to the current interface and take a closer look at generic metatx support in the token centric interface. I'll consider already adding support to the agreement forwarder too.
Didi 18:35 no, bcs the CFA forwarder ended up not being a forwarder itself, but just use that protocol feature. Which makes me think that "forwarder" may not be the best name for it (too focused on internal architecture vs what it is/does from an outside perspective), will see if I can find a better one.
Bug Description
The meta-transaction standard, EIP-2771, requires that if the
isTrustedForwarder
function returnsfalse
for a givenmsg.sender
, the "signer" must fallback to themsg.sender
of the call. The currentforwardBatchCall
implementation does not conform to this standard.Steps To Reproduce
forwardBatchCall
from an EOA or a contract whose address, when passed as an argument toisTrustedForwarder
, returns false.Expected Behavior
Per the EIP-2771 standard, the expected behavior of
forwardBatchCall
is to fallback tomsg.sender
instead ofsigner
when themsg.sender
is not a trusted forwarder.Actual Behavior
If the
msg.sender
is not a trusted forwarder, the call reverts entirely with revert string: "Not trusted forwarder".Implementation
EIP-2771 Implementation:
Superfluid Implementation: