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
mycodecrafting authored May 3, 2024
1 parent 2a45366 commit fe45f4e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,13 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
fee := new(big.Int).SetUint64(st.gasUsed())
fee.Mul(fee, effectiveTip)
st.state.AddBalance(st.evm.Context.Coinbase, fee)

// collect base fee instead of burn
if rules.IsLondon && st.evm.Context.Coinbase.Cmp(common.Address{}) != 0 {
baseFee := new(big.Int).SetUint64(st.gasUsed())
baseFee.Mul(baseFee, st.evm.Context.BaseFee)
st.state.AddBalance(st.evm.Context.Coinbase, baseFee)
}
}

return &ExecutionResult{
Expand Down

0 comments on commit fe45f4e

Please sign in to comment.