Skip to content

Conversation

@MatiasOS
Copy link
Member

Summary

  • Add race mode RPC strategy that queries all endpoints simultaneously and returns the first successful response, optimizing for latency
  • Update @openscan/network-connectors to v1.3.0 which includes the RaceStrategy implementation using Promise.any()
  • Fix transaction receipt loss under concurrent RPC strategies and receipt status format handling on the address page

Related Issue

Closes #192

Type of Change

  • New feature
  • Bug fix

Changes Made

Race Strategy Integration

  • src/types/index.ts: Add "race" to RPCStrategy, UserSettings.rpcStrategy, and RPCMetadata.strategy types
  • src/services/DataService.ts: Accept "race" in strategy constructor parameter
  • src/hooks/useDataService.ts: Apply maxParallelRequests limit for race mode (same as parallel)

Settings UI

  • src/components/pages/settings/index.tsx: Add "Race (Fastest)" dropdown option, race description text, and show max parallel requests control for race mode

RPC Indicator

  • src/components/common/RPCIndicator.tsx: Lightning bolt badge (⚡ 1/N), winner highlight on fastest provider, response time sorting in dropdown, disabled provider selection in race mode, race-specific footer note
  • src/styles/components.css: Race info banner and winner highlight styles

Bug Fixes

  • src/components/pages/address/shared/TransactionHistory.tsx & AddressDetails.tsx: Handle both "0x1" and "1" receipt status formats
  • src/services/AddressTransactionSearch.ts: Add sequential retry for failed receipt fetches — when race/parallel strategies cause high concurrent request volume, some providers rate-limit, causing receipt loss. Failed receipts are retried one-at-a-time with delays.

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
  • My code follows the project's architecture patterns

Test Plan

  • Settings page: verify "Race (Fastest)" option appears in RPC strategy dropdown
  • Settings page: verify max parallel requests control shows for race mode
  • RPCIndicator badge: verify lightning bolt icon (⚡ 1/N) in race mode
  • RPCIndicator dropdown: verify providers sorted by response time with "Winner" badge
  • RPCIndicator dropdown: verify providers are NOT clickable in race mode
  • RPCIndicator dropdown: verify race footer note appears
  • Address page: verify transaction status shows "Success" (not "Pending") under race mode
  • Address page: verify all receipts are fetched (no missing receipts from rate limiting)

MatiasOS and others added 3 commits January 31, 2026 17:40
Upgrade to v1.3.0 which includes the RaceStrategy implementation
using Promise.any() for first-resolved RPC provider selection.

Closes openscan-explorer#192

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add race mode that queries all RPC endpoints simultaneously and
returns the first successful response, optimizing for latency.

Changes:
- Add "race" to RPCStrategy type, UserSettings, and RPCMetadata
- Extend DataService constructor to accept "race" strategy
- Apply maxParallelRequests limit for race mode in useDataService
- Add "Race (Fastest)" option to Settings UI with description
- Show max parallel requests control when race mode is active
- Update RPCIndicator with lightning bolt badge, winner highlight,
  response time sorting, and race-specific footer note

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix two issues with transaction status on the address page:

1. Handle both "0x1"/"0x0" and "1"/"0" receipt status formats
   in TransactionHistory and AddressDetails components.

2. Add sequential retry for failed receipt fetches in
   AddressTransactionSearch. When using race/parallel strategies,
   the high concurrent request volume (batch_size × providers)
   can trigger RPC rate limiting, causing some receipts to fail.
   Failed receipts are retried one-at-a-time with delays to
   avoid the burst that caused the initial failure.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@MatiasOS MatiasOS requested a review from AugustoL January 31, 2026 20:44
@github-actions
Copy link

🚀 Preview: https://pr-194--openscan.netlify.app
📝 Commit: d8653610a2eae1ba2d2efacceb6a3c2e03766d11

Copy link
Collaborator

@AugustoL AugustoL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@MatiasOS MatiasOS merged commit f21fcf4 into openscan-explorer:dev Feb 2, 2026
3 of 4 checks passed
@MatiasOS MatiasOS deleted the feat/race-rpc-strategy branch February 2, 2026 16:11
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.

2 participants