Skip to content

feat(stellar): add StellarOptimizationService with pooling, batching, and retry#268

Merged
LaGodxy merged 1 commit intoMettaChain:mainfrom
yusuftomilola:feat/stellar-network-optimization-244
Mar 29, 2026
Merged

feat(stellar): add StellarOptimizationService with pooling, batching, and retry#268
LaGodxy merged 1 commit intoMettaChain:mainfrom
yusuftomilola:feat/stellar-network-optimization-244

Conversation

@yusuftomilola
Copy link
Copy Markdown
Contributor

Summary

  • Add src/blockchain/stellar/stellar-optimization.service.tsStellarOptimizationService
  • Connection pool (size=5) with acquireConnection / releaseConnection and automatic replacement of connections that exceed the error threshold
  • Transaction queue with priority ordering (high > normal > low) and timed flushBatch every 2 s (up to 10 transactions per flush)
  • submitWithRetry with configurable exponential back-off (default: 4 attempts, 500 ms initial delay, 2× multiplier)
  • Network health monitor polling mainnet and testnet every 30 s with automatic failover to testnet when mainnet is unreachable and recovery when mainnet comes back
  • getPoolStats and getNetworkHealth for observability

closes #244

… and retry (MettaChain#244)

Implement StellarOptimizationService providing:
- Connection pool (size=5) with acquireConnection / releaseConnection and
  automatic replacement of connections exceeding the error threshold
- Transaction queue with priority ordering (high > normal > low) and
  timed flushBatch flushing every 2 s (up to 10 txs per flush)
- submitWithRetry with configurable exponential back-off (default 4 attempts)
- Network health monitoring for both mainnet and testnet horizons on a
  30 s interval with automatic failover to testnet when mainnet is down
- getPoolStats and getNetworkHealth for observability
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Mar 29, 2026

@yusuftomilola Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@LaGodxy LaGodxy merged commit ab8acc8 into MettaChain:main Mar 29, 2026
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.

[Backend] Stellar Network Integration Optimization

2 participants