Person's usernames - read from AH dotNS instead of PC - #349
Conversation
re-gius
left a comment
There was a problem hiding this comment.
The issue. An attestation can queue a reservation for a name that is already registered. The candidate can never claim it, and because dotNS keys reservations by stem, it locks every two-digit variant of that stem for 12 weeks with no admin revoke.
Why it occurs. The reserved base name is never checked for availability before the attestation goes out. In this PR the value is threaded straight through without inspection: build_reservation_message SCALE-encodes it, submit_registration adds it as dotns.reservedUsername, and it continues on to reserve_name. The only place it is examined is if let Some(reserved), deciding whether to include the JSON field. The lite base does get checked via lite_username_available, but there is no equivalent for the reserved name. Nothing on chain catches it either (paritytech/dotns#), and the precondition arises on the happy path: a successful full-person claim deliberately releases the stem slot, and nothing records that the label is now taken.
Suggested fix. Before attesting, read the registrar for the reserved name's derived node and fail with an error naming it. dotns_read.rs already has the call plumbing. Read the registrar rather than {backend_base}/usernames/available, which does not consult the contract that would reject the reservation.
|
Rebased onto |
…already minted Review on #349 (re-gius) and paritytech/dotns#235: the gateway enqueues a reservation for a reserved_base_label without asking the registrar, so a reservation over a registered name can never be claimed and holds the whole stem's reservation queue for the reservation window. The contract-side guard lands in dotns; the client asks first so an attestation cannot fail as a whole (and lose the lite name) once that guard exists. label_available reads DotnsRegistrar.available(uint256(node)) for the label's node under the network tldNode(), through the same transport as the username reads. attest() checks the reserved base name (shape per the pallet's is_valid_person, then availability); register-name checks its label. Live test on paseo: a minted name reports unavailable, an unminted one available.
There was a problem hiding this comment.
@re-gius addressed in #426 (commit dd9b00e): before attesting, the CLI validates the reserved base label with the pallet's full-person rule and reads DotnsRegistrar.available(uint256(node)) for the label's node under the network tldNode() — through the same transport as the username reads — and fails naming the label. register-name does the same for its label. Live on paseo: a minted name reports unavailable, an unminted one available. Contract-side guard tracked in paritytech/dotns#235; agreed the client check is not the security boundary.
|
Closing so that it can be easily carried-over in #426 |
Adaptation to https://github.com/paritytech/individuality/issues/755.
Replaces the People-chain Resources.Consumers lookup with the dotNS
contracts on Asset Hub, shared by the CLI and the in-core runtime.
Adds full-person registration (
register-name), the previewnet preset,identity-backend token minting, and Asset Hub genesis config.