Skip to content

Add tests, observability, and monitoring for CCTP Stellar transfers #185

@grantfox-development

Description

@grantfox-development

Overview

Ensure the CCTP integration is production-ready by adding comprehensive tests, structured logging, metrics, and alerting for cross-chain transfer operations.

Background

Cross-chain transfers involve external dependencies (Circle Attestation API, Stellar RPC) and long-running async state machines. Without proper observability, failures are hard to detect and debug.

Tasks

Testing

  • Unit tests for CCTPService (burn, attest, mint phases) with mocked dependencies
  • Integration tests hitting Stellar testnet for the full burn → mint flow
  • E2E test: org publishes a rewarded project → CCTP transfer is initiated → funds appear on Stellar

Observability

  • Add structured logs at each state transition (info for progress, error for failures)
  • Emit metrics for transfer duration, success rate, and attestation poll count
  • Add a health-check endpoint that verifies connectivity to Circle API and Stellar RPC
  • Set up alerts for transfers stuck in attesting state for > 30 minutes

Documentation

  • Add a CCTP_INTEGRATION.md runbook under docs/ covering testnet setup, env vars, and common failure modes

Acceptance Criteria

  • Test coverage for CCTP module ≥ 80%
  • All state transitions produce a structured log line with transferId and state
  • Health check returns degraded status when Circle API is unreachable
  • Runbook reviewed and merged

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions