Skip to content

Commit

Permalink
fix: tune transport on optimistic
Browse files Browse the repository at this point in the history
  • Loading branch information
doomsower committed Jul 19, 2024
1 parent ac31777 commit 1cdad5d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/services/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ export default class Client {
public async launch(): Promise<void> {
const { ethProviderRpcs, chainId, network, optimistic, privateKey } =
this.config;
const rpcs = ethProviderRpcs.map(url => http(url, { timeout: 120_000 }));
const rpcs = ethProviderRpcs.map(url =>
http(url, {
timeout: optimistic ? 240_000 : 10_000,
retryCount: optimistic ? 3 : undefined,
}),
);
const transport = rpcs.length > 1 && !optimistic ? fallback(rpcs) : rpcs[0];
const chain = defineChain({
...CHAINS[network],
Expand Down

0 comments on commit 1cdad5d

Please sign in to comment.