Submitted by berndartmueller
xfeemarket implements a custom PostHandler() for skip-mevs feemarket. At almost the very end of the execution, the feemarkets state is updated with the consumed gas amount so that the current blocks gas utilization and, thus, the base fee can be calculated.
However, the gas snapshot that is provided is not 100% accurate. It is taken in line 81. But any gas consumed by the subsequent actions, e.g., GetMinGasPrice() in line 101, or ante.CheckTxFee() in line 112, are not accounted for in the gas snapshot.
As a result, the block utilization for the current height is inaccurate, leading to a slightly lower base fee than it should be.
x/xfeemarket/post/fee.go#L129
In line 129, the skip-mevs feemarket state is updated with the currently used gas so that the block utilization for the current height is calculated correctly.
https://github.com/skip-mev/feemarket/blob/f1f216e15aa6bcc05075a7079496764820a0f545/x/feemarket/types/state.go#L26-L36
However, the gas snapshot is taken in line 81, which does not include any gas consumed in lines 101-127 up until the state update.
Consider taking the snapshot right before calling state.Update().
3docSec (judge) commented:
Lance Lan (MANTRA) confirmed and commented:
berndartmueller (warden) commented:
3docSec (judge) commented:
