Skip to content

Conversation

@wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented Mar 15, 2025

Toward https://github.com/snapshot-labs/workflow/issues/485

The lookup_domains method now returns domains set in the reverse registrar

Test

curl --location 'http://localhost:3008' \
--header 'Content-Type: application/json' \
--data '{
    "method": "lookup_domains",
    "params":
        "0x7aeB96261e9dC2C9f01BaE6A516Df80a5a98c7eB"

}' | jq

It should return

{
  "jsonrpc": "2.0",
  "result": [
    "appdefi.eth",
    "defi.app"
  ],
  "id": null
}

Note that this address->name feature is only added to lookup_domains, and not also to lookup_address, as it's an expensive request. It will mainly be used for offchain space creation.

@wa0x6e wa0x6e requested a review from Copilot March 15, 2025 21:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances domain lookup functionality by returning domains from custom resolvers through the reverse registrar. The changes introduce a new function to fetch domain names from the reverse registrar, update the lookupDomains method to include this new lookup, and export EMPTY_ADDRESS to promote reusability across modules.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/lookupDomains.ts Added reverse registrar lookup with getDomainFromReverseRegistrar; refactored error handling using Promise.allSettled.
src/addressResolvers/utils.ts Exported EMPTY_ADDRESS for broader module usage.
Comments suppressed due to low confidence (1)

src/addressResolvers/utils.ts:5

  • [nitpick] The naming of EMPTY_ADDRESS is clear; however, ensure that all modules consistently import and use this constant to avoid mismatches in address comparisons.
export const EMPTY_ADDRESS = '0x0000000000000000000000000000000000000000';

@wa0x6e
Copy link
Contributor Author

wa0x6e commented Mar 15, 2025

Still need to confirm that the getENSOwner utils function in the SDK see those owners correctly

@wa0x6e wa0x6e requested a review from ChaituVR March 15, 2025 21:49
@wa0x6e wa0x6e marked this pull request as draft March 16, 2025 00:40
@wa0x6e wa0x6e marked this pull request as ready for review March 16, 2025 00:56
@ChaituVR
Copy link
Member

Still need to confirm that the getENSOwner utils function in the SDK see those owners correctly

I don't get it 🤔

@wa0x6e
Copy link
Contributor Author

wa0x6e commented Mar 16, 2025

Still need to confirm that the getENSOwner utils function in the SDK see those owners correctly

I don't get it 🤔

If we merge this PR, the address 0x7aeB96261e9dC2C9f01BaE6A516Df80a5a98c7eB will be able to see its domain defi.app in the list of available domains the offchain space creation.

Remaining issue is that the verification that this address is truly the owner of this domain will fail on sequencer, as there's no concept of owner for TLD domain.

Screenshot 2025-03-16 at 23 02 21

The address is not registered as owner, still looking for a way to verify ownership of TLD, maybe with https://github.com/ensdomains/ensjs/blob/main/docs/dns/function.getDnsOwner.md

@wa0x6e
Copy link
Contributor Author

wa0x6e commented Mar 16, 2025

Still need to confirm that the getENSOwner utils function in the SDK see those owners correctly

I don't get it 🤔

see snapshot-labs/snapshot.js#1134

@ChaituVR ChaituVR removed their request for review July 13, 2025 03:24
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.

3 participants