Skip to content

v2.0.3

Compare
Choose a tag to compare
@drortirosh drortirosh released this 05 Dec 09:31
· 293 commits to master since this release
09e46a2

This a new client library release.

Client Changes

  • Added a simpler way to initialize the provider:

    gsnProvider = await RelayProvider( provider,  { paymasterAddres: ..., }  ).init()
    
  • This is actually 2 changes:

    • No longer need to provide full configuration (e.g. using resolveConfigurationGSN()/configureGSN()) before passing the configuration to the provider.
    • added explicit async init() function (which resolves any missing configuration parameters).
      This init method is called automatically by first "send()" operation - But it is much better to call it explicitly, even if in the background, so that the first transaction will execute faster.
    • The "old" way of using the RelayProvider still works, it is just less efficient (requires async call before creating the provider, and still defers some of the initialization to the first call of "send()"
  • added loggerUrl configuration param, to allow centralized logger for troubleshooting.

  • the logLevel parameter now receives textual values "error/warning/info/debug" and not numeric.
    the default is still "error" (used to be 5), which means only errors are logged.

  • auditorsCount : a mechanism for the client to verify its server's response: the client select other relayer(s) to verify the relayer didn't try to "cheat". The default is "1". set this parameter to zero (e.g. on testnets) to prevent sending the request through another relayer.

  • added registerEventListener(), to let the client receive events on the progress of the GSN event handling.

  • Better error handling of failed requests.

Relay modifications:

  • gasPriceOracle - relayer can use an external gas-price oracle, instead of relying on the Node's getGasPrice(). See #526
  • support loggerUrl (like the client) to redirect logs to a centralized logger, for trouble-shooting.
  • Several security enhancements:
    • Paymaster reputation mechanism
    • Improved boosting mechanism (after gas-price fluctuations):

Contracts

There are no contract changes. the new client and relayers are fully compatible with the deployed contacts (and previous relayers/clients)