Skip to content

perf(walletapi): reduce sync polling interval from 5s to 3s#28

Open
moralpriest wants to merge 1 commit into
DEROFDN:community-devfrom
moralpriest:perf/walletapi-reduce-polling-interval
Open

perf(walletapi): reduce sync polling interval from 5s to 3s#28
moralpriest wants to merge 1 commit into
DEROFDN:community-devfrom
moralpriest:perf/walletapi-reduce-polling-interval

Conversation

@moralpriest

Copy link
Copy Markdown

Reduce the timeout variable from 5s to 3s. This variable controls the sync loop sleep between iterations and the Keep_Connectivity ping interval.

Problem

With DERO block time of 18s, a 5s sleep means ~3 polls per block. This can cause the wallet to miss new blocks or appear stale on fast connections.

Changes

  • Change var timeout = 5 * time.Second to var timeout = 3 * time.Second

Notes

  • 3s gives ~6 polls per block, improving responsiveness
  • All RPC calls complete in <1s, so the extra 2s overhead is negligible
  • Keep_Connectivity also benefits from faster liveness checks
  • Consistent with the polling cadence used by Engram mobile wallet

The sync loop sleep between iterations was 5s, but each iteration also
blocks on RPC calls. With DERO block time of 18s, a 5s sleep results in
~3 polls per block. Reducing to 3s gives ~6 polls per block, improving
responsiveness without adding significant load since RPC calls are
sub-second.

The timeout variable is shared with Keep_Connectivity, which also
benefits from faster liveness checks.
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