Skip to content

Commit 6bda3d6

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/indexing-metadata-context
2 parents 1902bfb + aa26180 commit 6bda3d6

36 files changed

Lines changed: 1002 additions & 226 deletions

.changeset/bright-rivers-flow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@namehash/ens-referrals": minor
3+
---
4+
5+
Add `BaseReferralProgramEditionConfig` as the shared parent of `ReferralProgramEditionConfig` and `BaseReferralProgramEditionSummary`.

.changeset/hip-poems-shave.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@ensnode/integration-test-env": patch
3+
"@docs/ensnode": patch
4+
---
5+
6+
Moved docker-compose.yml file to separate `docker` directory, updates docs and cicd-tests

.changeset/quiet-mirrors-shine.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@namehash/ens-referrals": minor
3+
---
4+
5+
Expose the per-award-model (`pie-split`, `rev-share-cap`) Zod schemas via `@namehash/ens-referrals/internal`.

.changeset/shiny-tigers-wander.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@namehash/ens-referrals": minor
3+
---
4+
5+
Reject overlapping referral program editions: for a given `subregistryId`, no two editions may share any point in time.

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ ENSNode is a modern, multichain indexer for ENS. It supports backwards-compatibl
8989

9090
Documentation for the ENSNode suite of apps is available at [ensnode.io](https://ensnode.io).
9191

92+
## Running with Docker
93+
94+
```bash
95+
docker compose -f docker/docker-compose.yml up -d
96+
```
97+
98+
See [`docker/README.md`](docker/README.md) for all use cases and commands.
99+
92100
## Contributions
93101

94102
We welcome community contributions and feedback—please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information.

apps/ensapi/src/cache/indexing-status.cache.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ export const indexingStatusCache = lazyProxy<SWRCache<CrossChainIndexingStatusSn
2525
if (
2626
indexingMetadataContext.statusCode !== IndexingMetadataContextStatusCodes.Initialized
2727
) {
28-
// An indexing status snapshot has not been found in ENSDb yet.
28+
// The Indexing Metadata Context has not been initialized in ENSDb yet.
2929
// This might happen during application startup, i.e. when ENSDb
3030
// has not yet been populated with the first snapshot.
3131
// Therefore, throw an error to trigger the subsequent `.catch` handler.
32-
throw new Error("Indexing Status snapshot not found in ENSDb yet.");
32+
throw new Error("Indexing Metadata Context was uninitialized in ENSDb.");
3333
}
3434

3535
// The indexing status snapshot has been fetched and successfully validated for caching.
@@ -39,14 +39,14 @@ export const indexingStatusCache = lazyProxy<SWRCache<CrossChainIndexingStatusSn
3939
return indexingMetadataContext.indexingStatus;
4040
})
4141
.catch((error) => {
42-
// Either the indexing status snapshot fetch failed, or the indexing status snapshot was not found in ENSDb yet.
42+
// Indexing Metadata Context was uninitialized in ENSDb.
4343
// Therefore, throw an error so that this current invocation of `readCache` will:
4444
// - Reject the newly fetched response (if any) such that it won't be cached.
4545
// - Return the most recently cached value from prior invocations, or `null` if no prior invocation successfully cached a value.
4646
logger.error(
4747
error,
48-
`Error occurred while loading Indexing Status snapshot record from ENSNode Metadata table in ENSDb. ` +
49-
`Where clause applied: ("ensIndexerSchemaName" = "${ensDbClient.ensIndexerSchemaName}", "key" = "${EnsNodeMetadataKeys.EnsIndexerIndexingStatus}"). ` +
48+
`Error occurred while loading Indexing Metadata Context record from ENSNode Metadata table in ENSDb. ` +
49+
`Where clause applied: ("ensIndexerSchemaName" = "${ensDbClient.ensIndexerSchemaName}", "key" = "${EnsNodeMetadataKeys.IndexingMetadataContext}"). ` +
5050
`The cached indexing status snapshot (if any) will not be updated.`,
5151
);
5252
throw error;

apps/ensapi/src/handlers/ensanalytics/ensanalytics-api.test.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
type ReferralProgramEditionSlug,
3434
ReferralProgramEditionStatuses,
3535
ReferralProgramEditionSummariesResponseCodes,
36+
type ReferralProgramRulesPieSplit,
3637
ReferrerEditionMetricsTypeIds,
3738
type ReferrerLeaderboard,
3839
ReferrerLeaderboardPageResponseCodes,
@@ -868,20 +869,33 @@ describe("/v1/ensanalytics", () => {
868869
},
869870
);
870871

871-
// Mock caches middleware with a cache for each edition
872+
// Each leaderboard carries its edition's own rules so the per-edition summaries don't
873+
// collapse onto a single time window and trip the non-overlap invariant on the response.
874+
const leaderboardFor = (config: {
875+
rules: ReferralProgramRulesPieSplit;
876+
}): ReferrerLeaderboard => ({
877+
...emptyReferralLeaderboard,
878+
rules: config.rules,
879+
});
872880
const mockEditionsCaches = new Map<ReferralProgramEditionSlug, SWRCache<ReferrerLeaderboard>>(
873881
[
874882
[
875883
"2025-12",
876-
{ read: async () => emptyReferralLeaderboard } as SWRCache<ReferrerLeaderboard>,
884+
{
885+
read: async () => leaderboardFor(mockEditionConfigSet.get("2025-12")!),
886+
} as SWRCache<ReferrerLeaderboard>,
877887
],
878888
[
879889
"2026-03",
880-
{ read: async () => emptyReferralLeaderboard } as SWRCache<ReferrerLeaderboard>,
890+
{
891+
read: async () => leaderboardFor(mockEditionConfigSet.get("2026-03")!),
892+
} as SWRCache<ReferrerLeaderboard>,
881893
],
882894
[
883895
"2026-06",
884-
{ read: async () => emptyReferralLeaderboard } as SWRCache<ReferrerLeaderboard>,
896+
{
897+
read: async () => leaderboardFor(mockEditionConfigSet.get("2026-06")!),
898+
} as SWRCache<ReferrerLeaderboard>,
885899
],
886900
],
887901
);

apps/ensindexer/.env.local.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ ENSRAINBOW_URL=http://localhost:3223
243243
# https://ensnode.io/ensrainbow/usage/available-label-sets
244244
#
245245
# LABEL_SET_ID: see https://ensnode.io/ensrainbow/concepts/glossary#label-set-id.
246+
# Should match ENSRainbow's LABEL_SET_ID.
246247
LABEL_SET_ID=subgraph
247248

248249
# LABEL_SET_VERSION: see https://ensnode.io/ensrainbow/concepts/glossary#label-set-version.

apps/ensrainbow/.env.local.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LOG_LEVEL=info
1616
DB_SCHEMA_VERSION=3
1717

1818
# Label set ID (see https://ensnode.io/ensrainbow/concepts/glossary#label-set-id)
19-
LABEL_SET_ID=ens-test-env
19+
LABEL_SET_ID=subgraph
2020

2121
# Label set version (see https://ensnode.io/ensrainbow/concepts/glossary#label-set-version)
2222
LABEL_SET_VERSION=0

docker-compose.yml

Lines changed: 0 additions & 127 deletions
This file was deleted.

0 commit comments

Comments
 (0)