-
Notifications
You must be signed in to change notification settings - Fork 264
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
Gas Exactimation v2 #1548
Gas Exactimation v2 #1548
Conversation
d1f8730
to
0425021
Compare
562a114
to
9b95562
Compare
👋🏿 Hello. So I've been looking at this and it seems that:
This is because This whole As the PR stands, we still won't actually take into account refunds to calculate the necessary gasLimit someone should send. So all in all, most of the changes are still unimplemented: to take advantage of these this comment needs to addressed. Also a comment itself warns of the possibility of an overflow. It is true that the user itself would be the only one affected by the overflow by providing a wrong gasLimit, but there's no reason to perform a simple sanity check and failing early at the beginning of an Anyway, all in all, I think to truly take advantage of the PR it needs a bit of work still. |
Also seems like a great time to implement something like Geth's gascap . |
b5a8d51
to
5f5b6c2
Compare
d2a871c
to
5ca9436
Compare
d2a871c
to
ba276a7
Compare
rskj-core/src/main/java/org/ethereum/core/TransactionExecutor.java
Outdated
Show resolved
Hide resolved
I guess there is another inconsistency here, the produced exception it's never added to the |
d7615a2
to
038ec16
Compare
9c6c8e2
to
11b1265
Compare
Currently this solution it's overestimating by a small difference. This is "good" because it improves the old algorithm (taking account gas "refunds"), and it won't produce failures if you run a transaction with the estimated value. |
7db3b4e
to
686b939
Compare
ee99791
to
796fd04
Compare
Kudos, SonarCloud Quality Gate passed! |
Description
This is a new gas estimation algorithm, where
ESTIMATED_GAS = GAS_USED + GAS_DEDUCTED_REFUNDS
Motivation and Context
This is a second step of @SergioDemianLerner's old PR:
How Has This Been Tested?
Unit tests
DSL tests
Types of changes
Checklist: