Skip to content
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

[DRAFT] Custom Errors for ENSIP-10 #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

adraffy
Copy link

@adraffy adraffy commented Mar 2, 2025

  • proposal (unfinished)
  • took comment from slack and created ENSIP per Nick's suggestion
  • defined an ordering (contrary to the original design)

Original design:

example of (1): error Unreachable(bytes name)
example of (2): error UnknownResolverProfile(bytes4 selector)

when name doesn't exist, reverts Unreachable
when name exists and f() isn't implemented, reverts UnknownResolverProfile
when name exists, and f() is implemented, but f(name) is doesn't exist/is null, then returns null

you could then probe if a name exists by calling resolve(name, 0x00000000) to see if it reverts UnknownResolverProfile or Unreachable

by "exists", i mean "answerable by the resolver", however resolvers with actual availability could certainly be more precise

@adraffy
Copy link
Author

adraffy commented Mar 3, 2025

Contrary to the original design, I made it clear in the spec that UnsupportedResolverProfile happens before UnreachableName. After looking at many resolvers, it seems most developers branch on calldata they understand, before interacting with name or making an offchain request.

Explicit ordering is not required but it seems like a nice property to have as it enables the ERC-165-like behavior.

However, this ordering causes my hacky idea above about resolve(name, 0x00000000) to not work as stated.

It seems reasonable to assume that almost all resolvers implement addr(), so receiving UnreachableName when querying addr() is effectively isExists(name). There may be text()-only resolvers, but if addr() reverts UnsupportedResolverProfile, it could try text() as a fallback. Alternatively, this could be multicalled as [addr(), text()] and return false if either call reverts UnreachableName.

Possibly, the proposal should state that UnsupportedResolverProfile can be probed with w/CCIP-Read disabled.

It's unclear if we should have an explicit resolver profile for existence checking. Since zero resolvers implement this today, probably not. But if so, this would be the right time to define one.

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.

1 participant