-
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
Open
shrugs
wants to merge
26
commits into
main
Choose a base branch
from
refactor/ensv1-domain-model
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 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 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,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`. `makeENSv1DomainId` now takes `(AccountId, Node)`. `makeRegistryId` is retained as a union-returning helper for callsites that can't narrow. | ||
| - `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.