[lib] Batch ENS queries using ReverseRecords smart contract
Summary:
This resolves ENG-2593. For more info about this smart contract, see official ENS docs and GitHub repo.
When I start my iOS app, it needs to resolve 142 ENS names to build the in-memory search indices for @-mentioning and inbox search.
Before this diff, this meant 142 individual network requests to Alchemy. After this diff, it requires only 1.
Depends on D9524
Test Plan:
- Included updated unit tests.
- I ran the iOS app and confirmed that the regression described here was resolved.
- I added a log statement to the code that issues a "single fetch" to confirm that it wasn't getting triggered anymore on iOS app start. (One "single fetch" was actually triggered, but it was for an ENS name that appeared immediately in my inbox... I think this is actually what we want, since we need that result more urgently.)
- I confirmed that ENS resolution still worked on the iOS app.
- I confirmed that ENS resolution still worked on the web app.
- I confirmed that the keyserver is still able to resolve ENS names in notifs.
Reviewers: rohan, atul, tomek
Reviewed By: tomek
Subscribers: tomek, wyilio
Differential Revision: https://phab.comm.dev/D9525