-
Notifications
You must be signed in to change notification settings - Fork 2
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
Tool: Count Unknown Names & Unknown Labels #279
Comments
@shrugs Hey, before we begin any development on this goal, could you please review and critique the strategy proposed above for building a solution for this on top of the existing snapshot CLI tools you've been building in https://github.com/namehash/ens-subgraph-transition-tools ? Appreciate your advice on how we might proceed. Cheers 👍 |
How to treat |
I am not sure about definition of "Unknown Label", because ENS Subgraph is not returning labels but domains (names). These are results from my previous research: Count the total number of Unknown Names: 1029350
|
the strategy for determining "number of labels actually healed by ensrainbow" where we index mainnet without ENSRainbow is certainly the most straightforward. as long as we're running this somewhat infrequently that seems fine. i wonder if we could us the subgraph's logic to arrive at a simpler calculation, though it gets less clear because subnames obviously inherit their parent's healed labels and it may not be trivial to determine if a name was healed through the rainbow tables or the namewrapper. ah, perhaps we do the reverse: for every healed name in the subgraph, determine which label values are in the rainbow tables (a reverse lookup), and subtract from the set of all healed labels in the index — this will give us A) the set of labels registered on mainnet that the rainbow tables include and implementing another option for this tool to do those calculations seems reasonable as well. likely it depends on namehash/ens-subgraph-transition-tools#16 because the snapshots don't current contain enough data to differentiate them (they're currently just dumps of the output itself, no info about what those entities are or how they were queried). but anyway those suggested unknown label counting operations can definitely be done against the snapshots. that said these calculations may just as easily be done against the postgres database, so perhaps a tool that executes some sql against postgres is simpler? @djstrong how are you producing those results from your research? |
i've implemented those changes to the snapshot tool, so these count commands can be grafted onto that tool when needed. can take the lead on that if we're confident about this approach and the originally proposed spec |
Goals
For example, we're currently wireframing some rough design concepts for how to tell this story on the ENSRainbow landing page:
Definitions
The following definitions should be strictly applied.
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:
Subtasks
For any given Snapshot produced by Matt's "snapshot" tool, return:
The text was updated successfully, but these errors were encountered: