Closed spalladino closed 5 years ago
Infer whether it was a meta tx given the recipient (it's a relay hub) or the function selector in its data (it's a relayCall). Note that we could get false positives in this case, which would be bad.
If we check both the recipient and the function selector, would there be any false positives? I can't think of any.
If so I would prefer this method over the other one, which can result in false negatives.
If we check both the recipient and the function selector
Remember that the client does not know the address of the relay hub - it actually queries it from the recipient (the dapp), so this one can be a bit tricky to implement.
Oh, I see. I thought we were using the singleton address.
This is related to #11: if we store a number of known hub implementations on the client, we can simply use those.
Fixed in a091c583fc6fd7c0b8b0ad40c24f30b4bfa25897
After sending a meta tx, the client library (web3) relies on the
getTransactionReceipt
provider method to check when the meta tx got mined. The GSN specific provider needs to intercept this method to fix the receipt that was sent as a meta-tx.However, the
getTransactionReceipt
call does not receive theuseGSN
flag (since it does not receive parameters). Therefore, when we intercept thegetTransactionReceipt
call in the GSNProvider, we need to know whether it was a metatx or not.We can do that by either:
useGSN=true
, and checking that cache when resolving the transaction receipt.relayCall
). Note that we could get false positives in this case, which would be bad.