-
Notifications
You must be signed in to change notification settings - Fork 15
fix(ensindexer): update registrars plugin indexing logic and ENSDb schema #1527
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
Conversation
Add `UniversalRegistrarRenewalWithReferrer` config
Constrain `_ensindexer_registrar_action_metadata` to at most 1 row. Related to #1287
Use upsert instead of insert when initializing temp record for storing metadata about the current "logical registrar action". This guarantees at most 1 record being stored in ENSDb at any given time.
Use a constant metadata type value for fetching metadata for the current "logical registarar action" from ENSDb. Also, add new invaraint to enforce that only events related to the current "logical registrar action" can be indexed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 41d8bad The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
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 |
This comment was marked as resolved.
This comment was marked as resolved.
… one metadata record.
…t most one metadata record in ENSDb for current "logical registrar action".
lightwalker-eth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tk-o Looks great 😄 Thank you! 🚀


Substantial PR
Reviewer Focus (Read This First)
What reviewers should focus on
Where should reviewers spend most of their time?
Call out:
If your answer is "everything," explain why targeted review isn't possible.
Limit this to 1-3 areas.
Problem & Motivation
Why this exists
Explain:
Keep this tight. Bullets are fine.
This PR solves two issues:
Indexing logic bug that was introduced in
v1.4.0that caused the logical key value to be differ when handling events from different contracts within the same “logical registrar action”.v1.4.0).ENSDb storage requirements. Multiple temporary records were stored (one for each indexed "logical registrar action") in ENSDb.
What Changed (Concrete)
What actually changed
List the concrete behavioral or structural changes in this PR.
This should be a factual inventory, not a narrative.
Prefer numbered bullets.
If this list starts getting long, that's a signal the PR may need splitting.
registrarsplugin was updated to only allow storing up to one record for the current "logical registrar action" metadata.node(domain ID) andtransactionHash.Design & Planning
How this approach was chosen
Self-Review
What you caught yourself
Describe what changed after you reviewed your own diff end-to-end.
This is not optional.
handleUniversalRegistrarRenewalEventfunction didn't have its params updated. I then removed thesubregistryIdand it fixed the issue.insertRegistrarActiontoupsertRegistrarAction, but then, during self-review, I noticed the logic is still about just the insert when it comes to registrar action records. The implementation detail ofinsertRegistrarActionchanged from insert to upsert the metadata record. After that, I renamedupsertRegistrarActionback toinsertRegistrarActionCross-Codebase Alignment
Related code you checked
Show that you looked beyond just the files in this PR.
Focus on directly related domains. Don't boil the ocean.
insertRegistrarActionhandleRegistrarControllerEventinternal_registrarActionMetadatalogicalEventIdmakeLogicalEventKeygetThisAccountIdnode: NodewithdomainId: DomainId. TheDomainIdtype is a branded type extending theNodetype, but update is not straight-forward. Is there a method we should apply to createDomainIdvalue fromNodevalue?internal_registrarActionMetadataschema with the generalensNodeMetadataschema that is introduced in PR feat(ensindexer): ENSDb Writer Worker #1406.Downstream & Consumer Impact
Who this affects and how
Explain how this change impacts:
Call out:
Point to actual diffs where possible.
Testing Evidence
How this was validated
Explain:
PLUGINS=subgraph NAMESPACE=sepolia pnpm -F ensindexer dev_ensindexer_registrar_action_metadatatable at any given moment.Scope Reductions
What you intentionally didn't do
List follow-ups you identified but explicitly deferred to keep this PR reviewable.
Link issues where applicable and explain the tradeoffs.
internal_registrarActionMetadataschema with the generalensNodeMetadataschema that is introduced in PR feat(ensindexer): ENSDb Writer Worker #1406.Risk Analysis
How this could go wrong
Call out:
v1.3.1registrar_actionstable in ENSDb so we can make sure no regressions were introduced to the last working codebase (v1.3.1).Pre-Review Checklist (Blocking)
Resolves #1287