Skip to content

Conversation

@jkao97
Copy link

@jkao97 jkao97 commented Feb 3, 2026

Summary

  • Adds BackupEndpoint struct for configuring backup gRPC endpoints with optional auth tokens
  • Backup endpoints inherit the primary auth token if not specified
  • Automatic failover during initial connection and reconnection attempts
  • Preserves last_fetched_version across endpoint switches for data continuity

Usage

transaction_stream_config:
  indexer_grpc_data_service_address: "https://primary.aptoslabs.com:443"
  auth_token: "primary_token"
  request_name_header: "my-processor"

  backup_endpoints:
    - address: "https://backup1.aptoslabs.com:443"
      # Uses primary auth_token
    - address: "https://backup2.example.com:443"
      auth_token: "different_token"  # Different provider

Test plan

  • Unit tests for config endpoint helpers (test_config_endpoint_helpers)
  • Test failover to backup endpoint (test_failover_to_backup_endpoint)
  • Test all endpoints exhausted error (test_all_endpoints_exhausted)
  • Test backward compatibility with no backup endpoints (test_backward_compatibility_no_backup_endpoints)
  • Existing timeout test still passes

🤖 Generated with Claude Code

Adds support for configuring backup gRPC endpoints that the SDK will
automatically fall back to when the primary endpoint fails after
exhausting retry attempts.

Key changes:
- Add BackupEndpoint struct for configuring backup endpoints with
  optional auth tokens (inherits primary token if not specified)
- Add backup_endpoints field to TransactionStreamConfig
- Implement endpoint cycling in TransactionStream::new() for initial
  connection and reconnect_to_grpc_with_retries() for reconnections
- Preserve last_fetched_version across endpoint switches for data
  continuity
- Add failover tests

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@jkao97 jkao97 requested a review from a team as a code owner February 3, 2026 00:19
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.

2 participants