Skip to content

Commit 2c83f89

Browse files
committed
jovian: remove feature toggles
scope is now fixed
1 parent 70cfeb6 commit 2c83f89

File tree

13 files changed

+31
-43
lines changed

13 files changed

+31
-43
lines changed

op-acceptance-tests/tests/jovian/min_base_fee.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (mbf *minBaseFeeEnv) verifyMinBaseFee(t devtest.T, minBase *big.Int) {
8383
// waitForMinBaseFeeConfigChangeOnL2 waits until the L2 latest payload extra-data encodes the expected min base fee.
8484
func (mbf *minBaseFeeEnv) waitForMinBaseFeeConfigChangeOnL2(t devtest.T, expected uint64) {
8585
client := mbf.l2EL.Escape().L2EthClient()
86-
expectedExtraData := eth.BytesMax32(eip1559.EncodeMinBaseFeeExtraData(250, 6, expected))
86+
expectedExtraData := eth.BytesMax32(eip1559.EncodeJovianExtraData(250, 6, expected))
8787

8888
// Check extradata in block header (for all clients)
8989
var actualBlockExtraData []byte

op-chain-ops/genesis/genesis.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const defaultGasLimit = 30_000_000
2323
var HoloceneExtraData = eip1559.EncodeHoloceneExtraData(250, 6)
2424

2525
// MinBaseFeeExtraData represents the default extra data for Jovian-genesis chains.
26-
var MinBaseFeeExtraData = eip1559.EncodeMinBaseFeeExtraData(250, 6, 0)
26+
var MinBaseFeeExtraData = eip1559.EncodeJovianExtraData(250, 6, 0)
2727

2828
// NewL2Genesis will create a new L2 genesis
2929
func NewL2Genesis(config *DeployConfig, l1StartHeader *eth.BlockRef) (*core.Genesis, error) {
@@ -123,7 +123,7 @@ func NewL2Genesis(config *DeployConfig, l1StartHeader *eth.BlockRef) (*core.Gene
123123
if optimismChainConfig.IsIsthmus(genesis.Timestamp) {
124124
genesis.Alloc[params.HistoryStorageAddress] = types.Account{Nonce: 1, Code: params.HistoryStorageCode, Balance: common.Big0}
125125
}
126-
if optimismChainConfig.IsMinBaseFee(genesis.Timestamp) {
126+
if optimismChainConfig.IsJovian(genesis.Timestamp) {
127127
genesis.ExtraData = MinBaseFeeExtraData
128128
}
129129

op-devstack/dsl/bridge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ func gasCost(rcpt *types.Receipt, rollupCfg *rollup.Config, blockTimestamp *uint
605605
}
606606
operatorCost := new(big.Int).SetUint64(rcpt.GasUsed)
607607
operatorCost.Mul(operatorCost, new(big.Int).SetUint64(*rcpt.OperatorFeeScalar))
608-
if rollupCfg.IsOperatorFeeFix(*blockTimestamp) {
608+
if rollupCfg.IsJovian(*blockTimestamp) {
609609
operatorCost.Mul(operatorCost, big.NewInt(100))
610610
} else {
611611
operatorCost.Div(operatorCost, big.NewInt(1_000_000))

op-e2e/actions/proofs/jovian_minbasefee_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func Test_ProgramAction_JovianMinBaseFee(gt *testing.T) {
6666
require.True(t, isJovian, "GPO should report that Jovian is active")
6767

6868
activationBlock := env.Engine.L2Chain().GetBlockByHash(env.Sequencer.L2Unsafe().Hash)
69-
require.Equal(t, eip1559.EncodeMinBaseFeeExtraData(250, 6, 0), activationBlock.Extra(), "activation block should have Jovian extraData")
69+
require.Equal(t, eip1559.EncodeJovianExtraData(250, 6, 0), activationBlock.Extra(), "activation block should have Jovian extraData")
7070

7171
// Set the minimum base fee
7272
setMinBaseFeeViaSystemConfig(t, env, minBaseFee)
@@ -87,7 +87,7 @@ func Test_ProgramAction_JovianMinBaseFee(gt *testing.T) {
8787
// Block after the SystemConfig change
8888
env.Sequencer.ActL2EmptyBlock(t)
8989
blockAfterSystemConfigChange := env.Engine.L2Chain().GetBlockByHash(env.Sequencer.L2Unsafe().Hash)
90-
expectedJovianExtraDataWithMinFee := eip1559.EncodeMinBaseFeeExtraData(250, 6, minBaseFee)
90+
expectedJovianExtraDataWithMinFee := eip1559.EncodeJovianExtraData(250, 6, minBaseFee)
9191
require.Equal(t, expectedJovianExtraDataWithMinFee, blockAfterSystemConfigChange.Extra(), "block should have updated Jovian extraData with min base fee")
9292

9393
// Verify base fee is clamped

op-node/p2p/gossip.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ func BuildBlocksValidator(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
387387
log.Warn("payload is on v3 topic, but has nil blob gas used", "bad_hash", payload.BlockHash.String())
388388
return pubsub.ValidationReject
389389
// [REJECT] if the block is on a topic >= V3 and has a non-zero blob gas used field pre-Jovian
390-
} else if !cfg.IsDAFootprintBlockLimit(uint64(payload.Timestamp)) && *payload.BlobGasUsed != 0 {
390+
} else if !cfg.IsJovian(uint64(payload.Timestamp)) && *payload.BlobGasUsed != 0 {
391391
log.Warn("payload is on v3 topic, but has non-zero blob gas used",
392392
"bad_hash", payload.BlockHash.String(), "blob_gas_used", *payload.BlobGasUsed)
393393
return pubsub.ValidationReject

op-node/rollup/attributes/engine_consolidate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func jovianArgs() matchArgs {
4949
validTxData, _ = validTx.MarshalBinary()
5050
minBaseFee = uint64(1e9)
5151

52-
validJovianExtraData = eth.BytesMax32(eip1559.EncodeMinBaseFeeExtraData(
52+
validJovianExtraData = eth.BytesMax32(eip1559.EncodeJovianExtraData(
5353
*defaultOpConfig.EIP1559DenominatorCanyon, defaultOpConfig.EIP1559Elasticity, minBaseFee))
5454
validJovianEIP1559Params = new(eth.Bytes8)
5555
)

op-node/rollup/derive/attributes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func (ba *FetchingAttributesBuilder) PreparePayloadAttributes(ctx context.Contex
146146
}
147147

148148
if ba.rollupCfg.IsJovianActivationBlock(nextL2Time) {
149-
jovian, err := JovianNetworkUpgradeTransactions(ba.rollupCfg.IsDAFootprintBlockLimit(nextL2Time), ba.rollupCfg.IsOperatorFeeFix(nextL2Time))
149+
jovian, err := JovianNetworkUpgradeTransactions()
150150
if err != nil {
151151
return nil, NewCriticalError(fmt.Errorf("failed to build jovian network upgrade txs: %w", err))
152152
}
@@ -206,7 +206,7 @@ func (ba *FetchingAttributesBuilder) PreparePayloadAttributes(ctx context.Contex
206206
r.EIP1559Params = new(eth.Bytes8)
207207
*r.EIP1559Params = sysConfig.EIP1559Params
208208
}
209-
if ba.rollupCfg.IsMinBaseFee(nextL2Time) {
209+
if ba.rollupCfg.IsJovian(nextL2Time) {
210210
r.MinBaseFee = &sysConfig.MinBaseFee
211211
}
212212
return r, nil

op-node/rollup/derive/jovian_upgrade_transactions.go

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,24 +128,20 @@ func OperatorFeeFixUpgradeTransactions() ([]hexutil.Bytes, error) {
128128
return upgradeTxns, nil
129129
}
130130

131-
func JovianNetworkUpgradeTransactions(IsDAFootprintBlockLimit, IsOperatorFeeFix bool) ([]hexutil.Bytes, error) {
131+
func JovianNetworkUpgradeTransactions() ([]hexutil.Bytes, error) {
132132
upgradeTxs := make([]hexutil.Bytes, 0)
133133

134-
if IsDAFootprintBlockLimit {
135-
txs, err := DAFootprintNetworkUpgradeTransactions()
136-
if err != nil {
137-
return nil, err
138-
}
139-
upgradeTxs = append(upgradeTxs, txs...)
134+
txs, err := DAFootprintNetworkUpgradeTransactions()
135+
if err != nil {
136+
return nil, err
140137
}
138+
upgradeTxs = append(upgradeTxs, txs...)
141139

142-
if IsOperatorFeeFix {
143-
txs, err := OperatorFeeFixUpgradeTransactions()
144-
if err != nil {
145-
return nil, err
146-
}
147-
upgradeTxs = append(upgradeTxs, txs...)
140+
txs, err = OperatorFeeFixUpgradeTransactions()
141+
if err != nil {
142+
return nil, err
148143
}
144+
upgradeTxs = append(upgradeTxs, txs...)
149145

150146
return upgradeTxs, nil
151147
}

op-node/rollup/derive/jovian_upgrade_transactions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func TestJovianNetworkTransactions(t *testing.T) {
12-
upgradeTxns, err := JovianNetworkUpgradeTransactions(true, true)
12+
upgradeTxns, err := JovianNetworkUpgradeTransactions()
1313
require.NoError(t, err)
1414
require.Len(t, upgradeTxns, 5)
1515

op-node/rollup/derive/payload_util.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,10 @@ func PayloadToSystemConfig(rollupCfg *rollup.Config, payload *eth.ExecutionPaylo
104104
})
105105
}
106106

107-
if rollupCfg.IsMinBaseFee(uint64(payload.Timestamp)) {
107+
if rollupCfg.IsJovian(uint64(payload.Timestamp)) {
108108
// ValidateOptimismExtraData returning a nil error guarantees that m is not nil
109109
r.MinBaseFee = *m
110-
}
111-
if rollupCfg.IsDAFootprintBlockLimit(uint64(payload.Timestamp)) {
112-
r.DAFootprintGasScalar = info.DAFootprintGasScalar
110+
r.SetDAFootprintGasScalar(info.DAFootprintGasScalar)
113111
}
114112
return r, nil
115113
}

0 commit comments

Comments
 (0)