fix(indexer): complete soroban RPC circuit breaker and resolve compiler errors#173
Merged
ritik4ever merged 2 commits intoritik4ever:mainfrom Apr 25, 2026
Merged
fix(indexer): complete soroban RPC circuit breaker and resolve compiler errors#173ritik4ever merged 2 commits intoritik4ever:mainfrom
ritik4ever merged 2 commits intoritik4ever:mainfrom
Conversation
|
@aabxtract is attempting to deploy a commit to the ritik4ever's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@aabxtract 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #148
This PR completes the implementation of the Soroban RPC Circuit Breaker in the indexer service, which prevents the application from endlessly spamming failing RPC endpoints. It also resolves a series of critical TypeScript compiler errors and syntax issues left behind by an incomplete refactoring, ensuring the application successfully builds and operates as expected.
Key Changes:
Completed Circuit Breaker Logic (indexer.ts):
Added the missing circuitBreaker.onSuccess() triggers after successful RPC interactions (getLatestLedger and getEvents). The circuit breaker will now correctly transition back from HALF_OPEN to CLOSED upon a successful probe attempt.
Fixed API Endpoint Syntax & Logic (index.ts):
POST /api/streams: Restored missing user authorization validation.
POST /api/streams/:id/cancel: Fixed incomplete try-catch block and implemented the missing cancelStream() invocation.
PATCH /api/streams/:id/start-time: Completed validation logic to guarantee newStartAt dates are in the future.
Cleaned up duplicate variable definitions and imports.
TypeScript & SDK Compatibility (streamStore.ts & auth.ts):
Replaced the deprecated/missing rpc.Api.GetAccountResponse reference with the updated Account type from @stellar/stellar-sdk to fix type-checking errors.
Corrected jwt.sign() to use the proper getJwtSecret() helper.
Fixed invalid requestId properties in the sendApiError parameters.
Formatting Fixes:
Repaired a malformed 400 response object inside the OpenAPI definitions (swagger.ts).
Removed dangling brackets causing syntax errors in the test suite (index.test.ts).
Verification
Verified npx tsc --noEmit runs with 0 compilation errors.
Confirmed /api/metrics successfully exposes the indexer circuit breaker state.
Verified all streams endpoints logic is intact and validation errors format correctly.