Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,9 @@ func (st *StateTransition) innerTransitionDb() (*ExecutionResult, error) {
}

if optimismConfig := st.evm.ChainConfig().Optimism; optimismConfig != nil {
st.state.AddBalance(optimismConfig.BaseFeeRecipient, new(big.Int).Mul(new(big.Int).SetUint64(st.gasUsed()), st.evm.Context.BaseFee))
st.state.AddBalance(params.OptimismBaseFeeRecipient, new(big.Int).Mul(new(big.Int).SetUint64(st.gasUsed()), st.evm.Context.BaseFee))
if cost := st.evm.Context.L1CostFunc(st.evm.Context.BlockNumber.Uint64(), st.msg); cost != nil {
st.state.AddBalance(optimismConfig.L1FeeRecipient, cost)
st.state.AddBalance(params.OptimismL1FeeRecipient, cost)
}
}

Expand Down
6 changes: 2 additions & 4 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,8 @@ func (c *CliqueConfig) String() string {

// OptimismConfig is the optimism config.
type OptimismConfig struct {
BaseFeeRecipient common.Address `json:"baseFeeRecipient"`
L1FeeRecipient common.Address `json:"l1FeeRecipient"`
EIP1559Elasticity uint64 `json:"eip1559Elasticity"`
EIP1559Denominator uint64 `json:"eip1559Denominator"`
EIP1559Elasticity uint64 `json:"eip1559Elasticity"`
EIP1559Denominator uint64 `json:"eip1559Denominator"`
}

// String implements the stringer interface, returning the optimism fee config details.
Expand Down
13 changes: 12 additions & 1 deletion params/protocol_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@

package params

import "math/big"
import (
"math/big"

"github.com/ethereum/go-ethereum/common"
)

var (
// The base fee portion of the transaction fee accumulates at this predeploy
OptimismBaseFeeRecipient = common.HexToAddress("0x4200000000000000000000000000000000000019")
Comment thread
tynes marked this conversation as resolved.
// The L1 portion of the transaction fee accumulates at this predeploy
OptimismL1FeeRecipient = common.HexToAddress("0x420000000000000000000000000000000000001A")
)

const (
GasLimitBoundDivisor uint64 = 1024 // The bound divisor of the gas limit, used in update calculations.
Expand Down