-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GSNv2 support #2258
Comments
Great, thanks for the summary! It looks like we'll be able to leave our We may also want to update our docs to guide users to the OpenGSN docs, removing the references we have (which are anyway replicated there). |
@naszam For testing please open an issue in OpenZeppelin/openzeppelin-test-environment. |
@frangio Ok, Thanks! I've removed my post |
🧐 Motivation
GSNv2 is under development by the OpenGSN team, and it's very similar to GSNv1 regarding recipient contract implementation. We could add support for both v2 and v1 with some minor changes.
📝 Details
GSNv2 moves the responsibility of deciding whether to pay for a meta-tx (ie
acceptRelayedCall
, along withpre/post
) out of the Recipient into a Paymaster contract. The Recipient now only needs to implement the base_msgSender
and_msgData
helpers, which should use the injected address at the end of the CALLDATA (instead of msg.sender) if the call comes from a TrustedForwarder.The TrustedForwarder has the responsibilities of validating the user signature, managing its nonce, appending the signer address to the CALLDATA, and forwarding the call. As with the RelayHub in GSNv1, the Recipient should assume they are receiving a meta-tx if it's sent by the TrustedForwarder. And as with the RelayHub, the TrustedForwarder can be a singleton, since it has no app-specific logic.
This approach is described in detail in this ERC to be published. Note that
getHubAddr
was changed toisTrustedForwarder
in the Recipient internal interface.To sum up, we need to:
The text was updated successfully, but these errors were encountered: