-
Notifications
You must be signed in to change notification settings - Fork 16
Add indexing status guards for Subgraph API and Omnigraph API #2090
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
tk-o
merged 11 commits into
main
from
feat/2086-indexing-status-guard-for-subgraph-api-omnigraph-api
May 12, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
66618f3
Create indexing status based functions for checking feature availability
tk-o 166c95d
Implement backend guards for Omnigraph API and Subgraph API
tk-o c035500
Implement frontend guards for Omnigraph API and Subgraph API
tk-o 0d9c060
docs(changeset): Added indexing status based functions for checking O…
tk-o d660758
docs(changeset): Added indexing status based guard for Omnigraph API …
tk-o 9b21b64
docs(changeset): Added indexing status based guard for Omnigraph API …
tk-o b199319
Merge branch 'main' into feat/2086-indexing-status-guard-for-subgraph…
tk-o 6ca6704
Apply AI PR feedback
tk-o 9f5f0b5
Merge branch 'feat/2086-indexing-status-guard-for-subgraph-api-omnigr…
tk-o aefb6f6
Merge remote-tracking branch 'origin/main' into feat/2086-indexing-st…
tk-o cc89001
Apply PR feedback
tk-o 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 @@ | ||
| --- | ||
| "@ensnode/ensnode-sdk": minor | ||
| --- | ||
|
|
||
| Added indexing status based functions for checking Omnigraph API and Subgraph API availability. |
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 @@ | ||
| --- | ||
| "ensadmin": minor | ||
| --- | ||
|
|
||
| Added indexing status based guard for Omnigraph API and Subgraph API views. |
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 | ||
| --- | ||
|
|
||
| Added indexing status based guard for Omnigraph API and Subgraph API routes. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { type OmnichainIndexingStatusId, OmnichainIndexingStatusIds } from "../../indexing-status"; | ||
| import type { PrerequisiteResult } from "../../shared/prerequisites"; | ||
|
|
||
| /** | ||
| * Check if provided OmnichainIndexingStatusId indicates that the backfill is complete. | ||
| * | ||
| * This is a prerequisite for all APIs that rely on indexed data. We need to ensure that | ||
| * the backfill is complete to guarantee that the necessary data is completely indexed | ||
| * and available for queries. | ||
|
tk-o marked this conversation as resolved.
|
||
| */ | ||
| export function hasBackfillCompleted( | ||
| indexingStatus: OmnichainIndexingStatusId, | ||
| ): PrerequisiteResult { | ||
| const supported = | ||
| indexingStatus === OmnichainIndexingStatusIds.Completed || | ||
| indexingStatus === OmnichainIndexingStatusIds.Following; | ||
|
|
||
| if (supported) return { supported }; | ||
|
|
||
| return { | ||
| supported: false, | ||
| reason: `The connected ENSNode's Indexing Status must be "${OmnichainIndexingStatusIds.Completed}" or "${OmnichainIndexingStatusIds.Following}". Currently, it is "${indexingStatus}".`, | ||
| }; | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| import { type EnsIndexerPublicConfig, PluginName } from "../ensindexer/config/types"; | ||
| import { hasBackfillCompleted } from "../ensnode/api/prerequisites"; | ||
| import type { OmnichainIndexingStatusId } from "../indexing-status"; | ||
| import type { PrerequisiteResult } from "../shared/prerequisites"; | ||
|
|
||
| /** | ||
|
|
@@ -13,3 +15,12 @@ export function hasSubgraphApiConfigSupport(config: EnsIndexerPublicConfig): Pre | |
| reason: `The connected ENSNode's Config must have the '${PluginName.Subgraph}' plugin enabled.`, | ||
| }; | ||
| } | ||
|
|
||
| /** | ||
| * Check if provided OmnichainIndexingStatusId supports the Subgraph API. | ||
| */ | ||
| export function hasSubgraphApiIndexingStatusSupport( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. imo DRY up this impl and have the reason message just say `The connected ENSNode's Omnichain Indexing Status must be "${OmnichainIndexingStatusIds.Completed}" or "${OmnichainIndexingStatusIds.Following}". Current omnichain indexing status is "${indexingStatus}".` |
||
| indexingStatus: OmnichainIndexingStatusId, | ||
| ): PrerequisiteResult { | ||
| return hasBackfillCompleted(indexingStatus); | ||
| } | ||
|
tk-o marked this conversation as resolved.
tk-o marked this conversation as resolved.
|
||
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.