fix(wallet): make UMP account lookup resilient - #427
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ty-everett
marked this pull request as ready for review
August 4, 2026 15:15
ty-everett
requested review from
BraydenLangley,
sirdeggen and
tonesnotes
as code owners
August 4, 2026 15:15
BraydenLangley
approved these changes
Aug 4, 2026
BraydenLangley
left a comment
Collaborator
There was a problem hiding this comment.
Performed integration testing locally with an account with had competing forked ump tokens, and these changes resolved the issues previously discovered.
When distinct verified UMP tokens compete for the same account hash, resolve on on-chain proof instead of always erroring: - A candidate spent anywhere in another candidate's BEEF ancestry is superseded. The walk is iterative (deep update chains cannot exhaust the stack) and evidence is merged across hosts serving the same token at different BEEF depths, so a shallow copy cannot mask a deeper copy's proof. - Forked candidates with no spend relationship resolve only when exactly one provably consumed a same-identity predecessor token (matching presentation or recovery hash), which requires the account's keys and demonstrates continuity of control. A freshly minted competitor is typically the residue of an erroneous historical re-onboarding. - Anything less decisive — true forks, competing proven continuations, or candidates without examinable evidence — still raises UMPTokenLookupError so a wrong token can never be chosen silently, and multiple verified tokens can never be mistaken for a new account. - Resolved conflicts report a supersededTokens count in the completed lookup telemetry event (counts only, consistent with the privacy boundary). Covers the edge-case matrix in CWIAuthenticationDiagnostics.test.ts: direct and multi-hop supersession, supersession through intermediates absent from the lookup answer, host-order independence, duplicate records, merged shallow/deep evidence, 1200-link chains, rotated presentation keys, twelve-field predecessors, malformed identity hashes, and the fail-closed fork cases. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ty-everett
force-pushed
the
agent/resilient-ump-account-lookups
branch
from
August 4, 2026 20:09
de08adb to
546af07
Compare
ty-everett
force-pushed
the
agent/resilient-ump-account-lookups
branch
from
August 4, 2026 20:23
546af07 to
dcf5a64
Compare
|
25 tasks
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.



Program and scope
dcf5a64179c8bff7b4b12ca233c971ef4b2705e4Impact
Affected packages/services and intended versions (publication occurs only
through the release workflow after approval):
@bsv/wallet-toolbox@2.5.0@bsv/wallet-toolbox-client@2.5.0@bsv/wallet-toolbox-mobile@2.5.0These versions were already the unreleased candidates on current
mainafter #426; this PR adds the wallet lookup behavior to that release boundary without creating a second version bump.The shared account lookup now applies this order:
The resolver still waits for all advertised hosts so a slower existing record can override an earlier empty response. WAB existing-account continuity remains fail-closed.
Verification
pnpm install --frozen-lockfileunder supported Node 24 — passed.pnpm --filter @bsv/wallet-toolbox test:coverage— 183 suites passed; 1,621 passed and 1 skipped before the final focused coverage-only regression, which also passed.git diff --check— passed.dcf5a64179c8bff7b4b12ca233c971ef4b2705e4; Codecov patch is 91.67% and the merge gate is green.compatibility, public API, artifacts, dependencies, docs, and operations
scope-based skip is expected and validated by the merge gate
Security and dependencies
audit results were reviewed
(including accepted or false-positive issue states) and zero unreviewed hotspots;
Sonar's aggregate
Quality Gate passedverdict alone is not merge evidenceand removal condition
Dependency evidence
Complete every field when a dependency manifest, lockfile, container base, code
generator dependency, Dependabot configuration, or pinned workflow action
changes. Use “Not applicable — ” only when the reason is concrete.
main.pnpm-lock.yamlmatchesmain.main; exact-head CodeQL and dependency review passed.2.5.0candidates.Release and operations
controlling program
No image, deployment, DNS, database, secret, or wire-format change is involved. Rollback is the prior package release. Publication will use the protected release workflow only after merge.
Completion evidence
passing checks, resolved alerts, measurements, or an approved exception
guidance are current or concretely not applicable
being handed to another contributor as “complete”
restriction is assumed