Skip to content

Conversation

@tk-o
Copy link
Contributor

@tk-o tk-o commented Aug 15, 2025

This PR aims to replace ENSAdmin dependency on the /metadata endpoint with new ENSNode APIs: Config API and Indexing Status API.

This PR does not aim to create a perfect data model for ENSAdmin. The PR builds on top of the current data model, and replaces its parts where needed.

Suggested review order:

  1. packages/ensnode-sdk
  2. apps/ensindexer
  3. apps/ensadmin

ENSNode SDK

This PR extends the ENSNodeClient class by:

  • config() method to access Config API, and
  • indexingStatus() method to access Indexing Status API.
    • uses custom server error codes to enable distinguishing error responses on the client side

Both methods return fully validated data models.

Moreover, the ChainIndexingBackfillStatus now includes latestSyncedBlock field to highlight the progress of building RPC cache. Relevant invariants have been updated.

There are three new helper methods added in the indexing-status module:

  • getTimestampForLowestOmnichainStartBlock
  • getTimestampForHighestOmnichainKnownBlock
  • sortAscChainStatusesByStartBlock

All of them come handy while working with a client data model, such as indexing timeline, which needs to know when the indexing started, and where the latest known block is. Also, Sorting chains by config.startBlock allows nice UX.

ENSIndexer

  • Integrates the newlatestSyncedBlock field for the backfill chain statuses.
  • Uses new response codes for handling Indexing Status API responses.
  • Provides backward compatibility for older ENSRainbow Version endpoint data model.

ENSAdmin

  • Introduces hooks (useENSIndexerConfig, useIndexingStatus) for using the new ENSNodeClient methods: config() and indexingStatus().
  • Updates the Recent Registrations module to rely solely on the new hooks from the point above.
  • Splits the components.tsx file of Indexing Status module into more files which focus on specific ideas.
    • Also uses new hooks (useENSIndexerConfig, useIndexingStatus) to interact with ENSNode APIs.

Introduce `config()` method for the Confing API, and the `indexingStatus()` method for the Indexing Status API.
@changeset-bot
Copy link

changeset-bot bot commented Aug 15, 2025

🦋 Changeset detected

Latest commit: 95356d9

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

This PR includes changesets to release 13 packages
Name Type
@ensnode/ensnode-sdk Minor
ensindexer Minor
ensadmin Minor
ensrainbow Minor
@ensnode/ensnode-react Minor
@ensnode/ensrainbow-sdk Minor
@ensnode/datasources Minor
@ensnode/ponder-metadata Minor
@ensnode/ensnode-schema Minor
@ensnode/ponder-subgraph Minor
@ensnode/shared-configs Minor
@docs/ensnode Minor
@docs/ensrainbow 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

vercel bot commented Aug 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
admin.ensnode.io Ready Ready Preview Comment Aug 21, 2025 9:38pm
ensnode.io Ready Ready Preview Comment Aug 21, 2025 9:38pm
ensrainbow.io Ready Ready Preview Comment Aug 21, 2025 9:38pm

tk-o added 3 commits August 15, 2025 19:19
Use unassigned server error codes to interpret server errors on the client side
Intergrate the Indexing Status API from ENSNode.
Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@tk-o Thanks for the updates here 👍 Reviewed and shared feedback.

const ensRainbowApiClient = getENSRainbowApiClient();
const { versionInfo: ensRainbowDependencyInfo } = await ensRainbowApiClient.version();

// use a fallback for backwards compatibility
Copy link
Member

@lightwalker-eth lightwalker-eth Aug 19, 2025

Choose a reason for hiding this comment

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

FOR POST-MERGE FOLLOW UP:

I believe this fallback is only for the purpose of ENSRainbow before we merged the big PR #612

But now that is merged and therefore this fallback should no longer be needed. We should always have ensRainbowDependencyInfo.dbSchemaVersion now I believe.

Additional goal: Remove the @ts-ignore.

);
}
// Get the current indexing date from the indexing status
const currentIndexingDate =
Copy link
Member

@lightwalker-eth lightwalker-eth Aug 19, 2025

Choose a reason for hiding this comment

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

FOR POST-MERGE FOLLOW UP:

I recorded a future follow up opportunity here: #946

* Sort a list of [{@link ChainId}, {@link ChainIndexingStatus}] tuples
* by start block timestamp in ascending order.
*/
export function sortAscChainStatusesByStartBlock<ChainStatusType extends ChainIndexingStatus>(
Copy link
Member

@lightwalker-eth lightwalker-eth Aug 19, 2025

Choose a reason for hiding this comment

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

FOR POST-MERGE FOLLOW UP:

Suggested change
export function sortAscChainStatusesByStartBlock<ChainStatusType extends ChainIndexingStatus>(
export function sortEarliestOmnichainStartBlock<ChainIndexingStatusType extends ChainIndexingStatus>(

Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

I think we're good to merge this now 🚀

@lightwalker-eth lightwalker-eth changed the title feat(ensnode-sdk): extend the client New Indexing Status UI + config and indexing-status endpoint support to ensnode-sdk and ensnode-react Aug 21, 2025
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.

4 participants