Skip to content

Commit 2c58d98

Browse files
committed
jovian: remove feature toggles
the scope is now locked
1 parent 6658a36 commit 2c58d98

File tree

7 files changed

+13
-19
lines changed

7 files changed

+13
-19
lines changed

consensus/beacon/consensus.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ func (beacon *Beacon) FinalizeAndAssemble(chain consensus.ChainHeaderReader, hea
412412

413413
// Store DA footprint in BlobGasUsed header field if it hasn't already been set yet.
414414
// Builder code may already calculate it during block building to avoid recalculating it here.
415-
if chain.Config().IsDAFootprintBlockLimit(header.Time) && (header.BlobGasUsed == nil || *header.BlobGasUsed == 0) {
415+
if chain.Config().IsJovian(header.Time) && (header.BlobGasUsed == nil || *header.BlobGasUsed == 0) {
416416
daFootprint, err := types.CalcDAFootprint(body.Transactions)
417417
if err != nil {
418418
return nil, fmt.Errorf("error calculating DA footprint: %w", err)

consensus/misc/eip1559/eip1559.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func CalcBaseFee(config *params.ChainConfig, parent *types.Header, time uint64)
9292
func calcBaseFeeInner(config *params.ChainConfig, parent *types.Header, elasticity uint64, denominator uint64) *big.Int {
9393
parentGasTarget := parent.GasLimit / elasticity
9494
parentGasMetered := parent.GasUsed
95-
if config.IsDAFootprintBlockLimit(parent.Time) {
95+
if config.IsJovian(parent.Time) {
9696
if parent.BlobGasUsed == nil {
9797
panic("Jovian parent block has nil BlobGasUsed")
9898
} else if *parent.BlobGasUsed > parent.GasUsed {

core/block_validator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (v *BlockValidator) ValidateBody(block *types.Block) error {
117117
}
118118

119119
// OP Stack Jovian DA footprint block limit.
120-
if v.config.IsDAFootprintBlockLimit(header.Time) {
120+
if v.config.IsJovian(header.Time) {
121121
if header.BlobGasUsed == nil {
122122
return errors.New("nil blob gas used in post-Jovian block header, should store DA footprint")
123123
}

miner/miner_optimism_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func testMineAndExecute(t *testing.T, numTxs uint64, cfg *params.ChainConfig, as
113113
parent := b.chain.CurrentBlock()
114114
ts := parent.Time + 12
115115
dtx := new(types.DepositTx)
116-
if cfg.IsDAFootprintBlockLimit(parent.Time) {
116+
if cfg.IsJovian(parent.Time) {
117117
dtx = jovianDepositTx(testDAFootprintGasScalar)
118118
}
119119

miner/payload_building_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ func newPayloadArgs(parentHash common.Hash, cfg *params.ChainConfig) *BuildPaylo
271271
args.EIP1559Params = validEIP1559Params
272272
}
273273
dtx := new(types.DepositTx)
274-
if cfg.IsDAFootprintBlockLimit(args.Timestamp) {
274+
if cfg.IsJovian(args.Timestamp) {
275275
dtx = jovianDepositTx(testDAFootprintGasScalar)
276276
}
277277
args.Transactions = []*types.Transaction{types.NewTx(dtx)}

miner/worker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ func (miner *Miner) prepareWork(genParams *generateParams, witness bool) (*envir
355355
return nil, err
356356
}
357357
env.noTxs = genParams.noTxs
358-
if miner.chainConfig.IsDAFootprintBlockLimit(parent.Time) {
358+
if miner.chainConfig.IsJovian(parent.Time) {
359359
if len(genParams.txs) == 0 || !genParams.txs[0].IsDepositTx() {
360360
return nil, errors.New("missing L1 attributes deposit transaction")
361361
}
@@ -506,7 +506,7 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran
506506

507507
// OP-Stack additions: throttling and DA footprint limit
508508
blockDABytes := new(big.Int)
509-
isJovian := miner.chainConfig.IsDAFootprintBlockLimit(env.header.Time)
509+
isJovian := miner.chainConfig.IsJovian(env.header.Time)
510510
minTransactionDAFootprint := types.MinTransactionSize.Uint64() * uint64(env.daFootprintGasScalar)
511511

512512
for {

params/optimism_feature_toggles.go

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
package params
22

33
// OPStack diff
4-
// This file contains ephemeral feature toggles which should be removed
4+
// This file contains ephemeral feature toggles for the next
5+
// fork while it is in development. They should be removed
56
// after the fork scope is locked.
67

7-
func (c *ChainConfig) IsMinBaseFee(time uint64) bool {
8-
return c.IsJovian(time) // Replace with return false to disable
9-
}
10-
11-
func (c *ChainConfig) IsDAFootprintBlockLimit(time uint64) bool {
12-
return c.IsJovian(time) // Replace with return false to disable
13-
}
14-
15-
func (c *ChainConfig) IsOperatorFeeFix(time uint64) bool {
16-
return c.IsJovian(time) // Replace with return false to disable
17-
}
8+
// Example:
9+
// func (c *ChainConfig) IsMinBaseFee(time uint64) bool {
10+
// return c.IsJovian(time) // Replace with return false to disable
11+
// }

0 commit comments

Comments
 (0)