Skip to content

fix(ens): fix ENS lookup and address transaction receipt fetching#227

Closed
AugustoL wants to merge 3 commits intorelease/v1.2.1-afrom
fix/ens-lookup-search
Closed

fix(ens): fix ENS lookup and address transaction receipt fetching#227
AugustoL wants to merge 3 commits intorelease/v1.2.1-afrom
fix/ens-lookup-search

Conversation

@AugustoL
Copy link
Collaborator

@AugustoL AugustoL commented Feb 18, 2026

Description

Fix ENS lookup not working in search inputs and address page, and fix address transaction history showing incorrect status for older transactions.

ENS Lookup Fix: The rpcUrls map is keyed by CAIP-2 networkId strings (e.g. "eip155:1"), but three locations were accessing it with the numeric key 1, which always returned undefined. This caused ensService to always be null and all ENS resolution to silently fail.

Transaction Receipt Fix: When viewing ENS-resolved addresses (e.g. augustol.eth), the transaction history had three bugs:

  1. Auto-search showed only 1 tx due to a narrow block window restriction
  2. Parallel mode showed all txs as "Pending" because the local extractData didn't handle RPCProviderResponse wrappers
  3. Older txs showed "Confirmed" instead of "Success" because eth_getTransactionReceipt returns null on some RPCs and the fallback strategy didn't retry

Related Issue

Closes #217

Type of Change

  • Bug fix

Changes Made

ENS Lookup (commit c7b4548)

  • src/hooks/useSearch.ts: Fix rpcUrls[1]rpcUrls["eip155:1"] (main search bar ENS resolution)
  • src/hooks/useENS.ts: Fix both occurrences of rpcUrls[1]rpcUrls["eip155:1"] (address page reverse lookup and forward resolve hook)
  • src/components/pages/evm/address/index.tsx: Fix rpcUrls[1]rpcUrls["eip155:1"] (direct ENS resolution when navigating to an ENS name)

Transaction Auto-Search & Parallel Mode (commit a6d4198)

  • src/services/AddressTransactionSearch.ts: Remove searchToBlockRef restriction that limited auto-search to 1 tx
  • src/services/AddressTransactionSearch.ts: Fix parallel mode extractData to handle RPCProviderResponse wrapper

Receipt Fetching & Status Display (commit 12153bc)

  • src/services/AddressTransactionSearch.ts: Add fetchBlockReceipts() using eth_getBlockReceipts (1 RPC call per block instead of N individual calls) with graceful fallback to individual calls
  • src/services/AddressTransactionSearch.ts: Extract buildTransaction() helper to deduplicate 3x repeated tx construction code
  • src/services/AddressTransactionSearch.ts: Import shared extractData instead of duplicating parallel mode logic locally
  • src/services/AddressTransactionSearch.ts: Remove useless retry block (was retrying same RPC → same null result)
  • src/components/pages/evm/address/shared/TransactionHistory.tsx: Remove "Confirmed" status badge (was a workaround for missing receipts)
  • src/styles/tables.css: Remove unused .table-status-confirmed CSS class

Checklist

  • I have run npm run format:fix and npm run lint:fix
  • I have run npm run typecheck with no errors
  • I have run tests with npm run test:run
  • I have tested my changes locally
  • I have updated documentation if needed
  • My code follows the project's architecture patterns

Additional Notes

The eth_getBlockReceipts approach is more reliable because if an RPC has the block, it has all its receipts (stored together). If the method is unsupported, it returns an error which properly triggers fallback — unlike null from individual receipt calls which the strategy treats as a valid response.

AugustoL and others added 2 commits February 9, 2026 14:46
rpcUrls is keyed by CAIP-2 networkId strings (e.g. "eip155:1"), but
useSearch, useENS, and the address page were accessing it with the
numeric key 1, which always returned undefined. This caused ENS
resolution to silently fail with "No Ethereum mainnet RPC configured".

Fixes #217

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 18, 2026

🚀 Preview: https://pr-227--openscan.netlify.app
📝 Commit: a6d4198007aebf23f2bd2020751ea50df4eac09f

… mode

Two bugs fixed:

1. Auto-search (findRecentActivityRange) was restricting the search to
   the nearest block range where state changed, meaning if only 1 tx
   existed in that recent window the search stopped at 1 regardless of
   the searchLimit=5. Removing the fromBlock restriction lets the binary
   search scan the full chain and find the N most recent txs.

2. AddressTransactionSearch.extractData was using array[0] for parallel
   strategy responses, returning the RPCProviderResponse wrapper object
   instead of the inner RPC data. This caused block fetches to silently
   return no transactions (block.transactions === undefined) and receipt
   fetches to produce receipt.status === "success" (wrapper field) instead
   of "0x1"/"0x0", so every tx showed as Pending. Fixed the helper to
   detect the RPCProviderResponse shape and extract successfulResponse.data.

Also adds a "Confirmed" status badge for mined txs whose receipt is
unavailable (blockNumber present but no receipt.status), so they no
longer incorrectly show as Pending.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AugustoL AugustoL changed the title fix(ens): use correct CAIP-2 key to access mainnet RPC URLs fix(ens): fix ENS lookup and address transaction receipt fetching Feb 18, 2026
@AugustoL
Copy link
Collaborator Author

Recreating PR from fork

@AugustoL AugustoL closed this Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments