Skip to content

WS fixes + improvements - #1626

Merged
stefangutica merged 6 commits into
websocket-subscriptions-improvementsfrom
ws-fixes
Aug 28, 2026
Merged

WS fixes + improvements#1626
stefangutica merged 6 commits into
websocket-subscriptions-improvementsfrom
ws-fixes

Conversation

@stefangutica

@stefangutica stefangutica commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Reasoning

Custom WebSocket subscriptions queried Elastic three times per round — once per gateway — even though the transactions query hits the same operations index as the transfers one, so the same data was fetched and enriched twice on the latency-critical path.

Proposed Changes

  • Add CustomSubscriptionsDataFetcher: fetches a round's data once and derives the transactions payload from the transfers result. The three custom gateways no longer query Elastic — they receive the data and only match rooms and emit, so their push methods are now synchronous.
  • Drop canBeIgnored operations from custom transfers, via a new internal withCanBeIgnoredFlag query option so the flag survives entity mapping into Transaction.
  • Read the latest round timestamp straight from the rounds index instead of going through RoundService (which also ran a getCurrentEpoch query first), and drop RoundModule from the subscription module.
  • Start getStats in parallel with the round lookup, and persist the round cursor inside the loop so a polling timeout no longer re-broadcasts rounds that were already sent.
  • NetworkGateway.pushStats calls getStats(true) to bypass the cache.
  • broadcastIntervalMs 1000 → 600 on devnet and testnet.

How to test

  • Subscribe to custom transactions/transfers/events and confirm the same messages arrive as before, with refunds no longer delivered on the transfers channel.
  • Check the Elastic query count per round drops from three to two.

@stefangutica
stefangutica merged commit bd74011 into websocket-subscriptions-improvements Aug 28, 2026
@stefangutica
stefangutica deleted the ws-fixes branch August 28, 2026 12:54
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.

1 participant