Skip to content

registrar, controller: dispute period for sponsored registrations - #51

Merged
epoberezkin merged 13 commits into
simplex-network:simplexfrom
brenzi-agent:ab/dispute-period-v2
Nov 20, 2026
Merged

epoberezkin merged 13 commits into
simplex-network:simplexfrom
brenzi-agent:ab/dispute-period-v2

Conversation

@brenzi-agent

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

Copy link
Copy Markdown

On simplex with #50, the upgradeable stack, merged. Merge order: this, then #49, which is stacked on this one. The plan: https://github.com/brenzi/simplex-namespace-contract/pull/19. The names conditions with the dispute period: simplex-chat/simplex-chat#8271.

A card payment can be disputed or refunded for about 120 days after the store service registered the name it paid; the money is withdrawn from the store, and the buyer kept the whole paid term. A registration made with a compromised store key was final at once.

Dispute period. A sponsored registration now defines a dispute period, and the name is registered for its whole term.

  • SimplexSponsor.registerWithCredit(registration, disputeDays, nonce, deadline, sig): RegisterName gains uint256 disputeDays, so the buyer signs it.
  • SimplexController.registerSponsored(registration, disputeDays) refuses fewer than 14 or more than 120 days with DisputeDaysOutOfRange. The store uses 120 for card payments and in-app purchases, 14 for BTC, XMR and prepaid codes, and for a balance the largest days among the payments that funded it.
  • The payable register (ETH in the dApp) and registerReserved store disputeUntil 0, so those names are final from their first block.

Unregistration.

  • BaseRegistrarImplementation stores disputeUntil[id], written at registration and deleted at unregistration, after its last state variable. Its unregister(id, until) is for registrar controllers, live, before disputeUntil, and only with until equal to it (DisputeUntilMismatch(named, current)), so a queued or repeated call cannot end a later registration of the label whose dispute ends at another second. It sets the expiry to 0 and the registry node's owner and resolver to 0, ends the SubnameRegistrar's subnames through the subname hook, and emits NameUnregistered.
  • SimplexController.unregister(label, until), for the guardian or the admin, first clears the name's records on the current default resolver, whatever the node points at, and on a past default the node points at.
  • The name is then available to anyone at once. The old subnames can be purged at once (purge is permissionless); the next registration burns the old token, as for a lapsed name.
  • A name past its dispute period reverts DisputePeriodOver, so the guarantee is held by the registrar, also against another registrar controller.

Renewals are final. The registrar's renew refuses them until disputeUntil (DisputePeriodNotOver), for every registrar controller, so an unregistration never erases a paid renewal; the shortest term is 730 days, so a name cannot lapse meanwhile. When a payment for the name is disputed, reversed or refunded in full and its registration is not ended, the guardian reserves the name with the existing addReservedNames, so its next renewal is refused.

Delivery: this merges before run 1 of the stack (brenzi/simplex-namespace-contract#20), which deploys it and sets the terms of simplex-chat/simplex-chat#8271; #49 follows after the deployment as its first upgrade (plan D21).

As an upgrade, only if run 1 precedes the merge: the registrar, the controller, the policy and the sponsor are upgraded in one batch, with INTENDED naming the replaced selectors registerWithLabel(string,address,uint256), the old registerSponsored and the old registerWithCredit (docs/upgrades.md, invariant 5); docs/upgrades.md lists unregister among the registrar functions the controller calls. The changed RegisterName and registerWithCredit replace the old ones in place, without the old form beside them: the batch executes before the stack's registrar step (#20, D21), so no RegisterName in the old form is signed for v2's sponsor and sponsored registrations are interrupted for no time (the owner, 20 Nov; plan D20). By the code, the webstore signs RegisterName and the store service sends it; no SimpleX app version signs it. Both ship the new form before the registrar step.

Comments: two existing comments are corrected for the unregistration (the INVARIANT of BaseRegistrarImplementation and the NatSpec of SubnameRegistrar.onExpiryChanged).

Sizes in bytes, limit 24,576:

Contract #50 This change
BaseRegistrarImplementation 20,166 21,248
SimplexController 17,841 18,666
SimplexNamePolicy 15,779 15,792
SimplexSponsor 5,779 5,795

Tests.

  • test/simplex/TestDisputePeriod.test.ts covers:
    • the bounds of 14 and 120 days, and the signed days;
    • the payable path and registerReserved with a dispute end of 0;
    • who may unregister, the exact last second, without a default resolver, and while the registrar does not own the TLD node;
    • what an unregistration ends: the expiry, the registry owner and resolver, records, subnames and their purge, claims, renewals and record writes;
    • records cleared although the holder pointed the node at 0, or the default was rotated, and no block by a holder who points the node at a contract that is no resolver;
    • a new registration by anyone, and a stale unregister refused for it;
    • a recipient of a claim losing the name;
    • a renewal on both paths refused until the exact end of the dispute period;
    • direct calls on the registrar.
  • The existing tests pass the new argument; those renewing a sponsored name first pass its dispute period, and the eleven-year renewal limit is tested at its exact boundary.
  • test/ethregistrar/TestBaseRegistrar.test.ts passes the new argument. Its case should permit the owner to transfer a registration, which fails on simplex, is adapted in ci: run all tests on the simplex branch and its pull requests #52.

CI. Until Actions is enabled in this repository and #52 merges, the runs are on the fork's ci/ branches, which add a workflow file and #52:

Decisions are in the plan (D1–D21), each with its source; the owner confirmed the principles on 19 and 20 Nov.

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.

2 participants