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, Dec 19, 6:46 AM
Unknown Object (File)
Wed, Dec 18, 8:39 AM
Unknown Object (File)
Wed, Dec 18, 8:38 AM
Unknown Object (File)
Wed, Dec 18, 8:36 AM
Unknown Object (File)
Wed, Dec 4, 11:09 PM
Unknown Object (File)
Fri, Nov 29, 1:12 AM
Unknown Object (File)
Thu, Nov 28, 8:06 PM
Unknown Object (File)
Nov 20 2024, 9:06 AM
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
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.