Skip to content

webapp: sign the dispute days, and show ended registrations - #23

Merged
epoberezkin merged 110 commits into
simplex-chat:namesfrom
brenzi-agent:ab/webapp-dispute-days
Nov 23, 2026
Merged

epoberezkin merged 110 commits into
simplex-chat:namesfrom
brenzi-agent:ab/webapp-dispute-days

Conversation

@brenzi-agent

@brenzi-agent brenzi-agent commented Nov 20, 2026 •

Copy link
Copy Markdown

Follows simplex-network/ens-contracts#51, merged on simplex as ebf7698: the sponsor's RegisterName type has uint256 disputeDays between data and nonce, and each sponsored registration has a dispute period of 14 to 120 days, during which the registration can be ended (unregister: expiry 0, the name available to anyone at once). On names, every registration this page signs reverts on those contracts. The names service's side is simplex-chat/simplex-chat#8317: the service computes each order's dispute days from its payment, refuses a registration signed over other days with 400 bad_request, and its registration view has the phase ended.

This branch is on names at 4d59775. Users see nothing new while a name is registered; the screens added are those of an ended registration, and two of names' existing texts for a name unregistered before the service's check.

What the page signs (src/crypto/registration.ts, src/flow.ts, src/views/checkout.ts, src/views/order.ts)

  • RegisterName with uint256 disputeDays between data and nonce (registerIntentDigest).
  • The days are taken from the page's own table, DISPUTE_DAYS in src/flow.ts: 120 for a card; 14 for Bitcoin, Monero or a prepaid code. signedReveal looks them up for the payment it is given, its only source of the days:
    • an order or a code order, when it is placed: the checkout's payment (Draft.method, set from chosen in sendOrder);
    • a closed order's new invoice: that invoice's method (draftAgain);
    • a name selected for a taken order: the payment of the order in this browser's record (Checkout.order.method);
    • a registration signed again later, by the order's page after the service cleared the stored reveal, or by Continue: the payment in this browser's record (revealFor).
  • A service that expects other days refuses the signature with 400, and the page shows names' existing texts: Check your order "That did not go through" for an order or a selection; a closed order's page "That did not go through" for its new invoice; the order's page, after 3 refusals, "The name could not be signed" with Try again; Continue "That did not go through. Nothing changed. Try again in a moment."
  • Limit of the rule: it holds for the records this browser made, by registration id. When the code reopens an order of such a record, reopen keeps the record's payment (known?.method). A record of an order made in another browser, or of an order this browser first meets under a new registration id (newerOrder, ownOrderFor, restore, addOrder, adoptSibling), takes its payment from the service's report.

What the page reads (src/api.ts)

  • The phase ended, {"type": "ended"}. The view type is otherwise as on names: the page ignores the view's disputeDays and the registered phase's disputeUntil, as it ignores every field it does not read.

Ended registrations

  • The order page (buildEnded in src/views/order.ts; screenOf and finished in src/screens/order.ts): "Registration ended" / "The registration of {name} was ended because a payment for it was disputed, reversed or refunded in full.", with Register with code in codes-only mode and Search a name otherwise. The service sets ended at its hourly check of the chain, or at its check of a mined register when the name was unregistered before the register was confirmed: a page that follows the registration shows it at once; a page of a registered order, which stops reading the order, shows it when it is next opened.
  • Your names: the chip "Ended" (src/screens/names.ts).
  • Edit links: "The registration was ended" / "A payment for it was disputed, reversed or refunded in full, so this page no longer edits its links." (screenOfEdit in src/screens/names.ts, src/views/names.ts).
  • Until the service sets ended, a registered order whose name the search does not answer as registered is shown with names' texts: Your names lists it with its expiry date and the Name code button alone (lapsed takes the order's view alone; editable is false for a name not answered as registered), and Edit links says "The name could not be read now" and reads the name again every 5 seconds (screenOfEdit). On names such an order shows "Expired {date}" in Your names and "This name has expired" in Edit links.
  • An ended order is not taken as an open order of its name (OUTCOMES in src/screens/search.ts, named apart from the phase; ownOrderFor in src/flow.ts). A balance from a failed order's month's end is monthEnded (BalanceRow["from"]), named apart from the phase.
  • Screens: order-ended, names-row-ended and names-edit-ended; and, with names' texts before the service's check, names-row-unregistered and names-edit-unregistered. 10 baselines added.

Dev backend (dev/, README.md)

  • The dev chain deploys ens-contracts at ebf7698. The seeded names and the rival registrations of /control/take are signed with 120 days, by the RegisterName typed data in dev/register-name.ts.
  • The mock gives each order the days of its payment, as the service does; a name selected for a taken order is given the order's. It checks the RegisterName signature of each order, code order, selection and reveal over those days, sends them in registerWithCredit, reads the registrar's disputeUntil, and ends a registration with /control/unregister/<registration>, after which the order's phase is {"type": "ended"}.

Verification against names

  • (a) Screens: git diff --name-status 4d59775 55a0b0e -- webapp/e2e/screens lists only names-edit-ended, names-row-ended, order-ended, names-row-unregistered and names-edit-unregistered, desktop and phone, all added. Screens passes all its states at 55a0b0e (see CI), so every other state draws as on names.
  • (b) git diff 4d59775 55a0b0e -- webapp/src adds no string that reaches the page except those of an ended registration ("Ended"; "Registration ended" and its sentence; "The registration was ended" and its sentence), and changes or removes none.

Tests

  • Unit: the digest against viem's hashTypedData over the typed data of dev/register-name.ts; an order, a reveal and a closed order's new invoice, each signed over the days of its payment, for every payment; a reveal of an order reopened with its code, signed over this browser's payment while the view's payment is another; ownOrderFor passing over an ended order for an unpaid one; the phase ended; the ended screens, chip and Edit links; a registered order whose name the search answers available, reserved or taken.
  • Contract, on the service's recorded fixtures (test/contract, test/terms-vectors.test.ts; run with STORE_FIXTURES only, skipped in CI): a registered order with and without a dispute end, an ended order, and the RegisterName digests over a card's 120 and a code's 14 days. At 55a0b0e, on the fixtures of store: dispute days by payment, and ended names simplex-chat#8317 at 8bbecfd (tests/fixtures/store-service/rest-api), locally: 65 passed.
  • Browser: an order, a code order and a selection signed over other days than their payment's refused as bad_request, and each view containing its payment's days; a reveal signed over other days than its order's payment's refused, and the one over its payment's registered; a name selected for a taken card order, signed over a card's 120 days and registered; a code registration's and a Bitcoin purchase's dispute end on chain, 14 days after the register's block; an ended registration on its order's page, in Your names, in Edit links and in codes-only mode, its name available again.
  • The service's contract run (store: dispute days by payment, and ended names simplex-chat#8317, scripts/store-service/dev/contract-run.sh) leaves out by title the cases that need the mock's controls: the reveal refused for its days (/control/stale), and an ended registration (/control/unregister, /control/mode). The card order's selection uses /control/take and settle only, which the contract run answers.

CI
At 55a0b0e, the head, everything passes in the fork run https://github.com/brenzi-agent/simplex.domains/actions/runs/45186918284 and in the PR build https://github.com/simplex-chat/simplex.domains/actions/runs/45186932880, each in its first attempt and with no flaky test:

  • unit: 602 tests, 57 skipped (the contract tests on the service's fixtures), the type check and the build.
  • Chromium: the browser tests (356), the production build tests (50) and Screens (377 states).
  • Firefox: the browser tests (301) and the production build tests (49).
  • WebKit: the browser tests (298) and the production build tests (49). In the PR build, this job's npx playwright install --with-deps webkit took 14 minutes, and then passed.

Earlier evidence:

…into ab/webapp-dispute-days

# Conflicts:
#	webapp/README.md
#	webapp/dev/mock/service.ts
#	webapp/e2e/codes.spec.ts
#	webapp/e2e/contract.spec.ts
#	webapp/e2e/helpers.ts
#	webapp/e2e/screens.spec.ts
#	webapp/src/api.ts
#	webapp/src/flow.ts
#	webapp/src/screens/checkout.ts
#	webapp/src/screens/names.ts
#	webapp/src/screens/order.ts
#	webapp/src/views/checkout.ts
#	webapp/src/views/order.ts
#	webapp/test/api.test.ts
#	webapp/test/contract/store.test.ts
#	webapp/test/contract/vectors.test.ts
#	webapp/test/flow.test.ts
#	webapp/test/screens-checkout.test.ts
#	webapp/test/screens-names.test.ts
#	webapp/test/screens-order.test.ts
#	webapp/test/terms-vectors.test.ts
@brenzi-agent brenzi-agent changed the title webapp: show the dispute period and its end, and sign it webapp: sign the dispute days, and show ended registrations Nov 23, 2026
@epoberezkin
epoberezkin marked this pull request as ready for review November 23, 2026 13:52
@epoberezkin
epoberezkin merged commit c13bce0 into simplex-chat:names Nov 23, 2026
4 checks passed
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.

3 participants