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

Improve ENS resolving #8

Open
estebanabaroa opened this issue Apr 24, 2023 · 2 comments
Open

Improve ENS resolving #8

estebanabaroa opened this issue Apr 24, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@estebanabaroa
Copy link
Member

Ideas to improving ENS resolving:

  1. Adding a cache that persist (both in browser and node), the cached value should always be used if it exist even if stale. But if stale, it should revalidate (use stale value immediately and revalidate async, dont revalidate sync or it wastes too much time). I think it should be considered stale after 5 minutes.
  2. If resolving fails because of network, it should be retried 3 times, with delays 0ms, 100ms, 1000ms, If resolving fails because the name isn't set, it shouldn't retry. (I'm not sure how to differentiate the 2, it needs to be tested). can use lib p-retry for that.
  3. Updating ethers.js to the latest version might improve reliability, not sure. The API changes between major version so it should be tested manually to make sure it still works.
@Rinse12
Copy link
Member

Rinse12 commented May 11, 2023

1 and 2 are implemented with commit #7b833a65f6470ab2fdc4f0f945c173434a67223e, although a resolve result is considered stale only after 24 hours. I do think that's too much, but also 5m is too low. Maybe 1 hour is good?

I updated ethers.js to 6.3.0 but it requires tsconfig to upgrade to ES2015, which changes a few things in our setup. Maybe not worth the effort for now

@estebanabaroa
Copy link
Member Author

1 and 2 are implemented with commit #7b833a65f6470ab2fdc4f0f945c173434a67223e, although a resolve result is considered stale only after 24 hours. I do think that's too much, but also 5m is too low. Maybe 1 hour is good?

I updated ethers.js to 6.3.0 but it requires tsconfig to upgrade to ES2015, which changes a few things in our setup. Maybe not worth the effort for now

I dont think 1 hour is good, the user won't be able to set up his own sub ENS and see it working for 1 hour. assuming the user has 100 subscriptions, that means he makes 100 eth calls every 5 minutes, that seems fine to me. especially since at some point we should use multicall to bulk them up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants