extend SMP protocol to support name availability queries - #1863
Draft
brenzi wants to merge 20 commits into
Draft
Conversation
…e and meaningful replies
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
Co-authored-by: Evgeny <evgeny@poberezkin.com>
Co-authored-by: Evgeny <evgeny@poberezkin.com>
Co-authored-by: Evgeny <evgeny@poberezkin.com>
Co-authored-by: Evgeny <evgeny@poberezkin.com>
Co-authored-by: Evgeny <evgeny@poberezkin.com>
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
|
|
||
| instance Encoding NamePricing where | ||
| smpEncode NamePricing {rentPrices, minLabelLength} = | ||
| smpEncodeList rentPrices <> smpEncode (fromIntegral minLabelLength :: Word16) |
Member
There was a problem hiding this comment.
Suggested change
| smpEncodeList rentPrices <> smpEncode (fromIntegral minLabelLength :: Word16) | |
| smpEncode (EncList rentPrices, fromIntegral minLabelLength :: Word16) |
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
epoberezkin
reviewed
Sep 7, 2026
| strP = parseDomain . safeDecodeUtf8 <$?> boundedNonSpace | ||
| where | ||
| parseDomain s = AT.parseOnly (nameLabelP `AT.sepBy1` AT.char '.' <* AT.endOfInput) s >>= mkDomain | ||
| parseDomain s = AT.parseOnly ((labelHashP <|> nameLabelP) `AT.sepBy1` AT.char '.' <* AT.endOfInput) s >>= mkDomain |
Member
There was a problem hiding this comment.
we cannot change this instance to allow parsing hash as name, SimplexDomain should only be used to represent names, not their hashes. It's used in UI that should not accept hashes.
epoberezkin
reviewed
Sep 7, 2026
| "simplex" : name : sub -> registryDomain TLDSimplex name sub | ||
| "testing" : name : sub -> registryDomain TLDTesting name sub | ||
| _ | ||
| | any isLabelHash lowered -> Left "labelhash requires a registry TLD" |
epoberezkin
reviewed
Sep 7, 2026
| lowered = map T.toLower labels | ||
| -- Only the second-level label is a registry key, so only it may be hashed. | ||
| registryDomain tld name sub | ||
| | any isLabelHash sub = Left "only the second-level label may be a labelhash" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Let users query name availability by labelhash (without revealing plaintext name unless it resolves)
They should get a precise answer with details in all possible cases (expired, grace, auction, reserved)
Assumes these get merged and deployed for .simplex, but PR works against .testing names as well.
assumes merged implement configurable prices for oracle simplex-network/ens-contracts#28
assumes merged implement reservation reason enum simplex-network/ens-contracts#30
bump SMP protocol version