Skip to content

feat: implement RPC failover, log separation, and connection pool lea…#317

Open
SharifIbrahimDev wants to merge 1 commit into
StellarFlow-Network:mainfrom
SharifIbrahimDev:main
Open

feat: implement RPC failover, log separation, and connection pool lea…#317
SharifIbrahimDev wants to merge 1 commit into
StellarFlow-Network:mainfrom
SharifIbrahimDev:main

Conversation

@SharifIbrahimDev
Copy link
Copy Markdown

This Pull Request bundles several backend reliability and stability improvements to prepare the oracle for robust Testnet operations. It addresses issues related to RPC failover, log pollution, and database connection pool leaks.

Closes

Changes Included

  1. Robust Horizon/RPC Failover Cluster (🛡️ Testnet | Robust Horizon/Rpc Failover Cluster #278)

    • Implemented an array of fallback RPC endpoints (e.g., official Stellar Foundation nodes, BlockDaemon, and validation partner nodes).
    • Built a connection manager that automatically rotates to the next healthy node upon hitting a 5xx error or connection timeout, eliminating single points of failure.
  2. Network Boundary Logging Separation (📂 Testnet | Network Boundary Logging Separation #286)

    • Configured Winston logger to split outputs into separate dedicated files via custom filters.
    • system-%DATE%.log handles internal engine behaviors.
    • stellar-network-%DATE%.log exclusively tracks XDR envelopes, hashes, and network error codes for easier auditing during integration phases.
  3. Database Connection Pool Leak Protection (🚿 QA | Database Connection Pool Leak Protection #291)

    • Audited the underlying PostgreSQL pool (pg.Pool) used by the Prisma adapter.
    • Enforced explicit connection limits (max: 20) to prevent crashing the backend under sustained traffic.
    • Configured idle timeout settings (idleTimeoutMillis: 10000) so inactive connections are properly released back into the pool.
    • Verified that the backend correctly interfaces exclusively through Prisma's built-in connection management, preventing unreleased raw pg.Client instances.

Verification

  • RPC failover triggers correctly on simulated node failures.
  • Log separation routes outputs precisely to system.log and stellar-network.log based on the specified log metadata properties (isNetworkLog: true).
  • Pool connection limits are correctly enforced in the pg.Pool instantiation inside prisma.ts.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@SharifIbrahimDev 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant