Repository navigation
webapp: sign the dispute days, and show ended registrations - #23
Merged
epoberezkin merged 110 commits intoNov 23, 2026
Merged
Conversation
…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
epoberezkin
approved these changes
Nov 23, 2026
epoberezkin
marked this pull request as ready for review
November 23, 2026 13:52
epoberezkin
approved these changes
Nov 23, 2026
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.
Follows simplex-network/ens-contracts#51, merged on
simplexas ebf7698: the sponsor'sRegisterNametype hasuint256 disputeDaysbetweendataandnonce, 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). Onnames, 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 400bad_request, and its registration view has the phaseended.This branch is on
namesat 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)RegisterNamewithuint256 disputeDaysbetweendataandnonce(registerIntentDigest).DISPUTE_DAYSinsrc/flow.ts: 120 for a card; 14 for Bitcoin, Monero or a prepaid code.signedReveallooks them up for the payment it is given, its only source of the days:Draft.method, set fromchoseninsendOrder);draftAgain);Checkout.order.method);revealFor).reopenkeeps 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)ended,{"type": "ended"}. The view type is otherwise as onnames: the page ignores the view'sdisputeDaysand theregisteredphase'sdisputeUntil, as it ignores every field it does not read.Ended registrations
buildEndedinsrc/views/order.ts;screenOfandfinishedinsrc/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 setsendedat 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.src/screens/names.ts).screenOfEditinsrc/screens/names.ts,src/views/names.ts).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 (lapsedtakes the order's view alone;editableis 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). Onnamessuch an order shows "Expired {date}" in Your names and "This name has expired" in Edit links.OUTCOMESinsrc/screens/search.ts, named apart from the phase;ownOrderForinsrc/flow.ts). A balance from a failed order's month's end ismonthEnded(BalanceRow["from"]), named apart from the phase.order-ended,names-row-endedandnames-edit-ended; and, with names' texts before the service's check,names-row-unregisteredandnames-edit-unregistered. 10 baselines added.Dev backend (
dev/,README.md)/control/takeare signed with 120 days, by theRegisterNametyped data indev/register-name.ts.RegisterNamesignature of each order, code order, selection and reveal over those days, sends them inregisterWithCredit, reads the registrar'sdisputeUntil, and ends a registration with/control/unregister/<registration>, after which the order's phase is{"type": "ended"}.Verification against
namesgit diff --name-status 4d59775 55a0b0e -- webapp/e2e/screenslists onlynames-edit-ended,names-row-ended,order-ended,names-row-unregisteredandnames-edit-unregistered, desktop and phone, all added. Screens passes all its states at 55a0b0e (see CI), so every other state draws as onnames.git diff 4d59775 55a0b0e -- webapp/srcadds 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
hashTypedDataover the typed data ofdev/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;ownOrderForpassing over an ended order for an unpaid one; the phaseended; the ended screens, chip and Edit links; a registered order whose name the search answers available, reserved or taken.test/contract,test/terms-vectors.test.ts; run withSTORE_FIXTURESonly, skipped in CI): a registered order with and without a dispute end, an ended order, and theRegisterNamedigests 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.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.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/takeandsettleonly, 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:
npx playwright install --with-deps webkittook 14 minutes, and then passed.Earlier evidence:
npx playwright install --with-deps firefoxand passed on its re-run (attempt 2). The PR build https://github.com/simplex-chat/simplex.domains/actions/runs/45168082299 passes unit, Chromium and Firefox; its WebKit job hung innpx playwright install --with-deps webkit, an infrastructure failure.ownOrderForpast an ended order detect the code they guard: on a temporary branch (7f9fd85) whose checkout signs its own method in place of the taken order's payment and whoseownOrderForleavesendedout of its exclusion, the fork run https://github.com/brenzi-agent/simplex.domains/actions/runs/45181998416 fails only those tests: unit theownOrderForcase, Firefox and WebKit the card order's selection.