-
Notifications
You must be signed in to change notification settings - Fork 16
refactor: unified polymorphic domain + registry #1983
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
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
db21e8e
checkpoint: initial spec
shrugs a7e70bb
enssdk: add v1/v2 registry id brands and reshape ENSv1DomainId
shrugs 10e0307
ensdb-sdk, ensnode-sdk: unified polymorphic domain + registry schema
shrugs 0af2647
ensindexer: migrate handlers to unified domain + polymorphic registry
shrugs 5418244
ensapi: migrate omnigraph to unified domain + polymorphic registry
shrugs 707f33f
chore: add breaking changeset for unified polymorphic domain/registry
shrugs 8a7bca8
Merge branch 'main' into refactor/ensv1-domain-model
shrugs e57f87c
fix: openapi-schema
shrugs 5534db0
fix: address pr notes
shrugs 2b3e296
Merge branch 'main' into refactor/ensv1-domain-model
shrugs d29a5fb
fix: inline ownerId materialization to save a db op
shrugs c38284f
feat(ensapi): Query.root non-null, prefer v2; add ENSv1 coverage tests
shrugs a2434ec
fix: regenerate gql schema
shrugs e13da69
style: fix typos + clarify Domain.path description
shrugs ef9f65a
fix: schema and agents.md
shrugs 9a3f33c
refactor(ensnode-sdk): getRootRegistryId helper; clarify canonical-re…
shrugs 5c05677
perf(ensapi): short-circuit null subregistry_id in canonical-registri…
shrugs 3ae0993
refactor(ensapi,enssdk,ensdb-sdk): consolidate dev query, add makeCon…
shrugs 0f34ce1
chore(enssdk): regenerate GraphQL schema — ENSv1Registry description …
shrugs c37a9a4
fix(ensapi,ensnode-sdk,enskit): multi-root traversal + type-guard + g…
shrugs 9d59225
fix(ensapi): multi-root canonical-path + DISTINCT canonical-registrie…
shrugs 18b2d46
fix: move to eager registry init, address lineanames managed name bug
shrugs 60abf4a
refactor(ensnode-sdk): move managed-names into sdk; delete redundant …
shrugs 0990c35
fix: tidy up after refactor
shrugs 2d014be
Merge branch 'main' into refactor/ensv1-domain-model
shrugs ba61cee
fix: pr notes
shrugs e1c07da
Merge branch 'main' into refactor/ensv1-domain-model
shrugs cd6eb81
fix: move back to lazy registry initialization
shrugs ee7efac
fix: destructure ensureEvent helpers to minimize db ops
shrugs 7817921
fix: correct values for parent logic in lazy registry init
shrugs 6b4c3fc
fix: add more correctness comment
shrugs 9a9e756
fix: bot nit
shrugs 2e37c84
fix: add changeset
shrugs 0f880b1
fix: just memoize the whole function
shrugs b8ca031
fix: remove lazy in findResolver
shrugs e9fb641
fix: correctly traverse namegraph to identify target domain with brid…
shrugs 9c20388
tidy
shrugs 92f01b6
fix: small docs updates
shrugs ab18eb3
fix: add latest reg/ren index relations
shrugs b9eb528
fix: bot nits
shrugs eb1e4b9
fix: terminate reverse walks at known root registries
shrugs 3ddddcf
fix: support ensv1resolver fallback
shrugs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| "@ensnode/ensnode-sdk": minor | ||
| --- | ||
|
|
||
| Centralized Managed Name and Root Registry helpers. | ||
|
|
||
| - **Removed:** `getEthnamesSubregistryId`, `getEthnamesSubregistryManagedName`, `getBasenamesSubregistryId`, `getBasenamesSubregistryManagedName`, `getLineanamesSubregistryId`, `getLineanamesSubregistryManagedName`. | ||
| - **Added:** `getManagedName(namespace, contract)` — given any contract in the ENSv1 ecosystem, returns its Managed Name, namehash, and concrete ENSv1 Registry. Replaces the per-plugin helpers above. Also exposes `isNameWrapper(namespace, contract)`. | ||
| - **Added:** `getRootRegistryId(namespace)` returns the namespace's primary Root Registry (prefers ENSv2 when defined). `getRootRegistryIds(namespace)` returns every top-level Root Registry — concrete ENSv1 Root, Basenames/Lineanames `base.eth`/`linea.eth` ENSv1VirtualRegistries, and the ENSv2 Root when defined — for consumers that walk the full canonical-set tree. | ||
| - **Added:** `getENSv1RootRegistryId(namespace)`. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "ensapi": minor | ||
| --- | ||
|
|
||
| `Query.root` is now non-null and returns the namespace's Root Registry — preferring the ENSv2 Root Registry when defined, falling back to the ENSv1 Root Registry. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| "enssdk": minor | ||
| "@ensnode/ensdb-sdk": minor | ||
| "@ensnode/ensnode-sdk": minor | ||
| "ensindexer": minor | ||
| "ensapi": minor | ||
| --- | ||
|
|
||
| Unify `v1Domain` + `v2Domain` into a single polymorphic `domain` table discriminated by a `type` enum (`"ENSv1Domain"` | `"ENSv2Domain"`), and make Registry polymorphic across concrete ENSv1 (mainnet Registry, Basenames Registry, Lineanames Registry), ENSv1 Virtual (per-parent-domain virtual Registry managed by each ENSv1 domain that has children), and ENSv2 Registries. | ||
|
|
||
| ### Breaking schema + id format changes | ||
|
|
||
| - `ENSv1DomainId` is now CAIP-shaped: `${ENSv1RegistryId}/${node}` (was `Node`). Every ENSv1 Domain is addressable through a concrete Registry, so bare `node` values no longer identify a Domain by themselves. | ||
| - `RegistryId` is a union of `ENSv1RegistryId`, `ENSv1VirtualRegistryId`, and `ENSv2RegistryId`. New id constructors: `makeENSv1RegistryId`, `makeENSv2RegistryId`, `makeENSv1VirtualRegistryId`, and `makeConcreteRegistryId` (returns `ENSv1RegistryId | ENSv2RegistryId` for callsites that only need to address a concrete Registry contract). `makeENSv1DomainId` now takes `(AccountId, Node)`. | ||
| - `domains` table: replaces `v1_domains` + `v2_domains`. Adds `type`, nullable `tokenId` (non-null iff ENSv2), nullable `node` (non-null iff ENSv1), nullable `rootRegistryOwnerId` (v1 only). `parentId` removed; parent relationships flow through `registryCanonicalDomain` for both v1 and v2. | ||
| - `registries` table: adds `type` enum column and nullable `node` (non-null iff `ENSv1VirtualRegistry`). Unique `(chainId, address)` index becomes a plain index so virtual Registries can share their concrete parent's `(chainId, address)`. | ||
| - `registryCanonicalDomain.domainId` is typed as the unified `DomainId`. | ||
|
|
||
| ### GraphQL | ||
|
|
||
| - `Registry` becomes a GraphQL interface with `ENSv1Registry`, `ENSv1VirtualRegistry`, and `ENSv2Registry` implementations. `ENSv1VirtualRegistry` exposes `node: Node!`. | ||
| - `Domain` interface gains `parent: Domain` (resolved via the canonical-path dataloader); `ENSv1Domain` exposes `node: Node!` and `rootRegistryOwner`; `ENSv2Domain` exposes `tokenId`, `registry`, `subregistry`, `permissions`. | ||
| - `Query.registry(by: { contract })` now DB-looks up the concrete Registry by `(chainId, address, type IN (ENSv1Registry, ENSv2Registry))`. Virtual Registries are not addressable via `AccountId` alone. | ||
|
|
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.