Skip to content
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

RelayProvider default filter using only active relay servers with status ready #1007

Open
cadu0xcarbon opened this issue Nov 16, 2023 · 0 comments

Comments

@cadu0xcarbon
Copy link

Is your feature request related to a problem? Please describe.
When using RelayProvider and not providing a list of preferredRelays in the config property, it looks up for any active relay server and selects one of them to be used. The problem is its selecting relay servers that are not actually running, i.e. with status Ready, and if that is the case the RelayProvider will end up returning an error.

Describe the solution you'd like
Add a default filter to the RelayProvider to retrieve only active relay servers with status Ready. This way some errors related to selecting an "invalid" relay server will be resolved.

Describe alternatives you've considered
Add a new property to the config object that activates this filter, like useOnlyActiveRelayServers: boolean.

Additional context
Example:

Using "@opengsn/provider": "3.0.0-beta.10",

When calling newWeb3Provider from RelayProvider, using polygon mainnet at the moment of testing, theres only one available active relay server with status Ready, meaning its the only one that should work, and instead from the logs I can see that it tried to use other relay servers, ending up in error.

Code snippet:

import { RelayProvider } from '@opengsn/provider';

const gsnProvider = await RelayProvider.newWeb3Provider({
    provider,
    config: {
      performDryRunViewRelayCall: false,
      loggerConfiguration: { logLevel: 'debug' },
      paymasterAddress,
    },
  }).catch((err: any) => {
    throw new Error(err);
  });

Current active relay servers from Polygon mainnet (https://relays.opengsn.org/):
Screenshot from 2023-11-16 13-00-56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant