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

retryCount: 0 increases user-facing errors #180

Open
freeatnet opened this issue Aug 26, 2024 · 0 comments
Open

retryCount: 0 increases user-facing errors #180

freeatnet opened this issue Aug 26, 2024 · 0 comments

Comments

@freeatnet
Copy link

freeatnet commented Aug 26, 2024

The use of retryCount: 012 in bundler and paymaster transports in @zerodev/sdk results in increased user-facing errors.

Steps to reproduce:

  1. Prepare a dev machine with a network throttler (e.g., Network Conditioner.
  2. Set up a sample ZeroDev project.
  3. Open an interface where you can submit a user operation.
  4. Temporarily interrupt the internet connection (e.g., in Network Conditioner, set "100% Loss" condition).
  5. Attempt to submit the userop.
  6. Immediately after, resume internet connectivity.

Expected: The transport should retry on network errors.
Observed: An error is thrown immediately.

Triage:

  • The cause of the issue is the retryCount: 0 in transport initialization12. The default is 3.
  • retryCount > 0 applies only to transport errors. If the request completed with an RPC error, shouldRetry will return false and the request will not be retried.
  • Further, viem will obey a numeric Retry-After header value (although the backend may need to add that header to Access-Control-Request-Headers for it to be readable by client).

Footnotes

  1. https://github.com/zerodevapp/sdk/blob/74a06c58ae718ce341038382fa7dd989b71a6ad4/packages/core/clients/kernelAccountClient.ts#L89-L102 2

  2. https://github.com/zerodevapp/sdk/blob/74a06c58ae718ce341038382fa7dd989b71a6ad4/packages/core/clients/paymasterClient.ts#L64-L78 2

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