Skip to content

retryCount: 0 increases user-facing errors #180

@freeatnet

Description

@freeatnet

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions