-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
require fee increase & gas re-estimation for retried transactions #6031
require fee increase & gas re-estimation for retried transactions #6031
Conversation
|
✅ Deploy Preview for opstack-docs canceled.
|
c1e1de7
to
ca59763
Compare
Generally looks good to me so far but tagging @trianglesphere who wrote this code |
…id tx replacement issues
ca59763
to
02c4e20
Compare
6d6292d
to
c875f46
Compare
1fffe8a
to
1be6970
Compare
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.
decreasing bump to 10% from 15% also makes sense to me 👍🏻
1be6970
to
8f59e17
Compare
bcc6ffe
to
727d378
Compare
I think this PR is ready to go. Running since yesterday proposing to goerli and in the last 12 hours we see this from the proposer transactions:
Let me know if there's anything else I can do? |
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.
LGTM thanks!
I'd also be fine with just adjusting the tests to the 10% price bump, instead of doing
func init() {
// fix price bump here (15%) so tests won't break if the default changes
priceBumpPercent = big.NewInt(100 + 15)
}
727d378
to
e1810d8
Compare
Tests adjusted for a 10% price bump, and added a require guard on priceBump for tests that rely on it so it's easy to know why things break if priceBump does get modified. |
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.
lgtm. Thanks for these changes
This PR has been added to the merge queue, and will be merged soon. |
Hey @roberto-bayardo, this pull request failed to merge and has been dequeued from the merge train. If you believe your PR failed in the merge train because of a flaky test, requeue it by commenting with |
@Mergifyio requeue |
❌ Command disallowed due to command restrictions in the Mergify configuration.
|
Description
Currently the txmgr retry logic will not bump a transaction's tip and max-fee in the case the latest suggested values are lower than the original values. When a transaction is stuck in the mempool (e.g. due to too low fees or bad gaslimit estimate) this regularly results in retry failures with error message "resubmitted already known transaction" or "replacement transaction underpriced".
This PR imposes a mandatory fee increase with each retry (up to a point) to ensure a retried tx isn't immediately rejected in this manner.
We also see txs get stuck in the mempool because of extremely high gaslimit estimation (e.g. gaslimit nearly equals block gas limit). In these cases, increasing fees alone does not solve the problem. To fix this scenario, this change makes the txmgr re-estimate gas with each retry. We have also created a geth PR to fix what we suspect is causing the high gaslimit estimates. (Fee re-estimation also seems to be helpful in detecting if resubmitting the tx would just fail anyway due to a state change.)
Tests
Updated unit tests to capture the new behavior.
Additional context
The issues addressed here have caused the Base goerli proposer to get stuck multiple times. Historically we have resorted to unjamming the proposer by manually submitting a transaction with a higher fee and lower gaslimit to replace the stuck transaction.
This issue does not happen with the batcher because batcher txs are simple sends, and we believe the underlying cause of the bad gas usage estimation only arises for reverting contract txs. Proposer txs revert quite frequently with the error message "block hash does not match the hash at the expected height".