Skip to content

Commit 47a578b

Browse files
authored
EIP-1559 - exclude cosmos txs from base fee calculation (#1930)
* exclude cosmos txs from base fee calculation * cleanup
1 parent df0ca5b commit 47a578b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/app.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,15 +1605,17 @@ func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req BlockProcessRequ
16051605
lazyWriteEvents := app.BankKeeper.WriteDeferredBalances(ctx)
16061606
events = append(events, lazyWriteEvents...)
16071607

1608-
// Sum up total used per block
1609-
blockTotalGasUsed := int64(0)
1608+
// Sum up total used per block only for evm transactions
1609+
evmTotalGasUsed := int64(0)
16101610
for _, txResult := range txResults {
1611-
blockTotalGasUsed += txResult.GasUsed
1611+
if txResult.EvmTxInfo != nil {
1612+
evmTotalGasUsed += txResult.GasUsed
1613+
}
16121614
}
16131615

16141616
endBlockResp := app.EndBlock(ctx, abci.RequestEndBlock{
16151617
Height: req.GetHeight(),
1616-
BlockGasUsed: blockTotalGasUsed,
1618+
BlockGasUsed: evmTotalGasUsed,
16171619
})
16181620

16191621
events = append(events, endBlockResp.Events...)

0 commit comments

Comments
 (0)