0

When my program sends a replacement transaction with same nonce and a 15% more gas price, the transaction is not accepted by nodes and the previous transaction gets confirmed instead. The time between replacement and confirmation is sometimes more than 10 seconds, and the geth node returns a replacement transaction hash also, but still the old transaction gets confirmed. This happens half of the times. Is there a way to increase the chance of replacement transaction being received and broadcasted? (I have more than 450 peers connected right now.)

2021-01-03T20:36:18.870Z
program sent first transaction
2021-01-03T20:36:25.362Z
program sent replacement transaction
2021-01-03T20:36:30.429Z
geth node returns replacement tx hash: 0xc9b64feff3500aeced153501cd0a961ce0930abcef08dca0ea579682ba34cfcf
2021-01-03T20:36:37.324Z 
geth node returns first tx receipt
2021-01-03T20:36:37.336Z
geth node returns first tx confirmation
0xdev
  • 51
  • 1
  • 3

1 Answers1

0

Is there a way to increase the chance of replacement transaction being received and broadcasted?

You can have your Ethereum node(s) connected to more peers to more efficiently broadcast the replacement transaction, to increase your transaction propagation across peer-to-peer network. This way you increase the chances a miner picks up your replacement transaction instead of the old transaction.

If this is a real business problem, then it makes sense to use more broadcaster nodes, more geologically distributed to make the propagation happen.

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435