Skip to content

fix(dpns): bump evo-sdk to 5.0.3 so name registration works on Platform 5.0, and show real SDK errors - #60

Merged
PastaPastaPasta merged 3 commits into
mainfrom
t3/fix-contested-name-registration
Nov 24, 2026
Merged

PastaPastaPasta merged 3 commits into
mainfrom
t3/fix-contested-name-registration

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Problem

On the mainnet bridge, registering a username fails with Failed: [object Object]. Pasta saw it with the contested name forge.dash, but it isn't specific to contested names: every DPNS registration fails, contested or not.

Root cause

Mainnet and testnet Platform now run 5.0 (protocol 14, drive 5.0.3). Its breaking change dashpay/platform#4859, "document ids commit to the identity contract nonce", changed how document IDs are derived. The bridge pins @dashevo/evo-sdk 4.1.1, which still derives the old ID. So sdk.dpns.registerName fails client-side before anything is broadcast, with:

Protocol: Invalid document transition id FyhAnUw3WBeK2vUdv99hJke2HZCyGwGePAAaLKYbr2Z5, expected 5Vn5QEoBxmUTUgAvDosnwMFfMzGuqycshTF6LLtuXGcF

Identity creation and top-ups don't create documents, which is why they still worked.

The UI showed this as [object Object] because the SDK rejects with WasmSdkError, which is not an Error subclass. The DPNS path fell back to String(error).

Changes

  • Bump @dashevo/evo-sdk (and the @dashevo/wasm-sdk it pulls in) from 4.1.1 to 5.0.3, the current release that matches the network.
  • extractErrorMessage handles SDK error objects: it shows the kind, the message and a present code (Protocol: Invalid document transition id …), and serializes plain objects that have no message. The DPNS registration and availability checks, identity update, login, the manage/withdraw/contract/key-fetch paths and toError use it instead of instanceof Error ? … : String(error). Serialized objects are capped at 300 characters, and getters that throw (a freed WASM object) fall back to "Unknown error".
  • e2e: the mock-mode withdraw test now uses the existing openApp helper, which blocks external requests and waits for the first network-status render before typing. That render re-renders the page and wipes typed input (the WIF field is never rendered back). Polling starts after the idle-time SDK warmup, and the larger 5.0.3 chunk (~12.8 MB vs ~10 MB) moved that render into the window where the test types, so it failed in CI. The other mock-mode tests already wait the same way.

Verification

  • Reproduced on testnet with 4.1.1. A contested name and a non-contested name both failed with the error above, and the balance was unchanged.
  • With 5.0.3, the same registerName call registered the contested name brqa1ebcdcag.dash on testnet for identity APScJRQFRz1RVrtauRLALMr2eizwGv9c8TNhJ7EZfwJf. Preorder 4nUNryMYf3MxSBGjyGFHFqdXN6zdpB9Xe3uctdrtVoT9, domain 6YMArpZeTBwUsuj6DBDvvAhNMk87rSQdvYDAqfqSgJHD. It cost about 10.1B credits (~0.1 DASH).
  • Contested registration through the bridge UI on testnet, built from this branch: a Playwright run drove DPNS mode → existing identity → check availability → acknowledge the contested warning → Register for fbqidfecajdeb. The result row shows "Entered voting period". The contested vote poll for fbq1dfecajdeb exists on testnet with APScJRQFRz1RVrtauRLALMr2eizwGv9c8TNhJ7EZfwJf as the contender (0 votes so far). The identity's balance fell by 10,108,265,220 credits (~0.101 DASH).
  • CI is green (build on Node 22 and 24, e2e). On a separate Ubuntu 24.04 sandbox: build, artifact check and all 810 unit tests passed; the deterministic and widget e2e suites passed 3 times over (177/177, no retries).

Note for forge.dash

A contested name costs about 0.1 DASH in credits. Identity 8YbYWEGBpQeUmiSa5B1VmyH3ogJPRSsbxYpr37NDWhvn on mainnet currently holds 866,449,860 credits (~0.0087 DASH), so it needs a top-up of roughly 0.1 DASH or more before forge.dash can be registered, even with this fix.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds a shared utility for formatting error values and applies it to error handlers across SDK, platform, and UI flows. The declared @dashevo/evo-sdk version changes from 4.1.1 to 5.0.3.

Changes: Error Message Formatting

Layer / File(s) Summary
Error extraction rules and coverage
package.json, src/utils/errors.ts, src/utils/errors.test.ts
extractErrorMessage handles Error instances, object messages, names, and codes. It serializes objects without usable messages and uses fallback output when serialization fails or produces an empty object. Tests cover these cases and primitive inputs. The declared @dashevo/evo-sdk version changes to 5.0.3.
Error handler integration
src/main.ts, src/platform/*, src/ui/state.ts
DPNS, identity, login, contract, withdrawal, and UI error handling now uses extractErrorMessage to produce error text.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: thephez

Merge Risk: Minimal · up to 04874 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: bumping @dashevo/evo-sdk from 4.1.1 to 5.0.3 to fix DPNS name registration on Platform 5.0. It also names the second change: showing real SDK errors through extractErr…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: bumping @dashevo/evo-sdk from 4.1.1 to 5.0.3 to fix DPNS name registration on Platform 5.0. It also names the second change: showing real SDK errors through extractErrorMessage. The raw summary confirms both changes: the package.json version bump and the extractErrorMessage updates across the DPNS, identity, login, and UI code paths.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e88d3ba-019c-4198-909d-6fcd76ff73ac
Commits

Reviewing files that changed from the base of the PR and between c034bf9 and 04874a5.

Files ignored due to path filters: 1

  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing: 8

  • package.json
  • src/main.ts
  • src/platform/dpns.ts
  • src/platform/identity.ts
  • src/platform/login.ts
  • src/ui/state.ts
  • src/utils/errors.test.ts
  • src/utils/errors.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

PastaPastaPasta and others added 2 commits November 24, 2026 14:08
…rm 5.0, and show real SDK errors

Platform 5.0 (protocol 14, live on mainnet and testnet) makes document ids
commit to the identity contract nonce (dashpay/platform#4859). evo-sdk 4.1.1
still derives the old id, so every DPNS registration, contested or not, was
rejected client-side with "Invalid document transition id ..., expected ...".

The UI showed that as "Failed: [object Object]" because WasmSdkError is not an
Error subclass. extractErrorMessage now includes the error kind and code and
serializes plain objects, and the DPNS, identity, login and manage paths use it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@PastaPastaPasta
PastaPastaPasta force-pushed the t3/fix-contested-name-registration branch from 8362613 to 258c04c Compare November 24, 2026 14:08
…the withdraw test

The first network-status snapshot re-renders the page and wipes typed input
(the WIF field is never rendered back). Polling starts after the idle-time SDK
warmup, and the larger evo-sdk 5.0.3 chunk moves that render into the window
where the withdraw test types, so its blur handlers saw empty fields. Use the
existing openApp helper, which blocks external requests and waits for that
render, as the other mock-mode tests already do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@PastaPastaPasta
PastaPastaPasta merged commit 3ac4f88 into main Nov 24, 2026
4 checks passed
@PastaPastaPasta

Copy link
Copy Markdown
Member Author

Merged as 3ac4f88 and deployed by Deploy run 45417863976 (build and deploy both passed). Live check on bridge.thepasta.org:

  • The site serves assets/index-BCuw_0zk.js and assets/evo-sdk.module-zD3dVroV.js (12.75 MB). Both match a clean build of 3ac4f88 with evo-sdk 5.0.3.
  • On the deployed site with ?network=testnet, the contested name fbqddffeaaebb registered through the UI and shows "Entered voting period".
  • On the deployed site, a registration that Platform rejects now shows the real error instead of [object Object]: Failed: StateTransitionBroadcastError: … has duplicate unique properties ["normalizedParentDomainName", "normalizedLabel"] with other documents (code 40105).
  • Mainnet was checked read-only. Protocol is 14, and forge is contested and still available. Nothing was registered or spent on mainnet.

🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.

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.

1 participant