WS fixes + improvements - #1626
Merged
Merged
Conversation
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.
Reasoning
Custom WebSocket subscriptions queried Elastic three times per round — once per gateway — even though the transactions query hits the same
operationsindex as the transfers one, so the same data was fetched and enriched twice on the latency-critical path.Proposed Changes
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.canBeIgnoredoperations from custom transfers, via a new internalwithCanBeIgnoredFlagquery option so the flag survives entity mapping intoTransaction.roundsindex instead of going throughRoundService(which also ran agetCurrentEpochquery first), and dropRoundModulefrom the subscription module.getStatsin 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.pushStatscallsgetStats(true)to bypass the cache.broadcastIntervalMs1000 → 600 on devnet and testnet.How to test