Skip to content

Commit

Permalink
Return 0 L1 fees (not nil)
Browse files Browse the repository at this point in the history
Returning nil works inside geth, but optimism tests expect the
l1CostFunc to return non-nil values. Considering our l1CostFunc is the
only one retuning nil values, it seems more pragmatic to change that
rather than adapting external code to deal correctly with nil values.
  • Loading branch information
karlb committed Oct 2, 2024
1 parent 13f6cb6 commit 4eb43bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/types/rollup_cost.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func NewL1CostFunc(config *params.ChainConfig, statedb StateGetter) L1CostFunc {
var cachedFunc l1CostFunc
selectFunc := func(blockTime uint64) l1CostFunc {
if config.IsCel2(blockTime) {
return func(rcd RollupCostData) (fee, gasUsed *big.Int) { return nil, nil }
return func(rcd RollupCostData) (fee, gasUsed *big.Int) { return new(big.Int), new(big.Int) }
}
if !config.IsOptimismEcotone(blockTime) {
return newL1CostFuncBedrock(config, statedb, blockTime)
Expand Down

0 comments on commit 4eb43bc

Please sign in to comment.