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

bug: ENS plugin only works on mainnet #7

Closed
antazoey opened this issue Feb 9, 2022 · 4 comments · Fixed by #8 · May be fixed by #9
Closed

bug: ENS plugin only works on mainnet #7

antazoey opened this issue Feb 9, 2022 · 4 comments · Fixed by #8 · May be fixed by #9
Labels
category: bug Something isn't working

Comments

@antazoey
Copy link
Member

antazoey commented Feb 9, 2022

Environment information

Latest and greatest ape and ens plugin

  • Python Version: 3.10.1
  • OS: maco

What went wrong?

ENS plugins only works on mainnet

How can it be fixed?

If not connected to mainnet, create a side-connecton to mainnet for this plugin's use only

@antazoey antazoey added the category: bug Something isn't working label Feb 9, 2022
@fubuloubu
Copy link
Member

fubuloubu commented Feb 9, 2022

Solution is to use NetworkManager to connect to Ethereum mainnet to do the lookup via Contract (using the Mainnet resolver).

We should do this instead of relying on Web3py's built-in ENS lookup, because apparently it is buggy

@antazoey
Copy link
Member Author

antazoey commented Feb 9, 2022

Stuff I am trying to still figure out:

  1. Which provider does NetworkManager user to connect to mainnet? Currently, we only have a default provider, which is usually a local provider, so that wouldn't work to use the default. My thought is allow it to be set in the config, otherwise pick the first provider that is not a TestProviderAPI.

  2. Is this plugin always connected to mainnet or does it only connect during calls to is_convertible() and convert()?

@fubuloubu
Copy link
Member

  1. with network_manager.parse_network_choice("ethereum:mainnet") as provider: ...
  2. Only during is_convertible/convert

@fubuloubu
Copy link
Member

Note: one of the original reasons I wanted a context manager here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug Something isn't working
Projects
None yet
2 participants