Skip to content

fix(walletapi): configurable RPC call timeout + connectivity hardening - #78

Open
DHEBP wants to merge 5 commits into
DEROFDN:community-devfrom
DHEBP:fix/rpc-timeout-community-dev
Open

fix(walletapi): configurable RPC call timeout + connectivity hardening#78
DHEBP wants to merge 5 commits into
DEROFDN:community-devfrom
DHEBP:fix/rpc-timeout-community-dev

Conversation

@DHEBP

@DHEBP DHEBP commented Aug 20, 2026

Copy link
Copy Markdown

Summary

Reconciles moralpriest's RPC connectivity hardening (DHEBP/derohe#22) onto community-dev. Adds a configurable timeout to daemon RPC calls (Client.Call currently has none — calls can hang indefinitely on a half-open connection), plus native sync status/progress tracking and a wasm build fix.

Also fixes GetTransfers aborting its whole response when a best-effort background token refresh fails — now logs and falls back to cached data instead.

Included prerequisite: PR21

Builds on #21 (4aecb1a, the 10s RPC timeout), merged to experimental in July but never to community-dev — confirmed not an ancestor, code never appears there under any hash, no commits from the author touching this file. Riding along inside this PR rather than opening separately first.

Limitation: 10s timeout is hardcoded

SetRPCCallTimeout() has zero call sites — every daemon RPC, including XSWD dApp calls, is capped at 10s with no override. Not measured against a slow/degraded daemon; reasoned risk. Open to a configurable override landing alongside or as a fast-follow.

Limitation: wallet close doesn't wait on in-flight sync

Abrupt close can leave stale/dropped transfer-history entries, self-healing on next sync — no fund-safety or corruption risk. Left as-is to avoid reintroducing an uncancellable-close hang.

Scope note

Original PR22 also restored a per-SCID refresh loop needed only by a downstream fork (HOLOGRAM). community-dev already has an equivalent loop since 2022, so that part is dropped as redundant here.

Verification

  • go build ./... clean, go test ./walletapi passes
  • No files under blockchain/, p2p/, cryptography/, dvm/, block/, transaction/, or config/ consensus constants
  • 14 files changed, all walletapi/, no unrelated carry-over

moralpriest and others added 5 commits August 19, 2026 20:03
- move connectionMu to shared daemon_communication.go (was only defined
  in the !wasm build, breaking GOOS=js builds of the shared loop file)
- make invalidateRPCClient platform-specific so the websocket close call
  matches the connector API (gorilla: Close(); coder/websocket: Close(status, reason))
…ort sync failure

A failed background token refresh (SyncHistoryAsync) was aborting the
whole RPC response instead of falling through to already-cached data,
turning a transient/best-effort refresh into a hard failure for callers.
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.

2 participants