-
Notifications
You must be signed in to change notification settings - Fork 5
feat(address): add transaction history search with binary search algorithm #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(address): add transaction history search with binary search algorithm #154
Conversation
- Update waitForLoad() to wait for blocksHeaderInfo which only appears when data is loaded, fixing race condition with loading state - Use exact regex match for Gas column header to avoid ambiguity with Gas Price column
- Add dotenv to load environment variables from .env file - Inject INFURA_E2E_API_KEY and ALCHEMY_E2E_API_KEY via localStorage - RPC endpoints are prepended to mainnet for more reliable e2e tests
- Load .env file using dotenv for API keys - Increase retries: 6 for CI, 3 for local - Increase workers: 2 for CI (parallel execution) - Add documentation for RPC API key env vars
- Add waitForNavigationLoad() method to TxsPage - Wait for loading state to start AND finish after pagination clicks - Wait for URL changes before checking button states - Use exact regex match for Gas column to avoid ambiguity
- Wait for either address content or error page - Pass test if error page shown (RPC flakiness, not test failure)
…/claude-gh-action Create claude.yml gh workflow
…st-race-condition fix(e2e): resolve race condition in txs page tests
…rithm - Implement binary search on blockchain state (nonce/balance) to find address transactions without requiring an indexer - Add streaming support to display transactions as they are found - Support internal transaction detection by scanning calldata and logs - Add search controls with configurable limits (5, 10, 50, all) - Add Load More functionality to fetch older transactions - Add progress bar with cancel button during search - Display Block column in transaction history table - Optimize internal tx detection to check calldata first (no RPC calls) - Add rate limiting with smaller batches to avoid 429 errors
|
🚀 Preview: https://pr-154--openscan.netlify.app |
MatiasOS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous comment
- Fix Load More button not triggering new search by adding searchVersion counter to force effect re-run - Fix progress bar showing wrong numbers by using searchLimit as target and capping at 95% while searching - Show completed progress bar (100%) when search finishes - Hide Load More button when transactionsResult.isComplete is true - Use txCount (nonce) as minimum estimate for progress calculation - Simplify state by removing unnecessary isLoadMore and prevTxCount
…ache - Cache transactions in localStorage with 1-week expiry - Add "Search Recent Transactions" button to find new txs since cache - Add "Clear tx cache" button to reset cached data - Show block range indicating which blocks were searched - Fix block range to show "from block 0" when full history searched - Add fromBlock support in search algorithm for search recent feature
Encapsulate all transaction search state and logic within TransactionHistory component instead of passing 12+ props from address index. The component now manages its own: - Transaction cache (localStorage with 1-week expiry) - Search state (triggered, searching, limit, version) - Cache state (hasCachedData, oldestSearchedBlock) - All handlers (start, cancel, load more, search recent, clear cache) TransactionHistory now only needs 4 props: networkId, addressHash, contractAbi (optional), and txCount (optional).
MatiasOS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing remaining is that the tx list is re-rendering loading more txs.
1- Go to address page of mati-os.eth 0xa0701444c0813ad0e52b69804edf130937a7616f
2- Search 5 txs
3- Search 10 more
4- List start rerendering and start from zero
Remove oldestSearchedBlock from useEffect dependency array to fix race condition where the effect re-runs after search completes, finds refs already cleared, and incorrectly clears the transaction table.
MatiasOS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last issue is fixed!



Description
Implement a binary search algorithm on blockchain state (nonce/balance) to find address transactions without requiring an indexer. This enables transaction history for any address on any network directly from RPC.
Related Issue
N/A
Type of Change
Changes Made
Screenshots (if applicable)
N/A
Checklist
npm run format:fixandnpm run lint:fixnpm run typecheckwith no errorsnpm run test:runAdditional Notes
This feature allows OpenScan to show transaction history for any address without relying on third-party indexers. The binary search algorithm efficiently finds transactions by checking the address's nonce/balance at different block heights.