nspcc-dev / neofs-contract

NeoFS smart-contract
GNU General Public License v3.0
10 stars 17 forks source link

nns: Register pre-defined TLDs for the committee on deployment stage #344

Closed cthulhu-rider closed 1 year ago

cthulhu-rider commented 1 year ago

lets then explicitly denote the layer of top-level domains controlled by the committee. 2nd level domains can be freely registered by anybody. Any deeper level requires owner or admin authorization.

cthulhu-rider commented 1 year ago

The concept of "committee" domain is excessive

agree overall, but what behavior do u expect from methods of ownership like https://pkg.go.dev/github.com/nspcc-dev/neofs-contract/nns#OwnerOf called with TLD? Maybe panic?

cthulhu-rider commented 1 year ago

@roman-khimov @AnnaShaleva i've updated changes

do u think we need dedicated registerTLD method? Let me remind u that now register method takes the domain owner as a parameter, which from now will ignored during TLD registration.

i'm ok to leave register as it is. With registerTLD, it'd make sense to ban TLD registrations via register

roman-khimov commented 1 year ago

OwnerOf called with TLD

It's just not a proper domain, so it should behave as if this domain was never registered. I think that's similar to C# NNS behavior for TLDs.

cthulhu-rider commented 1 year ago

should behave as if this domain was never registered

so smth like

OwnerOf("bob.com") -> Bob
OwnerOf("com") -> panic("domain not exists")

?

or it'd be better to panic with TLD not allowed?

roman-khimov commented 1 year ago

IIUC inexistent.com will fail with panic("token not found"), that's OK for TLD too.

cthulhu-rider commented 1 year ago

after discussion with @roman-khimov we have approved the behavior of TLD as a non-existent token for which operations like ownerOf work like with missing tokens. We also settled on the need to provide a dedicated registerTLD method and make register to work with "true" tokens, i.e. domains L2+.

@AnnaShaleva ty for the review, some of the discussions will be resolved after update I think

cthulhu-rider commented 1 year ago

I think we need some listTLDs iterator

btw contract provides roots, this is what you need? I've added test 92aa3edf9ce96fca4b6b06ed974025678c8b5a37

cthulhu-rider commented 1 year ago

Why is this still a draft?

waited for meaningful discussions to be resolved. Now it seems to be finished, i'll do https://github.com/nspcc-dev/neofs-contract/pull/344#discussion_r1229252443 and open