Revive, Estimate Gas with Binary Search#11000
Merged
Conversation
Contributor
Author
|
/cmd prdoc --audience runtime_dev --bump patch |
This was referenced Feb 6, 2026
pgherveou
reviewed
Feb 9, 2026
…estimation-binary-search
marian-radu
reviewed
Feb 17, 2026
marian-radu
reviewed
Feb 17, 2026
…estimation-binary-search
This reverts commit 6a75a24.
pgherveou
reviewed
Mar 2, 2026
Comment on lines
+1815
to
+1816
| // TODO: Implement a short circuit for simple transfers. We just need to determine the gas | ||
| // needed for it. |
Contributor
There was a problem hiding this comment.
can we take care of it here, or remove the TODO if we estimate the impact is acceptable
Contributor
Author
There was a problem hiding this comment.
I think that the impact is acceptable here so I will remove this TODO all together
pgherveou
approved these changes
Mar 2, 2026
Contributor
pgherveou
left a comment
There was a problem hiding this comment.
can we test it out against Paseo, I believe all operations should still work when targeting an old runtime without the updated runtime API
…estimation-binary-search
…estimation-binary-search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 implements binary search for the gas estimation logic in the eth-rpc which means that gas estimations are no longer just simple dry runs but that binary search is now used to find the smallest gas limit at which the transaction would run.
This PR closes paritytech/contract-issues#217 and also kind of fixes paritytech/contract-issues#259 or at least makes it harder to trigger the case in which we observe it, but the underlying issue still exists.
The binary search algorithm implemented in this PR is as close as possible to that used in Geth
Note
This PR does not fix paritytech/contract-issues#259 where the dry run could fail but the submission succeeds. It makes it so that it's harder for that case to be triggered by the underlying issue causing paritytech/contract-issues#259 is still there and it's caused by the overflows and saturations that happen in the gas -> fee -> weight computations