question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API for re-sending transactions

See original GitHub issue

What was wrong?

There are a few legitimate use cases for wanting to re-submit a transaction that has already been sent with modified parameters.

  • Resending the same transaction with a higher gas price during times of network congestion.
  • Quickly overriding a transaction sent in error (also by using a higher gas price)
  • In a case where you know there is a signed transaction that was sent but never included in a block, ensuring that it will not be applied at some point in the future.

How can it be fixed?

Implement a new API web3.eth.overrideTransaction(txn_hash, txn_overrides)

  • txn_hash is the hash of the transaction you wish to override.
  • txn_overrides is a dictionary of transaction parameters which should be used in place of the existing transaction parameters.

Behavior is as follows.

  • if no transaction can be found with the given hash an exception is thrown.
  • if the transaction has already been mined an exception is thrown.
  • The txn_overrides may contain any/all fields that are normally accepted as transaction params except nonce.
  • If gasPrice is included in the txn_overrides, it must be greater than the existing transaction gas price (TODO: should we allow a way to bypass this validation)
  • if gasPrice is not included in the txn_overrides we should ??? (TODO: how do we choose an appropriate gas price?).

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:37 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
monokhcommented, Jan 27, 2018

Put in a very beginning of work on this. Apologies that this is going slow. Not had much time and doing more learning than coding here 😄 Should be able to get something reviewable quality after the weekend.

1reaction
monokhcommented, Jan 25, 2018

Web3.py actually uses eth-tester now which includes options for disabling auto mining. Therefore there won’t be problems with the tests or development:

tester = EthereumTester(auto_mine_transactions=False)
web3 = Web3(EthereumTesterProvider(tester))
tx = web3.eth.sendTransaction({
    'from': '0x82A978B3f5962A5b0957d9ee9eEf472EE55B42F1',
    'to': '0x7d577a597B2742b498Cb5Cf0C26cDCD726d39E6e',
    'value': '1000'
})
print(web3.eth.getTransaction(tx.hex()))
>>> ...... 'nonce': 0, 'blockHash': None, 'blockNumber': None, ......
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to re-send a transaction with higher gas price using ...
1. Sometimes, you submit a transaction on Ethereum without enough gas due to network congestion or too m... 2. We do a transaction...
Read more >
Resend Transaction Email - Notarize
Can be used to provide instructions, thank customers, add additional context to the transaction, or simply to add a personal touch. The message...
Read more >
Integration Concepts 3 - Reliable transactions - Flowfinity
Ensuring reliable transactions and data integrity when synchronizing records with Flowfinity. ... Using Transaction ID's in REST APIs and resend loops.
Read more >
Transactions API endpoints - Docs - Affirm
You can retrieve and refund individual transactions as well as read all transactions. Transactions are identified by a unique, random ID.
Read more >
Resend completion email to customer
Hi, Is there an API for re-sending the signing completion email to ... for a single transaction, not on account level for all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found