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.
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
all: improve EstimateGas API #20830
all: improve EstimateGas API #20830
Changes from 1 commit
c1e706a
38cbee9
e390d4f
af58d13
662dab7
19882fd
bc1e1a1
b0821c0
0015a42
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This isn't strictly true. A transaction may have a line like
require(msg.gas < 1,000,000, "Not enough gas");
or similar. We may not care about this class of failures (where the failure is dependent on gas, timestamp, block number, etc.) but there may be value in adding clarity to the comment.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.
@MicahZoltu It might help if we could collect a small pool of solidity code to add to tests and the desired behavior in those cases.
Code that depends on the gas counter is a bit hard to handle correctly. e.g.
^ cannot be binary searched, so the estimator cannot ever properly pick a correct number. It might be a valid corner case though to support estimating these kinds of txs as long as they can be binary searched.
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.
Feel free to open a new issue with a code that fails estimation and we can add some tweaks.
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.
Ah sorry, I don't think I actually want support for these edge cases, it feels not worth the effort. I was merely stating that the comment in the code isn't strictly correct and for clarity to future readers it may be valuable to mention something like "we don't care about these edge cases at the moment" in the comment.
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.
@MicahZoltu Actually the scenario you described is handled. Since all
revert
will lead to an internal evm error which is wrapped byExecutionResult
. However the error here is another one refers to some consensus issues(e.g. the nonce is not correct), so in this case no matter how much gas is assigned, the transaction will never be accepted.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.
Wondering if we should move this to
vm
? Seems a bit clearer to typevm.ExecutionResult
vs.core.EvexutionResult
. Is there some dependency loop that would make this undoable?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.
The reason to put this definition here is: after raw evm execution(we get the
ret
andvmerr
), we still need to apply some additional rules(e.g. refund gas), so theusedGas
field has to be updated in thecore
scope.Btw now all my VPN nodes are blocked :P. Now I can't login my
discord
account(also the reason for missing standup). Sorry about it.