Skip to content

feat(verification): build blockchain verification status API and retry service (#221) - #227

Closed
jeffrey-graham wants to merge 1 commit into
SudiptaPaul-31:mainfrom
jeffrey-graham:feat/blockchain-verification-status-api-221
Closed

jeffrey-graham wants to merge 1 commit into
SudiptaPaul-31:mainfrom
jeffrey-graham:feat/blockchain-verification-status-api-221

Conversation

@jeffrey-graham

Copy link
Copy Markdown

Summary

Builds the authoritative blockchain verification status service and Next.js API endpoints for Stellar-linked snippets.

Key Changes

  • lib/blockchain-verification-service.ts:
    • Supports all 5 verification lifecycle states (pending, confirmed, failed, unverifiable, retry_scheduled).
    • Validates Stellar transaction existence, on-chain outcome (successful), ledger confirmation, network matching, and expected operation/memo matching.
    • Prevents duplicate verification records across repeated and concurrent requests via in-flight coalescing and composite key indexing.
    • Implements recoverable retry scheduling for Horizon timeouts, RPC errors, and network outages with retry exhaustion handling (RETRY_EXHAUSTED).
    • Enforces read/write authorization for private/shared snippets and strips internal ownership fields from public verification responses.
    • Records immutable audit trail entries for all verification attempts, retries, and state transitions.
  • API Endpoints:
    • GET /api/snippets/[id]/verification-status
    • POST /api/snippets/[id]/verify
    • GET /api/verifications/[verificationId]
    • POST /api/verifications/[verificationId]/retry
  • Tests (lib/__tests__/blockchain-verification-service.test.ts):
    • 16 unit and route handler tests covering all lifecycle states, network errors, retry exhaustion, authorization, audit logging, and idempotency.

Closes #221

@vercel

vercel Bot commented Nov 10, 2026

Copy link
Copy Markdown

@jeffrey-graham is attempting to deploy a commit to the Sudipta 's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Build Blockchain Verification Status API

1 participant