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
F3518864: D13699.id45185.diff
Sun, Dec 22, 8:50 PM
F3518555: D13699.id45133.diff
Sun, Dec 22, 8:21 PM
F3518293: D13699.id45181.diff
Sun, Dec 22, 7:29 PM
F3518223: D13699.id45182.diff
Sun, Dec 22, 7:11 PM
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
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.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.