multi network ENS resolver - #836
Conversation
Adds forward ENS resolution (name -> address) on top of the existing reverse-resolution subsystem, wired into the header search: - typing a complete ENS name (e.g. vitalik.eth) shows an "ENS Names" typeahead section with the resolved address; selecting it (or submitting the search) redirects to the /address page - new "ens" search-ahead type; the global 0x-strip is skipped for it since ENS labels may legitimately contain "0x" - forward results are cached in a dedicated LRU (honoring the existing refreshPositive/refreshNegative intervals) plus the page cache - gated on both ensResolver.enabled and executionIndexer.enabled (resolved names redirect to /address, which needs the indexer) ENS lookups now always run against Ethereum mainnet: the configured ensResolver.endpoints, defaulting to a public mainnet RPC (ethereum-rpc.publicnode.com) when unset. The local execution pool is no longer used as fallback - on devnets/testnets it serves a chain without an ENS deployment.
- resolve ENS names on the local network (via the main execution pool) and on configured remote networks (ensResolver.remoteNetworks, each with own RPC endpoints + registries); drops the single-network ensResolver.endpoints config - persist results per (address, network) in ens_names (PK address+network) and show all resolved names in the UI: clickable ENS icon (tag=local, globe=remote) in front of swapped names opens a callout with the raw address and every name+network, all copyable - forward resolution + typeahead ENS search across all networks, including prefix suggestions from already-resolved names - fix probe-once bug: registry/multicall bytecode probing is retried every 5min while incomplete, so contracts deployed after startup are picked up
- append ?v=<git build version> (startup time for dev builds) to all /js, /css and /ui-package/react-ui.js includes via new assetVersion template func, replacing the buildTime param that only covered explorer.js/layout.css - add a timestamp param to the index page's /index/data ajax refresh so cloudflare doesn't serve stale refresh data
remote networks without registryAddresses/multicallAddress now fall back to the top-level ensResolver values instead of the built-in canonical addresses (the top-level values themselves still default to those, so behavior is unchanged when nothing is configured)
There was a problem hiding this comment.
Summary
Multi-network ENS resolver rework: names are now resolved on the local chain plus optional remote networks (persisted per (address,network)), a new ENS forward-search path, a schema migration, and CDN cache-busting for static assets. The design is solid and I found no blockers, but there are two operational concerns: a perpetual re-enqueue loop when a remote network endpoint stays down, and a silent removal of the old top-level ensResolver.endpoints config key.
Issues
- 🟡
services/ensresolver.go:724— permanently-failing network keeps every viewed address in an endless re-resolve loop — see the thread on that line - 🟡
types/config.go:221— top-level ensResolver.endpoints silently removed — existing configs lose their ENS target — The old EnsResolver.Endpoints field (used to point the resolver at a dedicated mainnet RPC, the only way to show mainnet ENS from a non-mainnet explorer) is deleted with no migration or warning; yaml.Unmarshal silently ignores the stale key. After upgrade such deployments resolve against the indexed chain's own execution pool and ENS stops resolving until they migrate to remoteNetworks. Worth a release note / deprecation shim (e.g. map old endpoints into a synthetic remote network).
Reviewed @ d5e933fd
"Documentation is a love letter you write to your future self." — Damian Conway
processBatch persisted rows only for succeeded networks, so a failing network's missing or outdated row kept the whole cache entry stale forever: every page view of an already-resolved address re-enqueued it and re-ran a full resolve batch against the healthy networks until the broken endpoint recovered. Cache entries now track resolve state per network, and staleness skips networks in error backoff, so addresses settle on the networks that do answer. The backoff escalates 30s..15m per consecutive failure and resets on success, and the forward (search) path honors it too instead of blocking each query on the unreachable endpoint for the full 10s timeout. Network availability is shown on the ens debug tab.
SummaryThis PR reworks the ENS resolver into a multi-network service: per-(address,network) persistence with a composite PK migration, probe-based registry discovery with backoff, per-network staleness so addresses settle while an endpoint is down, forward resolution for search, a client-side callout, and a cache-busting assetVersion helper. The core resolve/persist/refresh logic is coherent and well-tested; I found one mismatch between the documented failure handling and what the code actually persists, plus a small search-regex gap. Issues
Reviewed @ |
No description provided.