Submitted by berndartmueller
Mantras xfeemarket post handler refunds unspent gas after the transaction is executed. For this, in line 99, a snapshot of the gas consumed is taken, which is then used to calculate the refund (tip) via skip-mevs CheckTxFee() in line 112.
However, this gas snapshot does not account for any gas consumed after the snapshot is taken, such as the gas consumed by burning the gas fees and the bank transfer that refunds the tip. As a result, the user is not charged for the gas consumed by these operations, leading to unaccounted gas consumption and potential abuse.
x/xfeemarket/post/fee.go#L99-L116
A gas snapshot is taken in line 99 to calculate the refund in CheckTxFee() in line 112.
skip-mev/feemarket@v1.1.1/x/feemarket/ante/fee.go::CheckTxFee()
The CheckTxFee() function calculates the refund based on the gas snapshot and returns the payCoin and tip, which are burned/locked and refunded, respectively.
But those operations consume gas, which the user is not charged for.
Consider defining a gas constant for those operations (e.g., BankSendGasConsumption = 12490 + 37325, which is only used during simulations) and charge the user for the gas consumed by them. This will prevent potential abuse and ensure that the user is charged for all gas consumed during the transaction.
3docSec (judge) commented:
Lance Lan (MANTRA) disputed and commented:
3docSec (judge) commented:
berndartmueller (warden) commented:
3docSec (judge) commented:
