@@ -220,13 +220,18 @@ func NewOperatorCostFunc(config *params.ChainConfig, statedb StateGetter) Operat
220
220
}
221
221
}
222
222
operatorFeeParams := statedb .GetState (L1BlockAddr , OperatorFeeParamsSlot )
223
+ if operatorFeeParams == (common.Hash {}) {
224
+ return func (gas uint64 ) * uint256.Int {
225
+ return uint256 .NewInt (0 )
226
+ }
227
+ }
223
228
operatorFeeScalar , operatorFeeConstant := ExtractOperatorFeeParams (operatorFeeParams )
224
229
225
- // Return the Jovian version if Jovian is active
226
- if config .IsOptimismJovian (blockTime ) {
227
- return newOperatorCostFuncJovian (operatorFeeScalar , operatorFeeConstant )
230
+ // Return the Operator Fee fix version if the feature is active
231
+ if config .IsOperatorFeeFix (blockTime ) {
232
+ return newOperatorCostFuncOperatorFeeFix (operatorFeeScalar , operatorFeeConstant )
228
233
}
229
- return newOperatorCostFunc (operatorFeeScalar , operatorFeeConstant )
234
+ return newOperatorCostFuncIsthmus (operatorFeeScalar , operatorFeeConstant )
230
235
}
231
236
232
237
return func (gas uint64 , blockTime uint64 ) * uint256.Int {
@@ -239,8 +244,8 @@ func NewOperatorCostFunc(config *params.ChainConfig, statedb StateGetter) Operat
239
244
}
240
245
}
241
246
242
- // newOperatorCostFunc returns the operator cost function for Isthmus.
243
- func newOperatorCostFunc (operatorFeeScalar * big.Int , operatorFeeConstant * big.Int ) operatorCostFunc {
247
+ // newOperatorCostFuncIsthmus returns the operator cost function introduced with Isthmus.
248
+ func newOperatorCostFuncIsthmus (operatorFeeScalar * big.Int , operatorFeeConstant * big.Int ) operatorCostFunc {
244
249
return func (gas uint64 ) * uint256.Int {
245
250
fee := new (big.Int ).SetUint64 (gas )
246
251
fee = fee .Mul (fee , operatorFeeScalar )
@@ -257,8 +262,8 @@ func newOperatorCostFunc(operatorFeeScalar *big.Int, operatorFeeConstant *big.In
257
262
}
258
263
}
259
264
260
- // newOperatorCostFuncJovian returns the operator cost function for Jovian and later .
261
- func newOperatorCostFuncJovian (operatorFeeScalar * big.Int , operatorFeeConstant * big.Int ) operatorCostFunc {
265
+ // newOperatorCostFuncOperatorFeeFix returns the operator cost function for the operator fee fix feature .
266
+ func newOperatorCostFuncOperatorFeeFix (operatorFeeScalar * big.Int , operatorFeeConstant * big.Int ) operatorCostFunc {
262
267
return func (gas uint64 ) * uint256.Int {
263
268
fee := new (big.Int ).SetUint64 (gas )
264
269
fee = fee .Mul (fee , operatorFeeScalar )
0 commit comments