Skip to content

Tool: Count Unknown Names & Unknown Labels #279

@lightwalker-eth

Description

@lightwalker-eth

Goals

  1. Help us calculate important metrics related to Unknown Names / Unknown Labels
  2. Help us communicate the scale of the problem Unknown Names / Unknown Labels create, and therefore also to help us communicate the value proposition we're providing by reducing that problem.
  3. Help us (or anyone else) reproduce the same calculation whenever desired by running a simple command.
    1. NOTE: These metrics grow across time. They are not fixed data points.

For example, we're currently wireframing some rough design concepts for how to tell this story on the ENSRainbow landing page:

Image

  • NOTE: Please see the placeholder "fine print" text in the wireframe above where we write "* In the ENS Registry on Ethereum Mainnet as of 13 Feb, 2025". This placeholder is planned since we will NOT be making dynamic API calls for the sum total count of Unknown Names / Unknown Labels at this time. Instead, we need to produce these counts offline, then hardcode the result of the count into constants in the landing page. If anything about this isn't 100% clear please ask @lightwalker-eth.
    • An exception to this is the ability to make a dynamic API call to ENSRainbow to return the sum of labels it is able to heal. But please note how this metric isn't actually used at all in the "benchmarks" chart shown above. The label count returned by the ENSRainbow API returns the set of healable labels. Please note how this is very different than the count of labels in the ENS Subgraph that would otherwise be unknown. Not all labels that can be healed have actually been registered into the ENS Registry.
    • We still have plans to make use of the dynamic API call to ENSRainbow to return the sum of labels it is able to heal, but this data will be presented in a different format on the ENSRainbow landing page. Please see the rough design concept we are currently wireframing for this:

Image

Definitions

The following definitions should be strictly applied.

  1. "Unknown Label"
    1. A label returned by the ENS Subgraph in the format of "[{labelhash}]" where {labelhash} is a valid normalized labelhash without a 0x prefix and with the correct number of fully lowercase hex digits.
  2. "Unknown Name"
    1. A name returned by the ENS Subgraph containing 1 or more Unknown Labels.

NOTE: For now, we should anchor these definitions to the ENS Subgraph, and not to ENSNode.

Background Info

For the future we will be able to make enhancements to ENSNode so that a calculation for the sum of Unknown Labels / Unknown Names will be dynamically calculated during indexing, such that precomputed counts can be efficiently returned in a simple O(1) operation.

For now though, we're postponing such enhancements to optimize for shipping ENS Subgraph Backwards Compatibility.

Therefore, the only way to calculate aggregated metrics for Unknown Labels / Unknown Names by paginating through lists of Domains from the ENS Subgraph.

To ensure a deterministic calculation while paginating through lists of results, the Subgraph's "Time Travel Queries" feature is important: https://thegraph.com/docs/en/subgraphs/querying/graphql-api/#time-travel-queries This enables each pagination query to the ENS Subgraph to ask for a consistent state snapshot across pages for the same block number.

@shrugs might already have built most of the solution for this inside https://github.com/namehash/ens-subgraph-transition-tools. Please carefully review how the "Snapshot Equivalency Tool" works. This tool already builds a complete snapshot of all domains returned by the ENS Subgraph at a specified block number / block height.

Therefore, one idea is to explore how we can add a capability to command line app Matt has already built that would take as input a reference to a snapshot that's already been built, and then iterate through that snapshot to calculate the desired metrics about Unknown Labels / Unknown Names. This calculation then wouldn't require any further requests to the ENS Subgraph. It could just read from the snapshot that's already been built!

Another very important detail: For the metrics we are producing, it will also be extremely helpful to count the total number of Unknown Labels / Unknown Names in the ENS Subgraph if no label healing were performed at all. Here's a plan for how we will be able to calculate this:

  • Take advantage of how ENSNode offers backwards compatibility with the ENS Subgraph.
  • Take advantage of how ENSNode defers to ENSRainbow for label healing data.
  • Take advantage of how we can create a special deployment of ENSNode and ENSRainbow that is completely equivalent to the ENS Subgraph, except that the ENS Rainbow instance will contain 0 healable labels. In this way, the final snapshot we produce for that ENSNode instance can tell us how many Unknown Labels / Unknown Names would exist if the ENS Subgraph performed zero label healing at all.

Subtasks

For any given Snapshot produced by Matt's "snapshot" tool, return:

  • The block number / block height associated with the snapshot / results.
  • Count the total number of Unknown Names.
    • These should already be distinct within Domain snapshots.
  • Count the total number of non-distinct Unknown Labels.
  • Count the total number of distinct Unknown Labels.
  • Return a list of the 100 Unknown Labels that occur most frequently in the snapshot in descending order (from most frequently occurring, to least, then sorted by labelhash as needed for a deterministic sorting tiebreaker). For each, format the result as:
    • "{unknown label} {count of times found in snapshot}"

Metadata

Metadata

Assignees

Labels

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions