feat: poll mctransactions for dropped tx detection#83
Merged
passandscore merged 4 commits intomainfrom Mar 24, 2026
Merged
Conversation
…ctionReceipt Dropped txs were invisible to the old polling (eth_getTransactionReceipt returns null forever) causing the spinner to hang for 60s until timeout. Now polls /api/fast-tx-status/[hash] which queries the mctransactions table directly. This table tracks the preconfirmation lifecycle and reflects "failed" status immediately when the RPC drops a tx. - "failed" → fires onError instantly (no more 60s wait) - "pre-confirmed" → fires onPreConfirmed, keeps polling - "confirmed" → fires onConfirmed as final success - Wagmi receipt watching unchanged as parallel fallback
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ctransactions only Phase 1: poll both eth_getTransactionReceipt and mctransactions in parallel until pre-confirmed. Phase 2: stop RPC polling, poll only mctransactions for confirmed/failed. Wagmi stays as parallel fallback. Also fix toast text: "Pre-confirmed" → "Preconfirmed"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
eth_getTransactionReceiptreturns null forever and wagmi polls indefinitely. The only safety net was a timeout with a misleading "may have succeeded" message.mctransactionstable (via new/api/fast-tx-status/[hash]route) instead ofeth_getTransactionReceipt. This table tracks the FastRPC preconfirmation lifecycle and reflectsfailedstatus immediately when a tx is dropped.confirmedstatus from mctransactions now triggers final success without waiting for wagmi, making the happy path faster too.Changes
src/app/api/fast-tx-status/[hash]/route.ts— new API route querying mctransactions via StarRocks fastrpc catalogsrc/lib/fast-tx-status.ts— client-side fetch wrapper (5s timeout, abort-aware)src/hooks/use-wait-for-tx-confirmation.ts— replacedeth_getTransactionReceiptpolling withfetchFastTxStatus; mctransactionsconfirmednow triggersonConfirmeddirectlyTest plan
GET /api/fast-tx-status/{hash}returns correct status values