Skip to content

core: retry/sleep boilerplate duplicated across deploy, post-deploy and upgrade #147

Description

@Dione-b

Summary

Retry/sleep boilerplate is copy-pasted across the contract operation layer:

  • sleep reimplemented in artifacts/artifacts-lock.ts:7-11, contracts/deploy-contract.ts:51-55, contracts/run-post-deploy.ts:42-46, contracts/upgrade-contract.ts:52-56
  • The full retry loop with retryDelaysMs/maxAttempts/onTransientRetry is duplicated in deploy-contract.ts:~160-210, run-post-deploy.ts:~190-235, and upgrade-contract.ts:~120-165

Why it matters

Retry semantics (delay fallback, callback handling, last-attempt behavior) are defined three times and have already diverged (see the unguarded-callback inconsistency in #M6).

Suggested fix

Extract a small withRetries({ attempts, delays, isRetryable, onRetry, fn }) helper, keep per-call retryDelaysMs overrides, and reuse it in all three loops plus the artifacts lock wait.

Priority: Medium | Release impact: Patch | Breaking: No

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programarea: contractsDeploy, upgrade, invoke, contract logicenhancementNew feature or requestpriority: mediumMedium priority fix - correctness or UX issues

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions