How to configure relay worker to only charge request not from our own services?

Hi GSN team,
Is there any way to configure relay worker to only charge request which is not from our own services?


I am trying to implement this feature according to the gsn architecture graph.

Thanks in advance!

TL;DR: there is a missing piece (in the client) for truly “no-fee” transactions…

Still, since it has to be your own relayer and paymaster, you’re only moving eth between them…

The client signs a complete request, which includes the fees paid to the relayer.
So it is the CLIENT that needs to create a request with zero (or lower) fees.
The server verifies the request before it sends it on-chain: it will generally verify the fees are as were advertised unless the paymaster in the request is trusted (in which case, it assumes that the paymaster will verify them)

The client has to be configured so that only with that specific relayer it will attempt to send request without fee.

  • the relayer has to be configured with "trustedPaymasters"=[ ...] containing your paymaster (the relayer supports other paymasters, but it will validate its fess for those other paymasters)
  • the client has to be configured with preferredRelayers=[...] to prefer this relayer (it will try those first, and use other relayers only if the preferred are unavailable
  • Client has to be configured with lower/zero fee for preferred relayers this item is currently not implemented. I will add it to our work queue.