Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds an additional call to
estimateGas
in thetxmgr
transaction creation, and uses the minimum value returned. This is to ensure we use a correct gas limit for proposer transactions. This will cause slight overhead on tx submission, as well as increased load on the L1 node.Tests
No tests added, this is a simple logic change.
Additional context
We believe Geth has a race condition bug where, if a contract call switches from reverting to passing during the
estimateGas
call, the gas calculation binary search can return very high values (see this PR for more details).As an example, given an L1 block limit of 30,000,000, and the following binary search code: https://github.com/ethereum/go-ethereum/blob/46ec972c9c56a4e0d97d812f2eaf9e3657c66276/internal/ethapi/api.go#L1202-L1218
The binary search variables might look like:
Thus the tx is submitted with a gas limit of
29882895
. This is rejected by the network because of how high the limit is. We are experiencing a stuck proposer because of this bug, using values like this.