-
Notifications
You must be signed in to change notification settings - Fork 6
Allow previous gas limit #462
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #462 +/- ##
========================================
Coverage 76.10% 76.10%
========================================
Files 81 81
Lines 3038 3038
Branches 469 469
========================================
Hits 2312 2312
Misses 726 726
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
l2geth/rollup/fees/rollup_fee.go
Outdated
@@ -135,7 +140,7 @@ func PaysEnough(opts *PaysEnoughOpts) error { | |||
overpaying := new(big.Int).Sub(opts.UserFee, opts.ExpectedFee) | |||
threshold := mulByFloat(opts.ExpectedFee, opts.ThresholdUp) | |||
// if overpaying > threshold, return error | |||
if overpaying.Cmp(threshold) == 1 { | |||
if overpaying.Cmp(threshold) == 1 && opts.UserFee.Cmp(previousFee) == 1 { |
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.
Can we confirm the logic here? Sure we want &&?
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.
I think the logic here should be "are you overpaying according to both the current and previous limits?". Calculate "overpaying" as shown, calculate "overpaying_2" as Sub(opts.UserFee, opts.previousFee), calculate "threshold_2" by scaling up previousFee, then add "&& overpaying_2.cmp(threshold_2) == 1".
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.
See most recent commit - simplified the logic per your comment
No description provided.