Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameService: port changes from C# NNS #267

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

AnnaShaleva
Copy link
Member

Depends on #266, will be rebased after upstream merge.

This PR includes changes implemented into C# NNS version (https://github.com/neo-project/non-native-contracts/blob/master/src/NameService/NameService.cs):

  1. Domain registration price is dependant on domain name length. By default, short (<5 chars) domain names are available for registration only for committee.

    • This change may affect other neofs services including neofs-adm, so we need to create corresponding issues in the affected repos.
    • Also, the contract storage scheme is changed, so the migration routine is added and we need to create an issue to remove it after the contract update.
  2. Renew overload is added that accepts expiration period as an argument. This change is backwords-compatible.

  3. SetAdmin and Renew events are added.

    • These events may be useful for neofs services, we may create an issue to use them where possible (if needed).

I'm restricted to choose the reviewers via Github interface, thus @roman-khimov, @fyrchik, review, please.

In case if no records of the specified type found.

Signed-off-by: Anna Shaleva <[email protected]>
`getRecord` doesn't exist since
nspcc-dev@6ea4573.

Signed-off-by: Anna Shaleva <[email protected]>
And adjust method usages along the way.

Signed-off-by: Anna Shaleva <[email protected]>
Reuse getAllRecords for GetAllRecords.

Signed-off-by: Anna Shaleva <[email protected]>
Do not include CNAME to the resulting list if we're looking for another
record type. If it's CNAME than it must be resolved.

Signed-off-by: Anna Shaleva <[email protected]>
Do not move parts of SetRecord/AddRecord to a separate functions,
it makes the contract code more complicated. Also, improve
documentation a bit.

Signed-off-by: Anna Shaleva <[email protected]>
…unction

Don't repeat it each time.

Signed-off-by: Anna Shaleva <[email protected]>
It doesn't save VM opcodes, but allows to keep record key creation
logic in a single place which prevents the code from bugs appearance.

Signed-off-by: Anna Shaleva <[email protected]>
Less code repeating.

Signed-off-by: Anna Shaleva <[email protected]>
If conflicting records '*.domain' are present on new domain
registration, then `isAvailable` should return false for this
domain. Ref.
nspcc-dev@f25296b.

Signed-off-by: Anna Shaleva <[email protected]>
Add corresponding migration and bump version along the way.
Port neo-project/non-native-contracts@8ac2b80.

Signed-off-by: Anna Shaleva <[email protected]>
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.

1 participant