Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarter tx retry when the tx is not included in a block or has been dropped #38

Open
tkporter opened this issue Apr 6, 2021 · 0 comments

Comments

@tkporter
Copy link
Contributor

tkporter commented Apr 6, 2021

Expected Behavior

When waiting for a tx that has been submitted to the network to be included in a block, if either of the 2 conditions occurs:

  1. X seconds have elapsed
  2. A node fails to return the tx, implying the tx no longer exists in the txpool

Then:

Resubmit the transaction with at least a 10% higher gas price. Consider something higher than 10% as well. We can piggyback off the existing retry logic here: https://github.com/celo-org/celo-oracle/blob/main/src/reporters/transaction_manager/send_with_retries.ts#L20. This retry logic should be modified to consider the gas price minimum at each retry.

The existing retry logic also doesn't handle nonces well. Contractkit will set the nonce to take pending transactions into account, see here. We should be explicitly setting the nonce to the "latest" value for the transaction count: https://eth.wiki/json-rpc/API#eth_gettransactioncount

Current Behavior

We retry a failed transaction with 10% higher gas price, but the nonce handling is insufficient and we don't explicitly consider timeouts or dropped txs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants