Skip to content

feat: detect dropped and replaced transactions #283

@AugustoL

Description

@AugustoL

Summary

When a user submits a transaction with the same nonce as a pending transaction but with higher gas (to speed it up or cancel it), the original transaction gets dropped from the mempool and replaced. Etherscan detects and surfaces this — we want to do the same in OpenScan.

Motivation

Users often replace stuck transactions and then can't find the original in the explorer. Surfacing the "dropped & replaced" status gives users clarity on what happened to their transaction.

Proposed Solution

Research how to detect dropped/replaced transactions and display their status in the transaction detail page. The likely approach:

  1. Detection: when a transaction hash returns null from eth_getTransactionByHash (not found), check if a transaction with the same nonce from the same sender was mined — if so, the original was dropped and replaced by it.
  2. Display: show a "Dropped & Replaced" status badge on the transaction page, with a link to the replacement transaction.

Research Questions

  • Does eth_getTransactionByHash return null for dropped txs, or do some nodes keep them?
  • Can we reliably detect the replacement tx by scanning nonce + sender in recent blocks?
  • Should we query the mempool (txpool_content) to check if the tx is still pending?
  • How does Etherscan's API expose this? (status field, separate endpoint?)
  • Are there RPC providers that expose a dedicated "dropped tx" endpoint?
  • Performance implications: how many blocks back do we need to scan to find the replacement?

Acceptance Criteria

  • Research complete — detection approach documented
  • Transaction page shows "Dropped & Replaced" status when applicable
  • Link to the replacement transaction is shown
  • Graceful fallback when replacement cannot be determined (e.g. show "Dropped" without replacement link)
  • Works on Ethereum mainnet; best-effort on L2s

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions