Skip to content

Commit

Permalink
collect the base fee instead of burning it (#5)
Browse files Browse the repository at this point in the history
EIP-1559 burns the base fee. This doesn't make sense for rollups. The
set fee recipient should collect it.
  • Loading branch information
bharath-123 committed May 29, 2024
1 parent b3d5ef7 commit c1191f7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,16 +467,15 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
if rules.IsLondon {
effectiveTip = cmath.BigMin(msg.GasTipCap, new(big.Int).Sub(msg.GasFeeCap, st.evm.Context.BaseFee))
}
effectiveTipU256, _ := uint256.FromBig(effectiveTip)

if st.evm.Config.NoBaseFee && msg.GasFeeCap.Sign() == 0 && msg.GasTipCap.Sign() == 0 {
// Skip fee payment when NoBaseFee is set and the fee fields
// are 0. This avoids a negative effectiveTip being applied to
// the coinbase when simulating calls.
} else {
fee := new(uint256.Int).SetUint64(st.gasUsed())
fee.Mul(fee, effectiveTipU256)
st.state.AddBalance(st.evm.Context.Coinbase, fee, tracing.BalanceIncreaseRewardTransactionFee)
fee := new(big.Int).SetUint64(st.gasUsed())
fee.Mul(fee, effectiveTip)
st.state.AddBalance(st.evm.Context.Coinbase, uint256.MustFromBig(fee), tracing.BalanceIncreaseRewardTransactionFee)

// collect base fee instead of burn
if rules.IsLondon && st.evm.Context.Coinbase.Cmp(common.Address{}) != 0 {
Expand Down

0 comments on commit c1191f7

Please sign in to comment.