From a8d46f5254b58fb2751465477e2a1cdbecaca89b Mon Sep 17 00:00:00 2001 From: Josh Dechant Date: Thu, 2 May 2024 12:20:12 -0400 Subject: [PATCH 1/2] collect the base fee instead of burning it --- core/state_transition.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/state_transition.go b/core/state_transition.go index cca999e779..a95d77d4de 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -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 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{ From ff97b6b9bc0182643fe811f02168c8bbdd910e15 Mon Sep 17 00:00:00 2001 From: Josh Dechant Date: Thu, 2 May 2024 12:27:53 -0400 Subject: [PATCH 2/2] only run when eip-1559 is active --- core/state_transition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/state_transition.go b/core/state_transition.go index a95d77d4de..5b5af15064 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -460,7 +460,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { st.state.AddBalance(st.evm.Context.Coinbase, fee) // collect base fee instead of burn - if st.evm.Context.Coinbase.Cmp(common.Address{}) != 0 { + 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)