3333 // the emptyTx is out of bounds for the linear regression so it uses the minimum size
3434 fjordFee = big .NewInt (3203000 ) // 100_000_000 * (2 * 1000 * 1e6 * 16 + 3 * 10 * 1e6) / 1e12
3535 ithmusOperatorFee = uint256 .NewInt (1256417826611659930 ) // 1618 * 1439103868 / 1e6 + 1256417826609331460
36+ jovianOperatorFee = uint256 .NewInt (1256650673615173860 ) // 1618 * 1439103868 * 100 + 1256417826609331460
3637
3738 bedrockGas = big .NewInt (1618 )
3839 regolithGas = big .NewInt (530 ) // 530 = 1618 - (16*68)
@@ -461,6 +462,13 @@ func TestNewOperatorCostFunc(t *testing.T) {
461462 fee = costFunc (bedrockGas .Uint64 (), time )
462463 require .NotNil (t , fee )
463464 require .Equal (t , ithmusOperatorFee , fee )
465+
466+ // emptyTx fee w/ jovian config should be not 0
467+ config .JovianTime = & time
468+ costFunc = NewOperatorCostFunc (config , statedb )
469+ fee = costFunc (bedrockGas .Uint64 (), time )
470+ require .NotNil (t , fee )
471+ require .Equal (t , jovianOperatorFee , fee )
464472}
465473
466474func TestFlzCompressLen (t * testing.T ) {
@@ -516,14 +524,16 @@ var emptyTxWithGas = NewTransaction(
516524// combines the L1 cost and operator cost.
517525func TestTotalRollupCostFunc (t * testing.T ) {
518526 zero := uint64 (0 )
519- later := uint64 (10 )
527+ isthmusTime := uint64 (10 )
528+ jovianTime := uint64 (20 )
520529 config := & params.ChainConfig {
521530 Optimism : params .OptimismTestConfig .Optimism ,
522531 RegolithTime : & zero ,
523532 EcotoneTime : & zero ,
524533 FjordTime : & zero ,
525534 HoloceneTime : & zero ,
526- IsthmusTime : & later ,
535+ IsthmusTime : & isthmusTime ,
536+ JovianTime : & jovianTime ,
527537 }
528538 statedb := & testStateGetter {
529539 baseFee : baseFee ,
@@ -537,13 +547,24 @@ func TestTotalRollupCostFunc(t *testing.T) {
537547 }
538548
539549 costFunc := NewTotalRollupCostFunc (config , statedb )
540- cost := costFunc (emptyTxWithGas , later - 1 )
550+
551+ // Pre-Isthmus: only L1 cost
552+ cost := costFunc (emptyTxWithGas , isthmusTime - 1 )
541553 require .NotNil (t , cost )
542554 expCost := uint256 .MustFromBig (fjordFee )
543555 require .Equal (t , expCost , cost , "pre-Isthmus total rollup cost should only contain L1 cost" )
544556
545- cost = costFunc (emptyTxWithGas , later + 1 )
557+ // Isthmus: L1 cost + Isthmus operator cost
558+ cost = costFunc (emptyTxWithGas , isthmusTime + 1 )
546559 require .NotNil (t , cost )
560+ expCost = uint256 .MustFromBig (fjordFee )
547561 expCost .Add (expCost , ithmusOperatorFee )
548- require .Equal (t , expCost , cost , "Isthmus total rollup cost should contain L1 cost and operator cost" )
562+ require .Equal (t , expCost , cost , "Isthmus total rollup cost should contain L1 cost and Isthmus operator cost" )
563+
564+ // Jovian: L1 cost + fixed operator cost
565+ cost = costFunc (emptyTxWithGas , jovianTime + 1 )
566+ require .NotNil (t , cost )
567+ expCost = uint256 .MustFromBig (fjordFee )
568+ expCost .Add (expCost , jovianOperatorFee )
569+ require .Equal (t , expCost , cost , "Jovian total rollup cost should contain L1 cost and Jovian operator cost" )
549570}
0 commit comments