Repository navigation
fix(web): a paid identity create whose proof cannot be verified checks what landed (L-06, L-20) - #100
Merged
Merged
Conversation
…at landed (L-06) wasm-sdk identityCreate verifies its result against the connection's quorum keys without refreshing them, so a quorum rotation reported 'Failed to create identity: Quorum not found in cache' for an identity Platform had created. The connection is renewed before the create; after an unverifiable answer the flow reads the identity (bounded retry) and finishes if it is there, and otherwise checks the spent-asset-lock tree and offers 'Try again with the same deposit' (no second payment). L-20: step timing (User Timing measures, console with forge.debug=timing) for the sign-in steps and the enable-private-repos sub-steps. vault.ts is not touched. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Apply the simplifier review: a shared balance read, private probe constants, one freshen call, the same-deposit label cleared before the words check, the private-repos timing flow named once, and tighter tests. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Renew the browser key after a landed-but-unverified create only when key 5 is provably not ours; describe a partly used lock (fee kept, what remains, whether a retry can succeed); call 'not created' a snapshot; probe longer after transport errors; abort check before the broadcast; classify only a single item element; a failed existence read is not 'no identity'; one step clock per sign-in run; the live spec intercepts from the start and records stages with a MutationObserver. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…inal state When the identity already exists, the key the earlier run stored (held in the sheet's memory) is checked and kept instead of paying for a renewal; a key check that fails after a landed create is a named error that 'Try again' checks again. 'No available addresses' gets the long probe. A lock with too little left offers 'Discard this creation' instead of a retry. Golden AssetLockValue vector from rs-dpp; minimal varint markers in the test helper. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…try the Node-side identity read Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedNext included review available in 31 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 selected for processing (12)
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 |
Resolve with #87 (per-facade retryable reads; pathElements added under system) and #94 (staged key persist in the renewal, D-016; the sheet remembers only a committed key). Co-Authored-By: Claude Opus 5.5 (1M context) <[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.
Summary
Fixes L-06, a false "Failed to create identity" on a paid browser create. It also adds step-timing instrumentation for L-20. Both are in group G3 of the live fix list.
L-06: root cause
Checked in the pinned platform source (
6c95cd8), and unchanged inv4.2.0-beta.5.identityCreate(packages/wasm-sdk/src/state_transitions/identity.rs:95-131) calls rs-sdk'sput_to_platform_and_wait_for_response_with_private_key.refresh_quorums.refresh_quorumsis crate-private (context_provider.rs:254). It runs only inprepare_state_transition_context(broadcast.rs:76-81), which the genericbroadcastAndWait/waitForResponseuse.with_refetch_if_not_found(false).Quorum not found in cache.#80 only covered reads.
The fix
lib/sdk/service.tsEvoSdkService.ensureFresh()builds a new trusted connection (a fresh quorum prefetch) before the create, unless the current one is under 30 s old.pathElementsis added to the retryable reads.lib/auth/create-identity.ts: after an error that leaves the outcome open, the flow asks Platform what happened. Open errors are stale quorum, proof, transport, timeout, "no available addresses", and already-used / already-exists.getPathElementson root tree 72, per rs-drivefetch_asset_lock_outpoint_info.IdentityNotCreatedError, and the sheet offers "Try again with the same deposit". The journal keeps the lock, so no new payment is needed.AssetLockValue::V0. It warns that a retry rejected for the same reason costs another fee. If less than the create minimum remains, the sheet offers "Discard this creation" instead.components/auth/create-identity-flow.tsx: the catch now reflects those outcomes. "Try again" works on a resumed creation too, and it reuses the key this sheet stored.L-20 (instrumentation only)
lib/step-timing.tsrecords each sign-in step and each enable-private-repos sub-step as a User Timing measure namedforge:<flow>:<step>.localStorage['forge.debug'] = 'timing'set, each measure is also logged to the console.vault.tsis untouched; G1 owns it.Upstream
A report is drafted, not filed:
dash-forge-qa/upstream/wasm-sdk-identity-create-quorum.md. It coversidentityCreateand the other typed wasm-sdk writes that skiprefresh_quorums.Tests
Unit (
lib/auth/create-identity.test.ts, 35 tests): a stale-quorum error is injected after the broadcast.IdentityNotCreatedError, and the retry reuses the lock.AssetLockValuevector serialized by rs-dpp.Every new case fails on the previous code.
Service (
service.test.ts):ensureFreshreuses a connection under 30 s old, rebuilds an older one, and keeps the current one when a rebuild fails.Live (
e2e/create-identity-recovery.spec.ts, moutai on drive 4.2.0-beta.5, Chromium, a fresh context per test; both pass):The spent-asset-lock probe was also checked live against beta.5: a consumed lock returns an empty
item, and a random outpoint returns no element.Evidence:
dash-forge-qa/evidence/impl/fix-identity-create-stale-quorum/.🤖 Generated with Claude Code