Repository navigation
fix(web): seed the SDK at the deployment's protocol version before it connects - #744
Merged
Merged
Conversation
… connects A new wasm-sdk starts at its built-in floor (13 on rc.8) unless its localStorage store holds a learned version. On a link slower than the warm-up's 5 s wait, nothing taught it 14 before the first query, so Trending's timeRange query was refused client-side with "this network runs protocol version 13". The bundled contract snapshots prove the network runs their version, so raise wasm-sdk's own store (dash-sdk.protocol-version.<network>) to it before the SDK is built. Auto-detect stays on; a higher stored version is kept and nothing is ever lowered. Fixes #682 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 56 minutes. View limit details
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. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
PastaPastaPasta
added a commit
that referenced
this pull request
Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes #682.
Problem
On a slow link, a first visit to
/explore/on testnet shows under Trending this week:A new wasm-sdk (rc.8) starts at its built-in floor, 13, unless its own localStorage store (
dash-sdk.protocol-version.<network>,protocol_version_store.rs) holds a learned version. The warm-up'slearnVersionread gets 5 s to teach it 14; on a link slower than that, the first page query is built at 13 and the SDK refuses thetimeRangequery before sending it. Mainnet's snapshots are at 14 too, so a slow first visit there can hit the same thing.Fix
The bundled contract snapshots prove the network runs their
platformVersion(deploy-v2 registers only on a network at it). Before the SDK is built,seedSdkVersionraises wasm-sdk's store to that version. wasm-sdk then seeds the new SDK withwith_initial_version, and auto-detect stays on. A stored version at or above it is kept.learnVersionstays as the fallback when storage is blocked.Evidence
Live testnet, build 203aa36, fresh browser profile, every cross-origin request delayed 6 s (Playwright):
14before the page's scripts run (what this change writes): Trending loads and shows its normal empty state, "No repo has 5 new stars in the last week."Tests
lib/sdk/service-addresses.test.ts: on testnet and mainnet, the SDK is constructed with14already in its store. A missing, lower or garbage value is raised, a higher one is never lowered, devnet is untouched, and blocked storage doesn't throw.vitestservice tests pass (77) andtscis clean.Migration / compat check
🤖 Generated with Claude Code