Skip to content

Anchoring worker (Vercel Cron): retry with backoff + FINAL escalation #8

Description

@trietlu

Description

Implement a Vercel Cron worker (decision D3) that claims PENDING/FAILED_RETRYABLE events and (re)submits via anchorProof, with: exponential backoff, an attempt cap -> FAILED_FINAL, retryable-vs-final classification (network/nonce/underpriced = retryable; revert/unauthorized = final), and idempotency (never double-submit one event).

Affected areas

backend/src/services/onchain.service.ts, a new cron route under backend/api/, backend/vercel.json (cron schedule).

Dependencies / order

Depends on #7.

Acceptance criteria

  • A simulated transient failure is retried and eventually reaches ANCHORED.
  • Exceeding the attempt cap sets FAILED_FINAL with anchorError populated.
  • No event produces two on-chain ProofAnchored records.
  • The Vercel Cron schedule is configured in vercel.json and documented.

Definition of done

  • Implemented on a short-lived feature branch, merged into staging (never main).
  • Verified on the staging preview stack.
  • Docs updated if infra/env/API behavior changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyScoped and specified for autonomous agent implementationblockchainOn-chain anchoring / smart-contract work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions