-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(cast): implement auto gas price adjustment for stuck transactions in cast send
#9147
base: master
Are you sure you want to change the base?
feat(cast): implement auto gas price adjustment for stuck transactions in cast send
#9147
Conversation
cast send
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! just nits for now
so basically --bump-fee
is supposed to determine the minimal gas price required to replace the pending transaction once.
I'm wondering if there are any easier ways to do this? e.g there's eth_getTransactionBySenderAndNonce
which didn't get wide adoption yet unfortunately, not sure if there's something similar we could use
I removed the bump gas limit percentage in favour of a simpler bump gas limit. It would be great to use |
180ee20
to
96bbea7
Compare
let mut retry_count = 0; | ||
loop { | ||
let mut new_tx = tx.clone(); | ||
new_tx.gas_price = Some(current_gas_price); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what's the best strategy here, but wondering if we should also bump the priority fee somehow?
f06c626
to
5ff1422
Compare
Motivation
Closes #4454
Solution
Implement a new flag called
--bump-fee
, incast send
, to automatically bump transactions gas price. The idea is to be able to automatically replace stuck transactions during busy network times. Instead of manually adjusting the gas price, the user can specify the--bump-fee
flag andcast
will automatically adjust the gas price to replace the transaction.The following safeguards have been implemented:
The gas price increment is also configurable. By default, it is set to 10%, meaning that the gas price will be increased by 10% of the original gas price on each retry.