Closed e00E closed 4 years ago
Looks good. I should have caught that we got rid of the minimum increase when reviewing the original PR.
To be clear, we were still respecting the minimum increase but that meant not resubmitting. Whereas now we bump the gas price up to the minimum increase even it only increased by less.
It can happen that the new gas price is only slightly larger than the old one, without being large enough to respect the minimum gas price increase. The old algorithm would in this case not resubmit the solution. The new algorithm always increases the gas price to the minimum increase if the new gas price is larger than the old gas price.
Also refactored the calculation into its own pure function to make it easier to test.
Test Plan
New unit test that tests the gas price algorithm directly.