Skip to content

Commit d3738b2

Browse files
committed
jovian: remove feature toggles
scope is now fixed
1 parent 32d2b05 commit d3738b2

File tree

12 files changed

+29
-41
lines changed

12 files changed

+29
-41
lines changed

op-acceptance-tests/tests/jovian/min_base_fee_test.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
@@ -604,7 +604,7 @@ func gasCost(rcpt *types.Receipt, rollupCfg *rollup.Config, blockTimestamp *uint
604604
}
605605
operatorCost := new(big.Int).SetUint64(rcpt.GasUsed)
606606
operatorCost.Mul(operatorCost, new(big.Int).SetUint64(*rcpt.OperatorFeeScalar))
607-
if rollupCfg.IsOperatorFeeFix(*blockTimestamp) {
607+
if rollupCfg.IsJovian(*blockTimestamp) {
608608
operatorCost.Mul(operatorCost, big.NewInt(100))
609609
} else {
610610
operatorCost.Div(operatorCost, big.NewInt(1_000_000))

op-e2e/actions/proofs/jovian_activation_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func Test_ProgramAction_JovianActivation(gt *testing.T) {
7171
// Build the activation block
7272
env.Sequencer.ActL2EmptyBlock(t)
7373
activationBlock := env.Engine.L2Chain().GetBlockByHash(env.Sequencer.L2Unsafe().Hash)
74-
require.Equal(t, eip1559.EncodeMinBaseFeeExtraData(250, 6, 0), activationBlock.Extra(), "activation block should have Jovian extraData")
74+
require.Equal(t, eip1559.EncodeJovianExtraData(250, 6, 0), activationBlock.Extra(), "activation block should have Jovian extraData")
7575

7676
// Set the minimum base fee
7777
setMinBaseFeeViaSystemConfig(t, env, minBaseFee)
@@ -92,7 +92,7 @@ func Test_ProgramAction_JovianActivation(gt *testing.T) {
9292
// Block after the SystemConfig change
9393
env.Sequencer.ActL2EmptyBlock(t)
9494
blockAfterSystemConfigChange := env.Engine.L2Chain().GetBlockByHash(env.Sequencer.L2Unsafe().Hash)
95-
expectedJovianExtraDataWithMinFee := eip1559.EncodeMinBaseFeeExtraData(250, 6, minBaseFee)
95+
expectedJovianExtraDataWithMinFee := eip1559.EncodeJovianExtraData(250, 6, minBaseFee)
9696
require.Equal(t, expectedJovianExtraDataWithMinFee, blockAfterSystemConfigChange.Extra(), "block should have updated Jovian extraData with min base fee")
9797

9898
// 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
@@ -48,7 +48,7 @@ func jovianArgs() matchArgs {
4848
validTxData, _ = validTx.MarshalBinary()
4949
minBaseFee = uint64(1e9)
5050

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

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
}
@@ -209,7 +209,7 @@ func (ba *FetchingAttributesBuilder) PreparePayloadAttributes(ctx context.Contex
209209
r.EIP1559Params = new(eth.Bytes8)
210210
*r.EIP1559Params = sysConfig.EIP1559Params
211211
}
212-
if ba.rollupCfg.IsMinBaseFee(nextL2Time) {
212+
if ba.rollupCfg.IsJovian(nextL2Time) {
213213
r.MinBaseFee = &sysConfig.MinBaseFee
214214
}
215215
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/payload_util.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,9 @@ 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)) {
112110
r.SetDAFootprintGasScalar(info.DAFootprintGasScalar)
113111
}
114112
return r, nil

op-node/rollup/interop/indexing/attributes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func AttributesToReplaceInvalidBlock(invalidatedBlock *eth.ExecutionPayloadEnvel
5454
// unfortunately, the engine API needs the inner value, not the extra-data.
5555
// So we translate it here.
5656
extraData := invalidatedBlock.ExecutionPayload.ExtraData
57-
denominator, elasticity, minBaseFee := eip1559.DecodeMinBaseFeeExtraData(extraData)
57+
denominator, elasticity, minBaseFee := eip1559.DecodeJovianExtraData(extraData)
5858
eip1559Params := eth.Bytes8(eip1559.EncodeHolocene1559Params(denominator, elasticity))
5959

6060
attrs := &eth.PayloadAttributes{

0 commit comments

Comments
 (0)