Skip to content

feat(ensindexer): introduce label healing from reverse registry#362

Merged
shrugs merged 32 commits intomainfrom
feat/204-reverse-registry-subnames-auto-healing
Apr 8, 2025
Merged

feat(ensindexer): introduce label healing from reverse registry#362
shrugs merged 32 commits intomainfrom
feat/204-reverse-registry-subnames-auto-healing

Conversation

@tk-o
Copy link
Contributor

@tk-o tk-o commented Mar 10, 2025

closes #204

Suggested review order

  1. Review package/ensnode-utils updates.
  2. Review apps/ensindexer/src/lib updates.
  3. Review apps/ensindexer/src/plugins updates.
  4. Review apps/ensindexer/src/handlers updates
  5. Review ponder.config.ts updates.

Scope

This PR introduces a feature of healing labels based on reverse addresses. This feature can be toggled on and off, by setting to HEAL_REVERSE_ADDRESSES to true or false, respectively. Please note, that only the eth plugin is going to support the new feature, while base and linea plugins will not.

To complete the feature, I had to:

  • create a parser for HEAL_REVERSE_ADDRESSES env var;
  • update the ponder plugin handler args type, to include plugin-defined helper methods canHealReverseAddresses and isReverseRootNode;
  • have all plugins to provide implementations for new helper methods (some of them throw error just to manifest lack of support for the feature in question);
  • update generic handlers handleNameRegistered & handleNewOwner to attempt reverse address label healing before attempting ENSRainbow label healing;
  • make ponder config object value altered based of HEAL_REVERSE_ADDRESSES env var value

Pre-merge checklist

  • ensure every ENSIndexer and ENSApi service that runs with only eth plugin on has HEAL_REVERSE_ADDRESSES set to false

Post-merge checklist


Resolves #204

Uses reverse registry records to heal label from transaction sender address
@vercel
Copy link
Contributor

vercel bot commented Mar 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
admin.ensnode.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2025 9:48pm
ensadmin-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2025 9:48pm
ensnode.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2025 9:48pm
ensrainbow.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2025 9:48pm

tk-o added 2 commits March 11, 2025 07:50
Only the eth plugin uses the env-based feature flag, while other plugins have reverse addresses healing turned off
tk-o added 2 commits March 12, 2025 16:03
Simplify indexing handlers code and move extra complexity to config file for each plugin.
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 updates. Reviewed and shared feedback!

@@ -17,6 +21,63 @@ export const ROOT_NODE = namehash("");

export const makeSubnodeNamehash = (node: Hex, label: Hex) => keccak256(concat([node, label]));
Copy link
Member

Choose a reason for hiding this comment

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

Why are we using the word label here? This is NOT a label! It is a labelhash! I've flagged this issue and the importance of fixing it multiple times over several months.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shrugs is that change going to be covered in your PR?

#
# WARNING: Setting this to `true` results in indexed data no longer being backwards compatible with the ENS Subgraph. For full
# data-level backwards compatibility with the ENS Subgraph, set this to `false`.
HEAL_REVERSE_ADDRESSES=true
Copy link
Member

Choose a reason for hiding this comment

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

Whenever we add configs that influence indexing behaviour, visibility of how these configs are set needs to be added to the indexing status dashboard in ENSAdmin.

Copy link
Collaborator

Choose a reason for hiding this comment

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


// if healing label from reverse addresses is possible, give it a go
if (canHealReverseAddressFromParentNode(node)) {
// TODO: if healing failed, log the event args for analysis and debugging
Copy link
Member

Choose a reason for hiding this comment

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

Seems nice for us to do this and then investigate these logs and see if we can identify patterns to better heal more of these cases?

Copy link
Contributor Author

@tk-o tk-o Apr 9, 2025

Choose a reason for hiding this comment

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

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.

Small language refinement suggested

shrugs and others added 2 commits April 8, 2025 16:42
Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>
Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>
Comment on lines +311 to +313
if (!rawValue) return DEFAULT_HEAL_REVERSE_ADDRESSES;
if (rawValue === "true") return true;
if (rawValue === "false") return false;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very simple, nice 👍

* Useful for identifying if a domain is used for reverse resolution.
* See apps/ensindexer/src/handlers/Registry.ts for context.
*/
export const REVERSE_ROOT_NODES: Set<Node> = new Set([namehash("addr.reverse")]);
Copy link
Contributor Author

@tk-o tk-o Apr 9, 2025

Choose a reason for hiding this comment

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

This will enable healing reverse addresses for both, eth plugin, and linea plugin. This is due to Linea ENS implementation currently not following ENSIP-19 specs.

I believe the goal of this PR was to enable healing process for eth plugin only.

For context:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Automatically Heal subnames of "addr.reverse".

5 participants