Repository navigation
fix(web): SDK wasm loads separately with progress; quorum refresh; recover from Platform outages (D-025, D-024, D-058) - #80
Merged
Conversation
…er from outages D-025: build evo-sdk from its unbundled modules and fetch wasm_sdk_bg.wasm as its own asset with progress, compileStreaming, a stall abort and retry; the SDK JS chunk drops from 8.2 MB to 63 kB gzipped and no longer hits webpack's chunk timeout on Slow 3G. D-024/D-702: the SDK service swaps whole connections behind a stable handle, refreshing every 5 min while visible and reconnecting once when a read fails on a rotated quorum or no usable node. D-058: a failed connect retries with backoff, shows a plain-language banner with Try again, and keeps already-read repo content on screen without marking it re-checked. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedNext included review available in 23 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (20)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PastaPastaPasta
added a commit
that referenced
this pull request
Sep 27, 2026
Adopts master's WriteEngine::replace_document (from #66) and drops F-1's duplicate; update_target/update_comment call it. Issue pages honour the archive gate. The CLI issue-parity scenario is renumbered 20 (18 is repo settings). e2e helpers use master's E2E_IDENTITY_DIR. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Sep 27, 2026
PastaPastaPasta
added a commit
that referenced
this pull request
Sep 27, 2026
The SDK service no longer strands itself when a mount adds contract ids (network epoch instead of config identity), live tests connect in Node again, a refresh keeps the learned protocol version, reads share one recovery including its rate-limit wait, a connection is never swapped under a write, every connection revalidates its seeded snapshots, and superseded or timed-out connects are aborted and freed. The UI degrades trust while Platform is unreachable, falls back to cached content only on unreachable errors, re-runs the quorum check hourly instead of per reconnect, stops re-announcing the outage countdown, and fills the download bar at 3:1. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta
added a commit
that referenced
this pull request
Sep 27, 2026
The SDK service no longer strands itself when a mount adds contract ids (network epoch instead of config identity), live tests connect in Node again, a refresh keeps the learned protocol version, reads share one recovery including its rate-limit wait, a connection is never swapped under a write, every connection revalidates its seeded snapshots, and superseded or timed-out connects are aborted and freed. The UI degrades trust while Platform is unreachable, falls back to cached content only on unreachable errors, re-runs the quorum check hourly instead of per reconnect, stops re-announcing the outage countdown, and fills the download bar at 3:1. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta
added a commit
that referenced
this pull request
Sep 27, 2026
…llowup fix(web): network-resilience follow-ups from the #80 post-merge reviews
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.
Summary
This PR fixes D-025, D-024 and D-058, and adds a regression guard for D-702, in forge-web's Platform connection (
lib/sdk/service.ts, fix/web-network-resilience).D-025: the SDK download no longer dies on Slow 3G
The published
@dashevo/evo-sdkentry is one 11.4 MB JS file with the 23 MB wasm inlined as base64 gzip. On 400 kbps, webpack's chunk-load timeout killed it at ~130 s, with no progress and no retry.next.config.jsbuilds the SDK from its own unbundled modules (dist/sdk.js). ANormalModuleReplacementPluginswaps its wasm loader (dist/wasm.js, which imports the inlined build) forlib/sdk/wasm-shim.ts. The shim re-exports@dashevo/wasm-sdk/raw(the plain wasm-bindgen glue, now a direct dependency, same pinned 4.2.0-beta.4) and initializes it from a module compiled bylib/sdk/wasm-fetch.ts.wasm_sdk_bg.wasmis now its own content-hashed static asset (_next/static/wasm/…). It is fetched withfetch+WebAssembly.compileStreaming, so there is no chunk timeout. Progress is counted per chunk. A download that receives nothing for 60 s is abandoned, and a failed download is forgotten, so the next attempt fetches it again.output.chunkLoadTimeoutgoes from 120 s to 10 min.components/ui/platform-status.tsx). The wasm fetch starts next to the JS chunk rather than after it.e2e/static-server.mjsnow gzips like GitHub Pages does, so throttled runs move real bytes. It already served.wasmasapplication/wasm.Checked:
script-src 'wasm-unsafe-eval'allowscompileStreaming.NEXT_PUBLIC_BASE_PATH=/dash-forgebuild loads the wasm from/dash-forge/_next/static/wasm/….@dashevo/evo-sdkto the bundled module; the alias is webpack-only.D-024: stale quorum keys (~10 min) and D-702: recovery after an outage
I verified this against the pinned Platform source.
packages/wasm-sdk/src/context_provider.rsbuilds itsTrustedHttpContextProviderwith.with_refetch_if_not_found(false)and prefetches quorums only at connect.refresh_quorumsispub(crate)and runs only before a broadcast (state_transitions/broadcast.rs). From JS, the only refresh is a new connection.EvoSdkServicenow treats connections as generations behind one stable handle:getSdk()returns a Proxy that forwards every call to the connection that is current when the call is made. A call already running finishes on its own connection.lib/sdk/write.tskeeps working across a swap, and writes and broadcasts are never re-sent.dapiBudget.retryAfterMs().banFailedAddress: false, contract seeding and revalidation, the stale-contract handler,followSdkVersion) are unchanged and now apply to each connection.D-058: quorum service unreachable at connect
Measurements: Slow 3G (400 kbps, 400 ms, cache off, gzip like GitHub Pages, moutai)
At 1.6 Mbps: first repo content 50.7 s before, 48.5 s after (progress shows at 4.5 s).
Tests
lib/sdk/service.test.ts(12 tests, fake clock and connector):lib/sdk/wasm-fetch.test.ts: progress per chunk; application/wasm; HTTP error; a slow but live download is never cut off; a stalled download aborts.e2e/network-resilience.spec.ts(live moutai):Before and after runs of the new e2e spec, same spec against both builds:
banFailedAddress: falsealready fixed it; kept as a regression guard)pnpm typecheck,pnpm lintandpnpm test(1,556 tests) pass. Rebased on #79: its s2 (the library cannot download) now also routes the separate wasm file, and passes.Notes
🤖 Generated with Claude Code