blockful-io / external-resolver

This project aims to scale the Ethereum Name Service (ENS) by consolidating existing patterns and proofs of concept into a unified and production-ready codebase.
MIT License
15 stars 3 forks source link

Validate domain manager on writing #203

Closed pikonha closed 1 month ago

pikonha commented 2 months ago

Feature Request

There is a scenario where the owner returned by the ENSRegistry isn't the ENS NFT owner, this happens on old domains that were created using the legacy ETHRegistrarController (e.g. blockful.eth)

Describe Preferred Solution

Validate both the NFT and the ENSRegistry owner when writing to a domain by calling the

Architecture Diagram

sequenceDiagram
    User -->> Client: Asks to set a text for test.eth
    Client -->> Client: normalize name
    Client -->> Client: namehash(name) = node
    Client -->> UniversalResolver: findResolver(node)
    UniversalResolver -->> Client: resolverAddr = 0x...
    Client -->> Resolver: setText(node, key, value)
    Resolver -->> Client: revert StorageHandledByL2(chainID, contractAddress)
    Client -->> L2: setText(node, key, value)
    Note over L2: Validate NFT owner
    L2 -->> L2: Validate ownership of both
    L2 -->> L2: Update data

QA Replication steps

  1. Fork Ethereum mainnet locally
  2. Impersonate blockful.eth NFT owner (0x000ee9A6Bcec9AadCc883bD52B2c9A75FB098991)
  3. Do a writing call
  4. Check whether the change took effect on the given storage (DB or L2)
pikonha commented 2 months ago

https://github.com/blockful-io/external-resolver/pull/208