Skip to content

[Feat]: Gate the public short-name switch on Root #268

Description

@sphamjoli

Component

Registration

Priority

P0

Summary

The public commit-reveal path is for long, open-band names: base length 9 or more, which classify as NoStatus. Short names (base length 6 to 8, the lite and full personhood tiers) are issued through the PoP gateway.

PopRules carries a shortNamesEnabled flag that can additionally open the short-name band to the public paid path. Today its setter, setShortNamesEnabled(bool), is onlyOwner. Opening short names to the public path is a governance decision, so the authority should be substrate Root, matching the origin-based model already used by DotnsNameWhitelist and the PoP controller after #258.

Proposal

  • Change PopRules.setShortNamesEnabled(bool) from onlyOwner to strictly Root: require(SystemUtils.originIsRoot(), NotRoot()). No owner fallback.
  • Keep the setter free of msg.sender reads so it is callable under a Root origin (a Root origin has no account, so reading msg.sender traps). If ShortNamesEnabledUpdated carries a caller field, drop it.
  • Default stays off. While off, the public register() path admits only base length 9 or more (NoStatus); short names remain gateway-issued regardless of the flag.
  • No change to registerReserved or the PoP gateway paths.
  • Update deploy scripts and tests that currently flip the flag through the owner to drive it from a Root origin.

Behaviour to note (intended, captured for reviewers): when Root turns the flag on, the public path mints 6 to 8 lite and full names per the existing personhood-tier rules, and on the cross-payer path an unverified payer can sponsor a short name for a verified owner (the tier check is on the owner, not the payer). This is the open-market behaviour the flag exists to enable.

Acceptance criteria

  • setShortNamesEnabled is callable only under a Root origin; owner and any other caller revert NotRoot.
  • The setter reads no msg.sender; confirmed callable under a Root origin.
  • Default off: public register() reverts for base length under 9 on both the direct and cross-payer paths while off, with tests.
  • With the flag opened by Root, public register() admits 6 to 8 names per the existing tier rules; regression tests toggle it via a Root origin.
  • The PoP gateway and registerReserved paths are unchanged.
  • Switch NatSpec and any docs state the Root authority.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions