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

feat: Add an initial implementation of a minimal TLD-operator #70

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

przydatek
Copy link
Contributor

Add a Motoko-implementation of a minimal TLD-operator. This initial implementation has a hard-coded TLD (.icp), which will be changed to a configurable init-parameter at a later point.

TT-511

@przydatek przydatek marked this pull request as ready for review January 9, 2025 10:17
@przydatek przydatek requested a review from a team as a code owner January 9, 2025 10:17
Copy link
Contributor Author

@przydatek przydatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, PTAL.

minimal_cns/src/backend/tld_operator.mo Show resolved Hide resolved
minimal_cns/src/backend/tld_operator.mo Show resolved Hide resolved
keplervital
keplervital previously approved these changes Jan 10, 2025
};
};

public shared ({ caller }) func register(domain : Text, records : RegistrationRecords) : async (RegisterResult) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure what is the purpose of the name argument. The only thing we do with it right now is check that it matches the name of the domain record. Is there some future context that I'm missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my understanding the reason for such a spec is to avoid too many structs: RegistrationRecords contain DomainRecord entries, which are also returned by lookup in DomainLookup, hence some redundancy (i.e. when registering a domain one has to check that it matches DomainRecord.name).

Alternatively, one could have a separate struct for registration, say DomainRecordWithoutName, and then join domain with that struct into DomainRecord. I don't have a strong preference.
@keplervital, please correct if my understanding is wrong.

dfx.json Show resolved Hide resolved
minimal_cns/src/backend/tld_operator.test.mo Outdated Show resolved Hide resolved
minimal_cns/src/backend/tld_operator.test.mo Outdated Show resolved Hide resolved
Copy link
Contributor Author

@przydatek przydatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, PTAL.

dfx.json Show resolved Hide resolved
};
};

public shared ({ caller }) func register(domain : Text, records : RegistrationRecords) : async (RegisterResult) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my understanding the reason for such a spec is to avoid too many structs: RegistrationRecords contain DomainRecord entries, which are also returned by lookup in DomainLookup, hence some redundancy (i.e. when registering a domain one has to check that it matches DomainRecord.name).

Alternatively, one could have a separate struct for registration, say DomainRecordWithoutName, and then join domain with that struct into DomainRecord. I don't have a strong preference.
@keplervital, please correct if my understanding is wrong.

minimal_cns/src/backend/tld_operator.test.mo Outdated Show resolved Hide resolved
minimal_cns/src/backend/tld_operator.test.mo Outdated Show resolved Hide resolved
@przydatek przydatek merged commit a0f02ab into main Jan 14, 2025
9 checks passed
@przydatek przydatek deleted the bartosz/tld_operator branch January 14, 2025 17:15
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.

3 participants