Skip to content

feat(backend): add getLatestLedgerSequence & getNetworkEvents to Soro… - #798

Merged
aji70 merged 1 commit into
MyFanss:mainfrom
Mimah97:feat/soroban-rpc-ledger-events
Apr 23, 2026
Merged

feat(backend): add getLatestLedgerSequence & getNetworkEvents to Soro…#798
aji70 merged 1 commit into
MyFanss:mainfrom
Mimah97:feat/soroban-rpc-ledger-events

Conversation

@Mimah97

@Mimah97 Mimah97 commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes

  • SorobanRpcService – adds getLatestLedgerSequence() and getNetworkEvents() with typed return shapes. Both throw on RPC failure so callers control recovery.
  • FeatureFlagsService – adds isSorobanPollerEnabled() (opt-out: enabled by default, set FEATURE_SOROBAN_POLLER=false to disable).
  • SubscriptionEventPollerService – replaces (this.sorobanRpc as any) casts with typed calls; skips poll when flag is off; handles stale/disconnected RPC gracefully (warn + return, no throw).
  • SubscriptionsModule – imports FeatureFlagsModule.
  • backend/.env.example – documents FEATURE_SOROBAN_POLLER=true.

Tests added

  • soroban-rpc-ledger-events.spec.ts (9 cases)
  • subscription-event-poller-ledger.spec.ts (5 cases)

Acceptance criteria

…banRpcService; guard poller behind feature flag

- SorobanRpcService: implement getLatestLedgerSequence (via rpc.Server.getHealth)
  and getNetworkEvents (via rpc.Server.getEvents) with typed return shapes
- Both methods throw on RPC failure so callers can decide recovery strategy
- SubscriptionEventPollerService: replace any-cast calls with typed methods;
  inject FeatureFlagsService and skip poll cycle when isSorobanPollerEnabled=false;
  handle stale/disconnected RPC gracefully (warn + return, no throw)
- FeatureFlagsService: add isSorobanPollerEnabled (opt-out via FEATURE_SOROBAN_POLLER=false)
- SubscriptionsModule: import FeatureFlagsModule
- Tests: soroban-rpc-ledger-events.spec.ts (9 cases) and
  subscription-event-poller-ledger.spec.ts (5 cases)
- .env.example: document FEATURE_SOROBAN_POLLER
@drips-wave

drips-wave Bot commented Apr 23, 2026

Copy link
Copy Markdown

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

@aji70
aji70 merged commit ed9c7e3 into MyFanss:main Apr 23, 2026
2 of 9 checks passed
aji70 added a commit that referenced this pull request Apr 30, 2026
feat(backend): add getLatestLedgerSequence & getNetworkEvents to Soro…
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.

Implement missing SorobanRpcService methods or narrow poller interface

3 participants