Skip to content

Commit

Permalink
perf: replace retry with speed provider
Browse files Browse the repository at this point in the history
  • Loading branch information
dohaki committed Sep 6, 2024
1 parent 8f6b676 commit f9c0790
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions api/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,15 +728,13 @@ function getProviderFromConfigJson(_chainId: string) {
return undefined;
}

return new sdk.providers.RetryProvider(
return new sdk.providers.SpeedProvider(
urls.map((url) => [{ url, errorPassThrough: true }, chainId]),
chainId,
1, // quorum can be 1 in the context of the API
3, // retries
0.5, // delay
5, // max. concurrency
3, // max. concurrency used in `SpeedProvider`
5, // max. concurrency used in `RateLimitedProvider`
"RPC_PROVIDER", // cache namespace
0 // disable RPC calls logging
1 // disable RPC calls logging
);
}

Expand Down

0 comments on commit f9c0790

Please sign in to comment.