fix Sui fund account with retry - #2799
Conversation
|
👋 FelixFan1992, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
📊 API Diff Results
|
There was a problem hiding this comment.
🟡 Changes recommended
The new retry classifier treats context.DeadlineExceeded as non-retryable, which can block retries on per-attempt timeouts and undermine the PR’s core goal.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR improves reliability of Sui account funding during container startup by adding bounded retries around the faucet /gas call, reducing flakiness caused by the faucet HTTP handler not being ready immediately after the port starts listening.
Changes:
- Add bounded retry/backoff logic with per-request and overall timeouts for Sui faucet funding.
- Introduce structured error classification (
faucetStatusError+isRetryableFaucetErr) to decide which failures should be retried. - Thread caller context into
fundAccountfromnewSuiso funding respects upstream cancellation.
File summaries
| File | Description |
|---|---|
| framework/components/blockchain/sui.go | Adds retry + timeout behavior for Sui faucet funding and updates the call site to pass context. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // A cancelled/deadline-exceeded context means the caller (or the total budget) has | ||
| // given up; never retry, just propagate. | ||
| if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { | ||
| return false | ||
| } |
| // isRetryableFaucetErr classifies faucet /gas errors. Transient failures (faucet still | ||
| // warming up, brief network blips, rate limiting, 5xx) are retried; failures that retrying | ||
| // cannot fix (a malformed request, an already-cancelled context, 4xx other than 429) stop | ||
| // immediately so they don't burn the retry budget and prolong startup/teardown. | ||
| func isRetryableFaucetErr(err error) bool { |
No description provided.