Skip to content

feat: add configurable retry for transient rpc failures - #9

Merged
gacevicljubisa merged 3 commits into
mainfrom
retry-transient-rpc-errors
Aug 28, 2026
Merged

feat: add configurable retry for transient rpc failures#9
gacevicljubisa merged 3 commits into
mainfrom
retry-transient-rpc-errors

Conversation

@gacevicljubisa

Copy link
Copy Markdown
Member

Transient network errors (e.g. net/http: TLS handshake timeout) aborted the whole export. RPC calls now retry with a jittered exponential backoff.

  • --retry-max (default 5, 0 disables) and --retry-delay (default 1s, doubling up to 30s)
  • Retries FilterLogs, BlockNumber and ChainID; per-chunk, so no duplicate or missing logs
  • Retries transport errors, HTTP 429/5xx and JSON-RPC -32005; not other JSON-RPC errors or context cancellation
  • Unit tests for the backoff and the error classification

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread pkg/ethclientwrapper/retry.go Outdated
Comment thread pkg/ethclientwrapper/retry.go Outdated
- Retry HTTP 408, which proxies in front of an RPC endpoint return on a
  request timeout and which is as transient as 429 and 5xx.
- Report the cancellation alongside the last call error when ctx is what
  stopped the retries, so callers checking errors.Is(err, context.Canceled)
  (cmd/export.go) can still tell an aborted run from a failed one without
  losing the underlying cause.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019vJ64hEPkb1AerN7ggCfoB
@gacevicljubisa
gacevicljubisa merged commit 14adafe into main Aug 28, 2026
3 checks passed
@gacevicljubisa
gacevicljubisa deleted the retry-transient-rpc-errors branch August 28, 2026 10:45
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

Successfully merging this pull request may close these issues.

2 participants