The use of retryCount: 012 in bundler and paymaster transports in @zerodev/sdk results in increased user-facing errors.
Steps to reproduce:
- Prepare a dev machine with a network throttler (e.g., Network Conditioner.
- Set up a sample ZeroDev project.
- Open an interface where you can submit a user operation.
- Temporarily interrupt the internet connection (e.g., in Network Conditioner, set "100% Loss" condition).
- Attempt to submit the userop.
- 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).
The use of
retryCount: 012 in bundler and paymaster transports in@zerodev/sdkresults in increased user-facing errors.Steps to reproduce:
Expected: The transport should retry on network errors.
Observed: An error is thrown immediately.
Triage:
retryCount: 0in transport initialization12. The default is 3.retryCount > 0applies only to transport errors. If the request completed with an RPC error,shouldRetrywill returnfalseand the request will not be retried.Retry-Afterheader value (although the backend may need to add that header toAccess-Control-Request-Headersfor it to be readable by client).Footnotes
https://github.com/zerodevapp/sdk/blob/74a06c58ae718ce341038382fa7dd989b71a6ad4/packages/core/clients/kernelAccountClient.ts#L89-L102 ↩ ↩2
https://github.com/zerodevapp/sdk/blob/74a06c58ae718ce341038382fa7dd989b71a6ad4/packages/core/clients/paymasterClient.ts#L64-L78 ↩ ↩2