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

Support for new ENS features #2406

Closed
Arachnid opened this issue Mar 25, 2022 · 13 comments
Closed

Support for new ENS features #2406

Arachnid opened this issue Mar 25, 2022 · 13 comments

Comments

@Arachnid
Copy link
Contributor

ENS has recently added new functionality in the form of two major upgrades:

  • Wildcard resolution (ENSIP 10) makes it possible to define wildcard subdomains, so that one resolver can provide records for all subdomains of a name.
  • CCIP Read (EIP 3668) makes it possible for names to be resolved using offchain data.

The combination of these two features mean it's now possible to have ENS names that are stored on L2s or on other offchain data stores such as private databases.

We'd love to see web3.py support this new functionality (and note, EIP 3668 applies to contract interactions more generally) - please let us know if there's anything we can do to facilitate getting it added!

@fselmo
Copy link
Collaborator

fselmo commented Mar 28, 2022

Hey @Arachnid, thanks for the heads up. I started looking into this Friday. Are you aware of any contracts that can be used for testing this functionality?

@Arachnid
Copy link
Contributor Author

offchainresolver.eth and hatch.eth are both set up with both features on Ropsten. @ricmoo and @makoto can provide advice on how to use them to test; we're working on official test vectors now.

@makoto
Copy link

makoto commented Mar 29, 2022

Hi @fselmo

Here is the test scenario I can think of.

Scenario: When offchainexample.eth has offchain resolver set 
Then:
- offchainexample.eth returns resolver address
- offchainexample.eth has ETH record 
- offchainexample.eth has email record
- 1.offchainexample.eth returns resolver
- 1.offchainexample.eth has ETH record
- 1.offchainexample.eth has email record

Scenario: When hatch.eth has wildcard resolver set (but no offchain resolver). ROPSTEN only
Then:
- hatch.eth returns resolver address
- hatch.eth has ETH record 
- makoto.hatch.eth returns resolver
- makoto.hatch.eth has ETH record

Scenario: When resolver.eth have non offchain/ non wildcard resolver set
Then:
- resolver.eth returns a resolver address
- resolver.eth has ETH record
- 1.resolver.eth dose not returns a resolver
- 1.resolver.eth does not have ETH record

NOTES:

  • For the current integration with ethers.js you can check with https://offchainexample2.surge.sh
  • Test should work on both mainnet and testnet (ropsten) except hatch.eth
  • If your lib works on browser, please also test via Metamask and Wallet connect (WalletConnect is not working on ethers. 5.6.2 yet)

@fselmo
Copy link
Collaborator

fselmo commented Mar 29, 2022

Thanks @makoto, @Arachnid 👌

@makoto
Copy link

makoto commented Apr 10, 2022

Hi, just checking if there's any progress. Please let us know if you have any questions.

@fselmo
Copy link
Collaborator

fselmo commented Apr 11, 2022

Hey @makoto. This is still on my plate. I had to draw attention to other libraries in our stack last week but coming back to web3.py at the beginning of this week and this is on the top of the list.

Let me know if there are any updates on official test vectors. Testing this functionality will be a bit different for us since we test our core functionality with eth-tester + py-evm and we do integration testing against a fixture running go-ethereum in dev mode... so if there are some contract examples I can load up that could be helpful as well rather than testing against contracts directly on mainnet / ropsten. I'm going to see what I can pull from those but if there are any other resources, that could be very helpful.

Robust testing is the one of the remaining items for ENSIP-10 support and CCIP Read support is coming after that.

@fselmo fselmo mentioned this issue Apr 18, 2022
3 tasks
@Arachnid
Copy link
Contributor Author

Is there anything we can do to help with integrating EIP 3668 / CCIP read support?

@andrii-kl
Copy link

@Arachnid
It would be very helpful and save a lot of time during the integration process if you provide one example with all intermediate parameters. It helps to find the problem instantly.

For example:
Resolver address: 0xc1735677a60884abbcf72295e88d47764beda282

  1. dnsEncodedName = dnsEncode("1.offchainexample.eth")
    dnsEncodedName: 0x01310f6f6666636861696e6578616d706c650365746800

  2. calldata = addr's //as if calling resolver.addr()
    CallData: 0x3b3b57de1c9fb8c1fe76f464ccec6d2c003169598fdfcbcb6bbddf6af9c097a39fa0048c

  3. address = resolver.resolve(dnsEncodedName, calldata)
    .....

@Arachnid
Copy link
Contributor Author

Arachnid commented May 3, 2022

The example you give is correct as far as I can tell. @makoto can respond with more detailed test vectors.

@fselmo fselmo mentioned this issue May 11, 2022
3 tasks
@fselmo
Copy link
Collaborator

fselmo commented Jun 1, 2022

closed by #2411, #2457

@fselmo fselmo closed this as completed Jun 1, 2022
@makoto
Copy link

makoto commented Sep 20, 2022

Hi @fselmo

I just tried to resolver 1.offchainexample.eth but it's not resolving any ETH address.
Has this been in the 5.31.0 version?

~ $pip3 freeze | grep web3
web3==5.31.0

~ $python3
Python 3.9.12 (main, Mar 26 2022, 15:51:15) 
[Clang 13.1.6 (clang-1316.0.21.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from web3 import Web3
>>> w3 = Web3(Web3.HTTPProvider('https://mainnet.infura.io/v3/$KEY'))
>>> w3.ens.address('nick.eth')
/usr/local/lib/python3.9/site-packages/ens/main.py:285: FutureWarning: The function signature for resolver() will change in v6 to accept `name` as a the positional argument, over `normal_name`, and the method will instead normalize the name internally. You may migrate to using `name` by passing it in as a keyword, e.g. resolver(name="ensname.eth").
  warnings.warn(
'0xb8c2C29ee19D8307cb7255e1Cd9CbDE883A267d5'
>>> w3.ens.address('1.offchainexample.eth')
>>> ```


@fselmo
Copy link
Collaborator

fselmo commented Sep 20, 2022

Hey @makoto, we only have this in v6, not v5.

@makoto
Copy link

makoto commented Sep 20, 2022

Thank you for the confirmation @fselmo

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

No branches or pull requests

4 participants