Page MenuHomePhabricator

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

Authored by ashoat on Oct 11 2024, 5:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 2:53 PM
Unknown Object (File)
Tue, Nov 12, 8:31 AM
Unknown Object (File)
Tue, Nov 12, 6:42 AM
Unknown Object (File)
Tue, Nov 12, 12:46 AM
Unknown Object (File)
Mon, Nov 11, 8:32 PM
Unknown Object (File)
Thu, Nov 7, 2:03 AM
Unknown Object (File)
Mon, Nov 4, 5:27 AM
Unknown Object (File)
Fri, Nov 1, 2:26 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
Branch
ashoat/basenames
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Oct 11 2024, 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.Oct 14 2024, 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.Oct 14 2024, 8:38 PM
This revision was automatically updated to reflect the committed changes.