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
[FVM] Fix metering limits #2217
[FVM] Fix metering limits #2217
Conversation
89d2e62
to
d3ae6c6
Compare
FVM Benchstat comparisonThis branch with compared with the base branch onflow:master commit 7939698 The command Bench tests were run a total of 7 times on each branch. Results
|
Codecov Report
@@ Coverage Diff @@
## master #2217 +/- ##
==========================================
- Coverage 57.55% 57.54% -0.02%
==========================================
Files 642 642
Lines 38129 38133 +4
==========================================
- Hits 21946 21944 -2
- Misses 13389 13400 +11
+ Partials 2794 2789 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
bors merge |
v0.25 version
This fixes three things:
During testing with the emulator, I discovered that the metering "limit reached" error text did not include the correct limit. The error used the limit at the meters internal precision, instead of the actual limit. (now covered in the weighted meter tests)
When testing I noticed that setting a gas limit of 999 I was only able to get a transaction to 941 execution effort before it failed. This was due to the limit enforcement happening after the fee deduction which added computation and potentially failed the transaction.
When the transaction failed, the fee deduction code also failed due to
meter.MergeMeter
still emitting an error even though limit enforcement was off.The new
fvm/fvm_test.go
test covers 2. and 3. It also makes sure that if the limit is reached (or overshot) the user is only charged up to their gas limit.