Page MenuHomePhabricator

[lib][native] Use ensjs for ENSCache name/address resolution
ClosedPublic

Authored by ashoat on Fri, Oct 11, 5:08 PM.
Tags
None
Referenced Files
F2981965: D13699.diff
Wed, Oct 16, 12:44 AM
Unknown Object (File)
Tue, Oct 15, 8:04 PM
Unknown Object (File)
Tue, Oct 15, 7:05 PM
Unknown Object (File)
Sat, Oct 12, 5:04 AM
Unknown Object (File)
Fri, Oct 11, 11:40 PM
Unknown Object (File)
Fri, Oct 11, 11:38 PM
Unknown Object (File)
Fri, Oct 11, 11:12 PM
Unknown Object (File)
Fri, Oct 11, 11:10 PM
Subscribers

Details

Summary

This addresses ENG-5308, and fixes basename resolution (eg. ashoat.base.eth) in getNamesForAddresses (ENG-9569).

I wasn't able to update getAvatarURIForAddress to use ensjs; see context here. As a result, ENSCache currently needs both an Ethers.js provider and a Viem client to work. I added ENSWrapper as an abstraction layer over these.

Test Plan

I added new unit tests. Before the changes in this diff, the new nfthreat.base.eth unit test for getNamesForAddresses would fail. Now it passes

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Fri, Oct 11, 5:50 PM
Harbormaster failed remote builds in B32200: Diff 45096!
ashoat edited the test plan for this revision. (Show Details)

Rebase on D13702. Hopefully should be working now!

This revision is now accepted and ready to land.Mon, Oct 14, 3:01 PM

Two more changes:

  1. I ended up needing to patch TextEncoder and TextDecoder, like when I last tried integrating Viem a year ago. I took the changes from my patch from then
  2. Bump queryTimeout to 30 seconds, as resolving an "offchain" ENS name such as a basename can take longer

Fix up initENSCache on keyserver

Factor out getAlchemyMainnetViemClientWithENSContracts, as I did with createViemPublicClient in the patch linked two updates above

This revision was landed with ongoing or failed builds.Mon, Oct 14, 8:38 PM
This revision was automatically updated to reflect the committed changes.