Conversation
…dexerStackInfo`, `EnsDbStackInfo`, `EnsNodeStackInfo`.
…nsNodeStackInfo*` pattern.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 2955218 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughA PR introducing Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~55 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR extends the stack info data model by introducing two new intermediate types — The previous P1 concern (missing Confidence Score: 5/5Safe to merge — the previous P1 concern is resolved and all remaining findings are minor style suggestions. The previous P1 (missing No files require special attention. Important Files Changed
Class Diagram%%{init: {'theme': 'neutral'}}%%
classDiagram
class EnsIndexerStackInfo {
+EnsIndexerPublicConfig ensIndexer
+EnsRainbowPublicConfig ensRainbow
}
class EnsDbStackInfo {
+EnsDbPublicConfig ensDb
}
class EnsNodeStackInfo {
+EnsApiPublicConfig ensApi
}
EnsIndexerStackInfo <|-- EnsDbStackInfo
EnsDbStackInfo <|-- EnsNodeStackInfo
class SerializedEnsIndexerStackInfo {
+SerializedEnsIndexerPublicConfig ensIndexer
+SerializedEnsRainbowPublicConfig ensRainbow
}
class SerializedEnsDbStackInfo {
+SerializedEnsDbPublicConfig ensDb
}
class SerializedEnsNodeStackInfo {
+SerializedEnsApiPublicConfig ensApi
}
SerializedEnsIndexerStackInfo <|-- SerializedEnsDbStackInfo
SerializedEnsDbStackInfo <|-- SerializedEnsNodeStackInfo
Reviews (2): Last reviewed commit: "Update OpenAPI Spec" | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/ensnode-sdk/src/stack-info/zod-schemas/ensnode-stack-info.ts (1)
14-34: 🧹 Nitpick | 🔵 TrivialConsider composing via
makeEnsDbStackInfoSchemafor consistency.The serialize/deserialize layer and the
SerializedEnsNodeStackInfotype both compose via the newEnsDbStackInfohelpers. These Zod schemas still enumerate all fields directly. For consistency (and to pick up theinvariant_ensRainbowCompatibilityWithEnsIndexercheck thatmakeEnsDbStackInfoSchemaapplies), consider:♻️ Proposed refactor
export function makeSerializedEnsNodeStackInfoSchema(valueLabel?: string) { const label = valueLabel ?? "ENSNodeStackInfo"; - return z.object({ - ensApi: makeSerializedEnsApiPublicConfigSchema(`${label}.ensApi`), - ensDb: makeEnsDbPublicConfigSchema(`${label}.ensDb`), - ensIndexer: makeSerializedEnsIndexerPublicConfigSchema(`${label}.ensIndexer`), - ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`), - }); + return makeSerializedEnsDbStackInfoSchema(label).extend({ + ensApi: makeSerializedEnsApiPublicConfigSchema(`${label}.ensApi`), + }); }Otherwise, tightening
ensRainbowto required is correct given the extended-type hierarchy.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ensnode-sdk/src/stack-info/zod-schemas/ensnode-stack-info.ts` around lines 14 - 34, Replace the explicit field enumeration in makeSerializedEnsNodeStackInfoSchema and makeEnsNodeStackInfoSchema with composition via the existing EnsDb stack helpers: use makeSerializedEnsDbStackInfoSchema(...) inside makeSerializedEnsNodeStackInfoSchema and makeEnsDbStackInfoSchema(...) inside makeEnsNodeStackInfoSchema (passing the same composed label) so the schemas pick up the shared structure and the invariant_ensRainbowCompatibilityWithEnsIndexer check applied by the EnsDb helpers instead of re-declaring ensApi, ensDb, ensIndexer, ensRainbow locally.packages/ensnode-sdk/src/stack-info/ensnode-stack-info.ts (1)
17-25:⚠️ Potential issue | 🟡 MinorKeep the builder documentation in sync with the expanded signature.
The function now also requires ENSIndexer and ENSRainbow configs, but the summary still says it builds only from ENSApi and ENSDb.
Proposed documentation update
/** * Build a complete {`@link` EnsNodeStackInfo} object from - * the given public configs of ENSApi and ENSDb. + * the given public configs of ENSApi, ENSDb, ENSIndexer, and ENSRainbow. */🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ensnode-sdk/src/stack-info/ensnode-stack-info.ts` around lines 17 - 25, Update the JSDoc for buildEnsNodeStackInfo to reflect the expanded parameters: mention that it builds a complete EnsNodeStackInfo from the public configs of ENSApi, ENSDb, ENSIndexer, and ENSRainbow; update the `@param` list to include EnsIndexerPublicConfig and EnsRainbowPublicConfig and adjust the summary sentence accordingly so it no longer only references ENSApi and ENSDb.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/ensadmin/src/app/mock/stack-info/page.tsx`:
- Around line 27-32: The mock error case for "Loading Error" uses stale copy
referring to "ENSNodeConfigInfo" and "ENSIndexer Config"; update the returned
error object inside the case "Loading Error" (the error.title and
error.description strings) to reflect the stack info context — e.g., change
error.title to something like "StackInfo Error" and error.description to a
message about failing to fetch Stack Info — so the mock accurately matches the
stack info flow exercised by this page.tsx case.
In `@apps/ensadmin/src/app/mock/stack-info/stack-info.mock.ts`:
- Around line 7-413: The mock has large duplicated sub-objects
(ensRainbowPublicConfig, ensIndexerPublicConfig, ensIndexer, ensRainbow, ensDb,
versionInfo) inside mockSerializedEnsNodeStackInfo; extract shared fragments
like const baseVersionInfo, baseEnsDb, baseEnsRainbowPublicConfig, and
baseEnsIndexerPublicConfig and then build each variant by composing/spreading
those bases and only overriding the few fields that differ (e.g.
indexedChainIds, namespace, plugins, ensIndexerSchemaName); update
mockSerializedEnsNodeStackInfo to reference those constants so the four "happy
path" variants reuse the same base objects while preserving the final
"Deserialization Error" variant intact, and keep the overall export typed with
as const satisfies Record<string, SerializedEnsNodeStackInfo>.
In `@packages/ensnode-sdk/src/stack-info/deserialize/ensdb-stack-info.ts`:
- Around line 12-18: The JSDoc for the builder of EnsDbStackInfo contains a
redundant "@return" tag that merely repeats the summary; remove the "@return"
line from the JSDoc block that documents the function which constructs an
EnsDbStackInfo (referenced alongside makeEnsDbStackInfoSchema and
EnsDbStackInfo) so the doc only keeps the descriptive summary and parameter docs
without the duplicated return tag.
In `@packages/ensnode-sdk/src/stack-info/deserialize/ensindexer-stack-info.ts`:
- Around line 12-18: Remove the redundant JSDoc `@return` tag from the JSDoc block
that documents the function building an unvalidated EnsIndexerStackInfo (the doc
that references {`@link` EnsIndexerStackInfo} and {`@link`
makeEnsIndexerStackInfoSchema}); keep the summary and the `@param` but delete the
`@return` line so the comment no longer restates the method summary.
In `@packages/ensnode-sdk/src/stack-info/zod-schemas/ensdb-stack-info.ts`:
- Around line 8-24: The label fallback is applied only to the ensDb subpath,
causing inconsistent error path prefixes because
makeSerializedEnsIndexerStackInfoSchema and makeEnsIndexerStackInfoSchema are
called with valueLabel rather than the resolved label; change both calls in
makeSerializedEnsDbStackInfoSchema and makeEnsDbStackInfoSchema to pass the
resolved label variable (label) instead of valueLabel so nested indexer/rainbow
errors use the same unified prefix as ensDb (and keep the rest of each function
unchanged).
---
Outside diff comments:
In `@packages/ensnode-sdk/src/stack-info/ensnode-stack-info.ts`:
- Around line 17-25: Update the JSDoc for buildEnsNodeStackInfo to reflect the
expanded parameters: mention that it builds a complete EnsNodeStackInfo from the
public configs of ENSApi, ENSDb, ENSIndexer, and ENSRainbow; update the `@param`
list to include EnsIndexerPublicConfig and EnsRainbowPublicConfig and adjust the
summary sentence accordingly so it no longer only references ENSApi and ENSDb.
In `@packages/ensnode-sdk/src/stack-info/zod-schemas/ensnode-stack-info.ts`:
- Around line 14-34: Replace the explicit field enumeration in
makeSerializedEnsNodeStackInfoSchema and makeEnsNodeStackInfoSchema with
composition via the existing EnsDb stack helpers: use
makeSerializedEnsDbStackInfoSchema(...) inside
makeSerializedEnsNodeStackInfoSchema and makeEnsDbStackInfoSchema(...) inside
makeEnsNodeStackInfoSchema (passing the same composed label) so the schemas pick
up the shared structure and the invariant_ensRainbowCompatibilityWithEnsIndexer
check applied by the EnsDb helpers instead of re-declaring ensApi, ensDb,
ensIndexer, ensRainbow locally.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 16627062-6551-4ce9-97b8-14f89d71638f
📒 Files selected for processing (24)
.changeset/clear-rabbits-punch.md.changeset/fifty-games-smash.mdapps/ensadmin/src/app/@breadcrumbs/mock/stack-info/page.tsxapps/ensadmin/src/app/mock/config-info/data.jsonapps/ensadmin/src/app/mock/config-info/page.tsxapps/ensadmin/src/app/mock/page.tsxapps/ensadmin/src/app/mock/stack-info/page.tsxapps/ensadmin/src/app/mock/stack-info/stack-info.mock.tsapps/ensadmin/src/components/connection/cards/ensnode-stack-info.tsxapps/ensadmin/src/components/connection/index.tsxapps/ensapi/src/cache/stack-info.cache.tspackages/ensnode-sdk/src/stack-info/deserialize/ensdb-stack-info.tspackages/ensnode-sdk/src/stack-info/deserialize/ensindexer-stack-info.tspackages/ensnode-sdk/src/stack-info/deserialize/ensnode-stack-info.tspackages/ensnode-sdk/src/stack-info/ensdb-stack-info.tspackages/ensnode-sdk/src/stack-info/ensindexer-stack-info.tspackages/ensnode-sdk/src/stack-info/ensnode-stack-info.tspackages/ensnode-sdk/src/stack-info/index.tspackages/ensnode-sdk/src/stack-info/serialize/ensdb-stack-info.tspackages/ensnode-sdk/src/stack-info/serialize/ensindexer-stack-info.tspackages/ensnode-sdk/src/stack-info/serialize/ensnode-stack-info.tspackages/ensnode-sdk/src/stack-info/zod-schemas/ensdb-stack-info.tspackages/ensnode-sdk/src/stack-info/zod-schemas/ensindexer-stack-info.tspackages/ensnode-sdk/src/stack-info/zod-schemas/ensnode-stack-info.ts
💤 Files with no reviewable changes (2)
- apps/ensadmin/src/app/mock/config-info/page.tsx
- apps/ensadmin/src/app/mock/config-info/data.json
There was a problem hiding this comment.
Pull request overview
Extends @ensnode/ensnode-sdk’s “stack info” domain model into layered types (EnsIndexerStackInfo → EnsDbStackInfo → EnsNodeStackInfo), with corresponding zod schemas and (de)serialization helpers, and updates ENSApi + ENSAdmin to consume the updated model and renamed UI components/mocks.
Changes:
- Added new stack-info models for ENSIndexer and ENSDb, and refactored ENSNode stack info to extend them.
- Added serialize/deserialize + zod schemas for the new stack-info layers.
- Updated ENSApi stack-info cache builder and ENSAdmin UI/mocks/routes to use the new stack-info naming and structure.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ensnode-sdk/src/stack-info/zod-schemas/ensnode-stack-info.ts | Makes ensRainbow required in ENSNode stack-info zod schemas. |
| packages/ensnode-sdk/src/stack-info/zod-schemas/ensindexer-stack-info.ts | New zod schemas + invariant check for EnsIndexerStackInfo. |
| packages/ensnode-sdk/src/stack-info/zod-schemas/ensdb-stack-info.ts | New zod schemas composing EnsIndexerStackInfo + ENSDb config. |
| packages/ensnode-sdk/src/stack-info/serialize/ensnode-stack-info.ts | Refactors ENSNode stack-info serialization to compose via ENSDb stack-info serializer. |
| packages/ensnode-sdk/src/stack-info/serialize/ensindexer-stack-info.ts | New serializer + serialized type for EnsIndexerStackInfo. |
| packages/ensnode-sdk/src/stack-info/serialize/ensdb-stack-info.ts | New serializer + serialized type for EnsDbStackInfo. |
| packages/ensnode-sdk/src/stack-info/index.ts | Exports new stack-info layers and their (de)serializers. |
| packages/ensnode-sdk/src/stack-info/ensnode-stack-info.ts | EnsNodeStackInfo now extends EnsDbStackInfo; builder signature updated. |
| packages/ensnode-sdk/src/stack-info/ensindexer-stack-info.ts | New EnsIndexerStackInfo interface + builder. |
| packages/ensnode-sdk/src/stack-info/ensdb-stack-info.ts | New EnsDbStackInfo interface + builder extending EnsIndexerStackInfo. |
| packages/ensnode-sdk/src/stack-info/deserialize/ensnode-stack-info.ts | EnsNodeStackInfo deserialization now composes through EnsDbStackInfo deserialization. |
| packages/ensnode-sdk/src/stack-info/deserialize/ensindexer-stack-info.ts | New deserializer for EnsIndexerStackInfo. |
| packages/ensnode-sdk/src/stack-info/deserialize/ensdb-stack-info.ts | New deserializer for EnsDbStackInfo. |
| apps/ensapi/src/cache/stack-info.cache.ts | Updates stack-info construction to pass explicit indexer/rainbow configs. |
| apps/ensadmin/src/components/connection/index.tsx | Switches connection details card to the renamed stack-info component. |
| apps/ensadmin/src/components/connection/cards/ensnode-stack-info.tsx | Renames ENSNodeConfig* components to EnsNodeStackInfo* and updates ENSRainbow field access. |
| apps/ensadmin/src/app/mock/stack-info/stack-info.mock.ts | Adds mock SerializedEnsNodeStackInfo variants for UI testing. |
| apps/ensadmin/src/app/mock/stack-info/page.tsx | Adds new UI mock page to render stack-info variants via deserialization. |
| apps/ensadmin/src/app/mock/page.tsx | Updates mock list link to the new /mock/stack-info page. |
| apps/ensadmin/src/app/mock/config-info/page.tsx | Removes old config-info mock page. |
| apps/ensadmin/src/app/mock/config-info/data.json | Removes old config-info mock data. |
| apps/ensadmin/src/app/@breadcrumbs/mock/stack-info/page.tsx | Adds breadcrumbs for the new stack-info mock route. |
| .changeset/fifty-games-smash.md | Changeset for SDK minor bump due to new stack-info models/exports. |
| .changeset/clear-rabbits-punch.md | Changeset for ENSAdmin minor bump due to component renames. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@greptile review |
| ctx.issues.push({ | ||
| code: "custom", | ||
| input: ctx.value, | ||
| message: `ENSRainbow's label set (id: ${ensRainbow.labelSet.labelSetId}) must be same as the ENSIndexer's label set (id: ${ensIndexer.labelSet.labelSetId}).`, |
There was a problem hiding this comment.
| message: `ENSRainbow's label set (id: ${ensRainbow.labelSet.labelSetId}) must be same as the ENSIndexer's label set (id: ${ensIndexer.labelSet.labelSetId}).`, | |
| message: `ENSRainbow's label set (id: ${ensRainbow.labelSet.labelSetId}) must be the same as the ENSIndexer's label set (id: ${ensIndexer.labelSet.labelSetId}).`, |
Grammar issue in error message: "must be same as the" should be "must be the same as"
Lite PR
Tip: Review docs on the ENSNode PR process
Summary
EnsIndexerStackInfodata model which includesensIndexerPublicConfigandensRainbowPublicConfig.EnsDbStackInfodata model which extendsEnsIndexerStackInfo, and includesensDbPublicConfig.EnsNodeStackInfodata model which extendsEnsDbStackInfo, and includesensApiPublicConfig.ensRainbow: EnsRainbowPublicConfigis now required field across all stack info data modelsEnsNodeStackInfoobject into ENSNode Metadata table in ENSDb yet, so we while creatingEnsNodeStackInfoobject in ENSApi runtime, we leverege the fact thatensIndexerPublicConfig.ensIndexerPublicConfigis always present.Why
Testing
Notes for Reviewer (Optional)
IndexingMetadataContextdata model.IndexingMetadataContextdata model).ensIndexerPublicConfigfield fromEnsApiPublicConfigdata model.ensRainbowPublicConfigfield fromEnsIndexerPublicConfigdata model.recordsCountfield fromEnsRainbowPublicConfigdata model.Pre-Review Checklist (Blocking)