Skip to content

Conversation

@tk-o
Copy link
Contributor

@tk-o tk-o commented May 30, 2025

This PR includes refactorings around ENSIndexerConfig that allow dropping unnecessary imports and replace them with new derived configuration parameters: ensDeployment.

Suggested review order:

  1. apps/ensindexer/src/plugins: all plugins read the ensDeployment directly from the appConfig object.
  2. apps/ensindexer/src/plugins/basenames/basenames.plugin.ts: ensDeployment includes some ABIs, which I figured will be best not to be shown due to their length
  3. apps/ensindexer/src/config/types.ts: including ensDeployment config param
  4. apps/ensindexer/src/config/config.schema.ts: moved all derive functionality into its own file
  5. apps/ensindexer/src/config/derived-params.ts: derive functionality for isSubgraphCompatible (moved), and ensDeployment (newly added)

Resolves:

@changeset-bot
Copy link

changeset-bot bot commented May 30, 2025

🦋 Changeset detected

Latest commit: 7c29440

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
ensindexer Minor
ensadmin Minor
ensrainbow Minor
@ensnode/ens-deployments Minor
@ensnode/ensrainbow-sdk Minor
@ensnode/ponder-metadata Minor
@ensnode/ensnode-schema Minor
@ensnode/ponder-subgraph Minor
@ensnode/ensnode-sdk Minor
@ensnode/shared-configs Minor

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

@vercel
Copy link
Contributor

vercel bot commented May 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
admin.ensnode.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2025 3:32pm
ensnode.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2025 3:32pm
ensrainbow.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2025 3:32pm

Comment on lines -157 to -178
const derive_isSubgraphCompatible = <
CONFIG extends Pick<
ENSIndexerConfig,
"plugins" | "healReverseAddresses" | "indexAdditionalResolverRecords"
>,
>(
config: CONFIG,
): CONFIG & { isSubgraphCompatible: boolean } => {
// 1. only the subgraph plugin is active
const onlySubgraphPluginActivated =
config.plugins.length === 1 && config.plugins[0] === PluginName.Subgraph;

// 2. healReverseAddresses = false
// 3. indexAdditionalResolverRecords = false
const indexingBehaviorIsSubgraphCompatible =
!config.healReverseAddresses && !config.indexAdditionalResolverRecords;

return {
...config,
isSubgraphCompatible: onlySubgraphPluginActivated && indexingBehaviorIsSubgraphCompatible,
};
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to apps/ensindexer/src/config/derived-params.ts

@tk-o
Copy link
Contributor Author

tk-o commented May 30, 2025

Replaced with #765 which also solves for typescript type inference.

@tk-o tk-o closed this May 30, 2025
@lightwalker-eth lightwalker-eth deleted the feat/757-761-improve-ensindexerconfig branch January 17, 2026 16:46
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.

2 participants