Skip to content

Replace ponder.on with addOnchainEventListener#1839

Merged
tk-o merged 11 commits intomainfrom
feat/add-onchain-event-listener
Mar 30, 2026
Merged

Replace ponder.on with addOnchainEventListener#1839
tk-o merged 11 commits intomainfrom
feat/add-onchain-event-listener

Conversation

@tk-o
Copy link
Copy Markdown
Contributor

@tk-o tk-o commented Mar 28, 2026

Lite PR

Tip: Review docs on the ENSNode PR process

Summary

  • Created the addOnchainEventListener as a thin wrapper over ponder.on function.
    • See apps/ensindexer/src/lib/indexing-engines/ponder.ts
  • Replaced all ponder.on calls with addOnchainEventListener.
  • For ENSIndexer event handlers
    • Replaced context.db with context.ensDb
    • Replaced schema with ensIndexerSchema

Why

  • We need to add some control logic to execute the "init indexing" strategy which includes ensuring that ENSRainbow instance is ready to serve HTTP traffic before the indexing is started. There was an idea discussed for implementing the initIndexing strategy, which would initially require ENSRainbow instance to be ready before the onchain events indexing could start.

Testing

  • Extended testing suite.
  • Ran ENSIndexer locally to ensure that there was no change in indexing behaviour.

Notes for Reviewer (Optional)

  • Please review commit-by-commit
  • There will be a lot whitespaces update due to code auto formatting. Please make sure to turn the "Hide whitespaces" option on
    image

Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.
  • Relevant changesets are included (or are not required)

@tk-o tk-o requested a review from a team as a code owner March 28, 2026 11:40
Copilot AI review requested due to automatic review settings March 28, 2026 11:40
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 28, 2026

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

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
admin.ensnode.io Skipped Skipped Mar 30, 2026 6:03am
ensnode.io Skipped Skipped Mar 30, 2026 6:03am
ensrainbow.io Skipped Skipped Mar 30, 2026 6:03am

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 28, 2026

🦋 Changeset detected

Latest commit: 5fca5f5

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

This PR includes changesets to release 19 packages
Name Type
ensindexer Major
ensadmin Major
ensrainbow Major
ensapi Major
fallback-ensapi Major
@ensnode/datasources Major
@ensnode/ensrainbow-sdk Major
@ensnode/ensdb-sdk Major
@ensnode/ensnode-react Major
@ensnode/ensnode-sdk Major
@ensnode/ponder-sdk Major
@ensnode/ponder-subgraph Major
@ensnode/shared-configs Major
@docs/ensnode Major
@docs/ensrainbow Major
@docs/mintlify Major
@namehash/ens-referrals Major
@namehash/namehash-ui Major
@ensnode/integration-test-env Patch

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 28, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Replaces direct ponder.on event registrations with a new addOnchainEventListener wrapper, introduces IndexingEngineContext (adds ensDb), and migrates handlers and helpers to use context.ensDb with ensIndexerSchema instead of context.db/schema.

Changes

Cohort / File(s) Summary
Changeset & Indexing engine core
​.changeset/bold-bananas-jump.md, apps/ensindexer/src/lib/indexing-engines/ponder.ts, apps/ensindexer/src/lib/indexing-engines/ponder.test.ts
Adds changeset; new IndexingEngineContext and addOnchainEventListener wrapper; unit tests for wrapper behavior and context enrichment.
Global event wiring (many handlers)
apps/ensindexer/src/plugins/.../*, apps/ensindexer/src/plugins/subgraph/.../*, apps/ensindexer/src/plugins/registrars/.../*, apps/ensindexer/src/plugins/tokenscope/.../*
Replaces ponder.on(...) with addOnchainEventListener(...) across many modules; removes runtime ponder imports; updates handler parameter types from ContextIndexingEngineContext.
ENSv1 & ENSv2 handlers
apps/ensindexer/src/plugins/ensv2/handlers/ensv1/*.ts, apps/ensindexer/src/plugins/ensv2/handlers/ensv2/*.ts
Wires BaseRegistrar, Registry, NameWrapper, RegistrarController, ETHRegistrar, EnhancedAccessControl, etc., to new listener API; adapts DB access to context.ensDb/ensIndexerSchema.
Subgraph & Protocol-acceleration handlers
apps/ensindexer/src/plugins/subgraph/.../*, apps/ensindexer/src/plugins/protocol-acceleration/handlers/*.ts
Swaps event registrations to wrapper, switches handler context type, and redirects DB calls to ensDb + ensIndexerSchema.
Helpers & DB/schema migration
apps/ensindexer/src/lib/**, apps/ensindexer/src/plugins/**/lib/**/*.ts
Updates many helper signatures to accept IndexingEngineContext; routes all DB operations from context.db/schema.*context.ensDb/ensIndexerSchema.*.
Registrar shared libraries
apps/ensindexer/src/plugins/registrars/shared/lib/*.ts
Re-typed registrar helpers to use IndexingEngineContext/IndexingEngineEvent; migrated schema references and DB calls to ensIndexerSchema/ensDb.
Tokenscope / NFT handlers
apps/ensindexer/src/plugins/tokenscope/handlers/*.ts, apps/ensindexer/src/plugins/tokenscope/lib/handle-nft-transfer.ts
Replaced event registrations with wrapper API; updated NFT-related DB reads/writes to use context.ensDb and ensIndexerSchema tables.
Tests & infra
apps/ensindexer/src/lib/indexing-engines/ponder.test.ts
Adds tests asserting wrapper registers with ponder.on, enriches context with ensDb, preserves event passthrough, supports multiple handlers, and propagates errors/async behavior.

Sequence Diagram(s)

sequenceDiagram
    participant Ponder as ponder.on
    participant Wrapper as addOnchainEventListener
    participant Handler as Event Handler
    participant DB as ensDb (ensIndexerSchema)

    rect rgba(200,200,255,0.5)
    Ponder->>Wrapper: register(eventName, wrappedCallback)
    end

    rect rgba(200,255,200,0.5)
    Note right of Wrapper: on event, wrapper builds\nIndexingEngineContext { ... , ensDb: context.db }
    Wrapper->>Handler: invoke({ context: IndexingEngineContext, event })
    end

    rect rgba(255,200,200,0.5)
    Handler->>DB: read/write using ensIndexerSchema
    DB-->>Handler: result
    end

    Handler-->>Wrapper: (return / promise)
    Wrapper-->>Ponder: (propagate return / unsubscribe handle)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐇 I hopped from ponder.on into the light,
I stitched a context and gave ensDb its bite,
Events now call with a softer cheer,
Handlers sip rows from the new store near,
Hop, listen, index — I celebrate tonight! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 69.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Replace ponder.on with addOnchainEventListener' directly and clearly describes the main change in the changeset—the replacement of a legacy event listener function with a new wrapper.
Description check ✅ Passed The PR description follows the required template structure with all major sections completed: Summary (3 bullets covering the wrapper creation, replacement, and schema updates), Why (motivation for init indexing strategy), Testing (extended test suite and local validation), Notes for Reviewer (commit-by-commit review guidance), and Pre-Review Checklist (both items marked complete).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-onchain-event-listener

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Introduces a new addOnchainEventListener helper (wrapping ponder.on) and migrates the indexer’s event handler registrations to use it, enabling future control logic around when indexing starts.

Changes:

  • Added addOnchainEventListener wrapper utility and a Vitest unit test for it.
  • Replaced direct ponder.on(...) registrations across plugins/handlers with addOnchainEventListener(...).
  • Added a changeset to bump ensindexer for the API-level migration.

Reviewed changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/ensindexer/src/plugins/tokenscope/handlers/ThreeDNSToken.ts Switches TokenScope 3DNS ERC1155 listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/tokenscope/handlers/Seaport.ts Switches Seaport sale listener registration to addOnchainEventListener.
apps/ensindexer/src/plugins/tokenscope/handlers/NameWrapper.ts Switches NameWrapper ERC1155 listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/tokenscope/handlers/BaseRegistrars.ts Switches BaseRegistrar transfer listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/subgraph/shared-handlers/multi-chain/Resolver.ts Switches shared multichain resolver listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/subgraph/plugins/threedns/handlers/ThreeDNSToken.ts Switches 3DNS subgraph token listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/subgraph/plugins/threedns/handlers/ThreeDNSResolver.ts Switches 3DNS subgraph resolver listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/subgraph/plugins/subgraph/handlers/Registry.ts Switches ENSv1 registry listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/subgraph/plugins/subgraph/handlers/Registrar.ts Switches subgraph registrar/controller listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/subgraph/plugins/subgraph/handlers/NameWrapper.ts Switches subgraph NameWrapper listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/subgraph/plugins/lineanames/handlers/Registry.ts Switches Lineanames registry listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/subgraph/plugins/lineanames/handlers/Registrar.ts Switches Lineanames registrar/controller listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/subgraph/plugins/lineanames/handlers/NameWrapper.ts Switches Lineanames NameWrapper listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/subgraph/plugins/basenames/handlers/Registry.ts Switches Basenames registry listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/subgraph/plugins/basenames/handlers/Registrar.ts Switches Basenames registrar/controller listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/registrars/lineanames/handlers/Lineanames_RegistrarController.ts Switches Lineanames registrar-controller listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/registrars/lineanames/handlers/Lineanames_Registrar.ts Switches Lineanames registrar listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/registrars/ethnames/handlers/Ethnames_UniversalRegistrarRenewalWithReferrer.ts Switches Ethnames universal registrar renewal listener to addOnchainEventListener.
apps/ensindexer/src/plugins/registrars/ethnames/handlers/Ethnames_RegistrarController.ts Switches Ethnames registrar-controller listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/registrars/ethnames/handlers/Ethnames_Registrar.ts Switches Ethnames registrar listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/registrars/basenames/handlers/Basenames_RegistrarController.ts Switches Basenames registrar-controller listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/registrars/basenames/handlers/Basenames_Registrar.ts Switches Basenames registrar listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/protocol-acceleration/handlers/ThreeDNSToken.ts Switches Protocol Acceleration 3DNS token listener to addOnchainEventListener.
apps/ensindexer/src/plugins/protocol-acceleration/handlers/StandaloneReverseRegistrar.ts Switches reverse registrar listener to addOnchainEventListener.
apps/ensindexer/src/plugins/protocol-acceleration/handlers/Resolver.ts Switches Protocol Acceleration resolver listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/protocol-acceleration/handlers/ENSv2Registry.ts Switches Protocol Acceleration ENSv2 registry listener to addOnchainEventListener.
apps/ensindexer/src/plugins/protocol-acceleration/handlers/ENSv1Registry.ts Switches Protocol Acceleration ENSv1 registry listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/ensv2/handlers/shared/Resolver.ts Switches ENSv2 shared resolver listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/ensv2/handlers/ensv2/EnhancedAccessControl.ts Switches ENSv2 EAC listener to addOnchainEventListener.
apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ETHRegistrar.ts Switches ENSv2 ETH registrar listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ENSv2Registry.ts Switches ENSv2 registry listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/ensv2/handlers/ensv1/RegistrarController.ts Switches ENSv1 registrar controller listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/ensv2/handlers/ensv1/NameWrapper.ts Switches ENSv1 NameWrapper listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/ensv2/handlers/ensv1/ENSv1Registry.ts Switches ENSv1 registry listeners to addOnchainEventListener.
apps/ensindexer/src/plugins/ensv2/handlers/ensv1/BaseRegistrar.ts Switches ENSv1 BaseRegistrar listeners to addOnchainEventListener.
apps/ensindexer/src/lib/onchain-events/add-onchain-event-listener.ts Adds the ponder.on wrapper used across the codebase.
apps/ensindexer/src/lib/onchain-events/add-onchain-event-listener.test.ts Adds unit test asserting wrapper delegates to ponder.on.
.changeset/bold-bananas-jump.md Adds changeset describing the migration to addOnchainEventListener.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 28, 2026

Greptile Summary

This PR introduces addOnchainEventListener as a thin wrapper over ponder.on and performs a codebase-wide mechanical migration to use it, replacing all direct ponder.on calls (62 files). The wrapper enriches the Ponder context by adding an ensDb alias for context.db, which paves the way for future control logic (e.g. waiting for ENSRainbow to be ready before indexing starts) without requiring further changes to individual handler files.

Key changes:

  • New abstraction (apps/ensindexer/src/lib/indexing-engines/ponder.ts): addOnchainEventListener wraps ponder.on, injecting ensDb (= context.db) via buildIndexingEngineContext. Handlers now receive IndexingEngineContext instead of Ponder's raw Context.
  • Tests (ponder.test.ts): Solid coverage of context transformation, event pass-through, sync/async handlers, and error propagation.
  • Mechanical migration: Every handler file now uses context.ensDb and ensIndexerSchema (renamed from schema). No logic changes were made to any handler.
  • Minor style finding: 15+ handler files split the type and value imports from @/lib/indexing-engines/ponder into two separate import statements; these could be merged with the inline type modifier.
  • Minor JSDoc issue in ponder.ts: a double-space, a stray blank line, and a comment that says "this function is called on every event" where it should say the registered callback is called on every event.

Confidence Score: 5/5

Safe to merge — purely mechanical refactoring with a well-tested new abstraction layer and no logic changes.

All 62 changed files are mechanical ponder.onaddOnchainEventListener and context.dbcontext.ensDb substitutions. The new wrapper is small, clearly correct, and backed by a thorough test suite. No P0 or P1 findings exist; remaining comments are P2 style suggestions (duplicate imports and JSDoc wording).

No files require special attention — apps/ensindexer/src/lib/indexing-engines/ponder.ts is the only substantive new code and is straightforward.

Important Files Changed

Filename Overview
apps/ensindexer/src/lib/indexing-engines/ponder.ts New file — introduces addOnchainEventListener wrapper over ponder.on that injects ensDb (aliasing db) into the handler context; minor JSDoc wording issues noted.
apps/ensindexer/src/lib/indexing-engines/ponder.test.ts New test suite covering context transformation, event pass-through, async/sync handlers, and error propagation for addOnchainEventListener; good coverage of the new wrapper's contract.
apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ENSv2Registry.ts All ponder.on calls replaced with addOnchainEventListener; context and schema references updated; split type/value imports from ponder module (style issue).
apps/ensindexer/src/plugins/subgraph/shared-handlers/Registry.ts All handler function signatures updated to IndexingEngineContext; all context.db calls replaced with context.ensDb; no logic changes.
apps/ensindexer/src/plugins/registrars/shared/lib/registrar-controller-events.ts Event["id"] replaced with IndexingEngineEvent["id"]; context.db replaced with context.ensDb; purely mechanical migration.
apps/ensindexer/src/plugins/tokenscope/handlers/Seaport.ts ponder.on replaced with addOnchainEventListener; context.db replaced with context.ensDb; no logic changes.
apps/ensindexer/src/lib/ensv2/account-db-helpers.ts Mechanical swap of ContextIndexingEngineContext and context.dbcontext.ensDb; schema import renamed to ensIndexerSchema.
.changeset/bold-bananas-jump.md Changeset entry correctly marks this as a minor release for ensindexer.

Sequence Diagram

sequenceDiagram
    participant PonderRuntime as Ponder Runtime
    participant Wrapper as addOnchainEventListener
    participant Builder as buildIndexingEngineContext
    participant Handler as Event Handler

    Note over Wrapper: Called once at startup (registration)
    Wrapper->>PonderRuntime: ponder.on(eventName, callback)

    Note over PonderRuntime: On each matched onchain event
    PonderRuntime->>Wrapper: callback({ context, event })
    Wrapper->>Builder: buildIndexingEngineContext(context)
    Builder-->>Wrapper: IndexingEngineContext { ...context, ensDb: context.db }
    Wrapper->>Handler: eventHandler({ context: IndexingEngineContext, event })
    Handler-->>PonderRuntime: void | Promise<void>
Loading

Reviews (3): Last reviewed commit: "Apply AI feedback" | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/ensindexer/src/plugins/tokenscope/handlers/ThreeDNSToken.ts (1)

115-206: 🧹 Nitpick | 🔵 Trivial

Minor inconsistency in commented-out code: addEventListener vs addOnchainEventListener.

The commented-out handlers use addEventListener (lines 115, 138, 173) while the active handlers use addOnchainEventListener. If these handlers are re-enabled later, they would need to be updated to use the correct function name.

🔧 Suggested fix for consistency
-  // addEventListener(
+  // addOnchainEventListener(
     //   namespaceContract(pluginName, "ThreeDNSToken:RegistrationCreated"),

Apply similar changes at lines 138 and 173.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/ensindexer/src/plugins/tokenscope/handlers/ThreeDNSToken.ts` around
lines 115 - 206, Commented-out 3DNS handlers use the old helper name
addEventListener which is inconsistent with the active handlers that call
addOnchainEventListener; update the three commented blocks that register
"ThreeDNSToken:RegistrationCreated", "ThreeDNSToken:RegistrationTransferred",
and "ThreeDNSToken:RegistrationBurned" to call addOnchainEventListener instead
of addEventListener so they match the active pattern and will work if re-enabled
(search for the commented addEventListener(...) blocks and replace the function
name).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@apps/ensindexer/src/plugins/tokenscope/handlers/ThreeDNSToken.ts`:
- Around line 115-206: Commented-out 3DNS handlers use the old helper name
addEventListener which is inconsistent with the active handlers that call
addOnchainEventListener; update the three commented blocks that register
"ThreeDNSToken:RegistrationCreated", "ThreeDNSToken:RegistrationTransferred",
and "ThreeDNSToken:RegistrationBurned" to call addOnchainEventListener instead
of addEventListener so they match the active pattern and will work if re-enabled
(search for the commented addEventListener(...) blocks and replace the function
name).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5abd6553-c93f-4a9a-b32c-20c69f3f5123

📥 Commits

Reviewing files that changed from the base of the PR and between c78a960 and edd2e68.

📒 Files selected for processing (38)
  • .changeset/bold-bananas-jump.md
  • apps/ensindexer/src/lib/onchain-events/add-onchain-event-listener.test.ts
  • apps/ensindexer/src/lib/onchain-events/add-onchain-event-listener.ts
  • apps/ensindexer/src/plugins/ensv2/handlers/ensv1/BaseRegistrar.ts
  • apps/ensindexer/src/plugins/ensv2/handlers/ensv1/ENSv1Registry.ts
  • apps/ensindexer/src/plugins/ensv2/handlers/ensv1/NameWrapper.ts
  • apps/ensindexer/src/plugins/ensv2/handlers/ensv1/RegistrarController.ts
  • apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ENSv2Registry.ts
  • apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ETHRegistrar.ts
  • apps/ensindexer/src/plugins/ensv2/handlers/ensv2/EnhancedAccessControl.ts
  • apps/ensindexer/src/plugins/ensv2/handlers/shared/Resolver.ts
  • apps/ensindexer/src/plugins/protocol-acceleration/handlers/ENSv1Registry.ts
  • apps/ensindexer/src/plugins/protocol-acceleration/handlers/ENSv2Registry.ts
  • apps/ensindexer/src/plugins/protocol-acceleration/handlers/Resolver.ts
  • apps/ensindexer/src/plugins/protocol-acceleration/handlers/StandaloneReverseRegistrar.ts
  • apps/ensindexer/src/plugins/protocol-acceleration/handlers/ThreeDNSToken.ts
  • apps/ensindexer/src/plugins/registrars/basenames/handlers/Basenames_Registrar.ts
  • apps/ensindexer/src/plugins/registrars/basenames/handlers/Basenames_RegistrarController.ts
  • apps/ensindexer/src/plugins/registrars/ethnames/handlers/Ethnames_Registrar.ts
  • apps/ensindexer/src/plugins/registrars/ethnames/handlers/Ethnames_RegistrarController.ts
  • apps/ensindexer/src/plugins/registrars/ethnames/handlers/Ethnames_UniversalRegistrarRenewalWithReferrer.ts
  • apps/ensindexer/src/plugins/registrars/lineanames/handlers/Lineanames_Registrar.ts
  • apps/ensindexer/src/plugins/registrars/lineanames/handlers/Lineanames_RegistrarController.ts
  • apps/ensindexer/src/plugins/subgraph/plugins/basenames/handlers/Registrar.ts
  • apps/ensindexer/src/plugins/subgraph/plugins/basenames/handlers/Registry.ts
  • apps/ensindexer/src/plugins/subgraph/plugins/lineanames/handlers/NameWrapper.ts
  • apps/ensindexer/src/plugins/subgraph/plugins/lineanames/handlers/Registrar.ts
  • apps/ensindexer/src/plugins/subgraph/plugins/lineanames/handlers/Registry.ts
  • apps/ensindexer/src/plugins/subgraph/plugins/subgraph/handlers/NameWrapper.ts
  • apps/ensindexer/src/plugins/subgraph/plugins/subgraph/handlers/Registrar.ts
  • apps/ensindexer/src/plugins/subgraph/plugins/subgraph/handlers/Registry.ts
  • apps/ensindexer/src/plugins/subgraph/plugins/threedns/handlers/ThreeDNSResolver.ts
  • apps/ensindexer/src/plugins/subgraph/plugins/threedns/handlers/ThreeDNSToken.ts
  • apps/ensindexer/src/plugins/subgraph/shared-handlers/multi-chain/Resolver.ts
  • apps/ensindexer/src/plugins/tokenscope/handlers/BaseRegistrars.ts
  • apps/ensindexer/src/plugins/tokenscope/handlers/NameWrapper.ts
  • apps/ensindexer/src/plugins/tokenscope/handlers/Seaport.ts
  • apps/ensindexer/src/plugins/tokenscope/handlers/ThreeDNSToken.ts

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 38 out of 38 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

tk-o added 2 commits March 28, 2026 13:23
Works as a thin wrapper over `ponder.on` function. This enabled adding some control logic while indexing onchain events.
Copy link
Copy Markdown
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 Looks nice! Shared a small suggestion please feel welcome to merge when ready 👍

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 62 out of 62 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tk-o tk-o force-pushed the feat/add-onchain-event-listener branch from 8364aa3 to 9993dae Compare March 28, 2026 19:29
@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io March 28, 2026 19:29 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io March 28, 2026 19:29 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io March 28, 2026 19:29 Inactive
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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/ensindexer/src/lib/indexing-engines/ponder.ts`:
- Around line 48-69: The JSDoc for addOnchainEventListener has an extra blank
line before the closing */ which breaks formatting; remove the stray empty line
inside the comment so the block closes directly after the final sentence. Locate
the comment above the addOnchainEventListener function (the block referencing
ponder.on and buildIndexingEngineContext) and delete the blank line immediately
before the */ so the JSDoc is compact and correctly formatted.
🪄 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: e821c4f8-3556-4bbf-9f62-b65a57ef90c0

📥 Commits

Reviewing files that changed from the base of the PR and between 8364aa3 and 9993dae.

📒 Files selected for processing (2)
  • apps/ensindexer/src/lib/indexing-engines/ponder.test.ts
  • apps/ensindexer/src/lib/indexing-engines/ponder.ts

Copilot AI review requested due to automatic review settings March 29, 2026 06:54
@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io March 29, 2026 06:54 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io March 29, 2026 06:54 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io March 29, 2026 06:54 Inactive
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 62 out of 62 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
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 Updates look nice! Thank you 🙌 Shared a few small suggestions please feel welcome to merge when ready 👍

@@ -1,16 +1,20 @@
import type { Context } from "ponder:registry";
import schema from "ponder:schema";
import ensIndexerSchema from "ponder:schema";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it make sense to make it so that @/lib/indexing-engines/ponder had an export named ensIndexerSchema and then all the event handlers would import ensIndexerSchema from that file too?

Goals include: no direct imports from Ponder in our event handlers.

* {@link addOnchainEventListener}.
*/
export interface IndexingEngineContext extends PonderIndexingContext<EventNames> {
ensDb: PonderIndexingContext<EventNames>["db"];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggest to add some JSdoc on this ensDb field to explain what this field is.

You might find some inspiration for how to talk about this field from how we documented a similar field in ensdb-sdk but perhaps for this context with Ponder there's other special ideas to note here.

/**
* A thin wrapper around `ponder.on` that allows us to:
* - Provide custom context to event handlers.
* - Execute additional logic before or after the event handler, if needed.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* - Execute additional logic before or after the event handler, if needed.
* - Execute additional logic before or after event handlers, if needed.

@vercel vercel bot temporarily deployed to Preview – ensnode.io March 30, 2026 06:00 Inactive
@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io March 30, 2026 06:00 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io March 30, 2026 06:00 Inactive
tk-o added 2 commits March 30, 2026 08:03
Separates Ponder modules from being directly tied to event handlers.
Copilot AI review requested due to automatic review settings March 30, 2026 06:03
@tk-o tk-o force-pushed the feat/add-onchain-event-listener branch from 0e86b04 to 5fca5f5 Compare March 30, 2026 06:03
@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io March 30, 2026 06:03 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io March 30, 2026 06:03 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io March 30, 2026 06:03 Inactive
@tk-o tk-o merged commit 1e4bfdc into main Mar 30, 2026
17 of 19 checks passed
@tk-o tk-o deleted the feat/add-onchain-event-listener branch March 30, 2026 06:07
@github-actions github-actions bot mentioned this pull request Mar 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 62 out of 62 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +20
vi.mock("ponder:schema", () => ({
ensIndexerSchema: {},
}));
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

The mock for ponder:schema doesn’t match how ensIndexerSchema is re-exported in ponder.ts (export * as ensIndexerSchema from "ponder:schema" expects ponder:schema to export tables directly). Returning { ensIndexerSchema: {} } makes the namespace shape ensIndexerSchema.ensIndexerSchema, which can mask issues if future tests start accessing schema tables. Prefer mocking ponder:schema as {} (if unused) or exporting the expected table bindings directly.

Suggested change
vi.mock("ponder:schema", () => ({
ensIndexerSchema: {},
}));
vi.mock("ponder:schema", () => ({}));

Copilot uses AI. Check for mistakes.
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.

3 participants