Skip to content

Commit ccd6aa8

Browse files
committed
Switch rollout to Jovian
1 parent dc3e6fe commit ccd6aa8

File tree

3 files changed

+42
-30
lines changed

3 files changed

+42
-30
lines changed

core/types/rollup_cost.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ var (
5555
// EcotoneL1AttributesSelector is the selector indicating Ecotone style L1 gas attributes.
5656
// keccak256("setL1BlockValuesEcotone()")[:4]
5757
EcotoneL1AttributesSelector = [4]byte{0x44, 0x0a, 0x5e, 0x20}
58-
// IsthmusL1AttributesSelector is the selector indicating Isthmus style L1 gas attributes.
59-
// keccak256("setL1BlockValuesIsthmus()")[:4]
60-
IsthmusL1AttributesSelector = [4]byte{0x09, 0x89, 0x99, 0xbe}
58+
// JovianL1AttributesSelector is the selector indicating Jovian style L1 gas attributes.
59+
// keccak256("setL1BlockValuesJovian()")[:4]
60+
JovianL1AttributesSelector = [4]byte{0x3d, 0xb6, 0xbe, 0x2b}
6161
// InteropL1AttributesSelector is the selector indicating Interop style L1 gas attributes.
6262
// keccak256("setL1BlockValuesInterop()")[:4]
6363
InteropL1AttributesSelector = [4]byte{0x76, 0x0e, 0xe0, 0x4d}
@@ -273,7 +273,7 @@ func extractL1GasParams(config *params.ChainConfig, time uint64, data []byte) (g
273273
var err error
274274
var signature [4]byte
275275
copy(signature[:], data)
276-
// Note: for Ecotone + Isthmus, the new L1Block method selector is used in the block after
276+
// Note: for Ecotone + Jovian, the new L1Block method selector is used in the block after
277277
// activation, so we use the selector for the switch block rather than the fork time.
278278
switch signature {
279279
case BedrockL1AttributesSelector:
@@ -283,17 +283,17 @@ func extractL1GasParams(config *params.ChainConfig, time uint64, data []byte) (g
283283
return gasParams{}, fmt.Errorf("setL1BlockValuesEcotone called before Ecotone active")
284284
}
285285
p, err = extractL1GasParamsPostEcotone(data)
286-
case IsthmusL1AttributesSelector:
287-
if !config.IsIsthmus(time) {
288-
return gasParams{}, fmt.Errorf("setL1BlockValuesIsthmus called before Isthmus active")
286+
case JovianL1AttributesSelector:
287+
if !config.IsJovian(time) {
288+
return gasParams{}, fmt.Errorf("setL1BlockValuesJovian called before Jovian active")
289289
}
290-
p, err = extractL1GasParamsPostIsthmus(data)
290+
p, err = extractL1GasParamsPostJovian(data)
291291
case InteropL1AttributesSelector:
292292
if !config.IsInterop(time) {
293293
return gasParams{}, fmt.Errorf("setL1BlockValuesInterop called before Interop active")
294294
}
295-
// Interop uses the same tx calldata size/format as Isthmus
296-
p, err = extractL1GasParamsPostIsthmus(data)
295+
// Interop uses the same tx calldata size/format as Jovian
296+
p, err = extractL1GasParamsPostJovian(data)
297297
default:
298298
return gasParams{}, fmt.Errorf("unknown L1Block function signature: 0x%s", common.Bytes2Hex(signature[:]))
299299
}
@@ -345,19 +345,19 @@ func extractL1GasParamsPostEcotone(data []byte) (gasParams, error) {
345345
if len(data) != 164 {
346346
return gasParams{}, fmt.Errorf("expected 164 L1 info bytes, got %d", len(data))
347347
}
348-
return extractL1GasParamsPostEcotoneIsthmus(data)
348+
return extractL1GasParamsPostEcotoneJovian(data)
349349
}
350350

351-
// extractL1GasParamsPostIsthmus extracts the gas parameters necessary to compute gas from L1 attribute
352-
// info calldata after the Isthmus upgrade, but not for the very first Isthmus block.
353-
func extractL1GasParamsPostIsthmus(data []byte) (gasParams, error) {
351+
// extractL1GasParamsPostJovian extracts the gas parameters necessary to compute gas from L1 attribute
352+
// info calldata after the Jovian upgrade, but not for the very first Jovian block.
353+
func extractL1GasParamsPostJovian(data []byte) (gasParams, error) {
354354
if len(data) != 180 {
355355
return gasParams{}, fmt.Errorf("expected 180 L1 info bytes, got %d", len(data))
356356
}
357-
return extractL1GasParamsPostEcotoneIsthmus(data)
357+
return extractL1GasParamsPostEcotoneJovian(data)
358358
}
359359

360-
func extractL1GasParamsPostEcotoneIsthmus(data []byte) (gasParams, error) {
360+
func extractL1GasParamsPostEcotoneJovian(data []byte) (gasParams, error) {
361361
// data layout assumed for Ecotone:
362362
// offset type varname
363363
// 0 <selector>
@@ -370,7 +370,7 @@ func extractL1GasParamsPostEcotoneIsthmus(data []byte) (gasParams, error) {
370370
// 68 uint256 _blobBaseFee,
371371
// 100 bytes32 _hash,
372372
// 132 bytes32 _batcherHash,
373-
// Isthmus adds two more uint64s, which are ignored by this function:
373+
// Jovian adds two more uint64s, which are ignored by this function:
374374
// 164 uint64 _depositNonce
375375
// 172 uint64 _configUpdateNonce
376376
l1BaseFee := new(big.Int).SetBytes(data[36:68])

core/types/rollup_cost_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,19 +206,19 @@ func TestExtractFjordGasParams(t *testing.T) {
206206
require.Equal(t, fjordFee, c)
207207
}
208208

209-
func TestExtractIsthmusGasParams(t *testing.T) {
209+
func TestExtractJovianGasParams(t *testing.T) {
210210
zeroTime := uint64(0)
211-
// create a config where isthmus is active
211+
// create a config where jovian is active
212212
config := &params.ChainConfig{
213213
Optimism: params.OptimismTestConfig.Optimism,
214214
RegolithTime: &zeroTime,
215215
EcotoneTime: &zeroTime,
216216
FjordTime: &zeroTime,
217-
IsthmusTime: &zeroTime,
217+
JovianTime: &zeroTime,
218218
}
219-
require.True(t, config.IsOptimismIsthmus(zeroTime))
219+
require.True(t, config.IsOptimismJovian(zeroTime))
220220

221-
data := getIsthmusL1Attributes(
221+
data := getJovianL1Attributes(
222222
baseFee,
223223
blobBaseFee,
224224
baseFeeScalar,
@@ -257,20 +257,20 @@ func TestFirstBlockEcotoneGasParams(t *testing.T) {
257257
require.Equal(t, regolithFee, c)
258258
}
259259

260-
// make sure the first block of the isthmus upgrade is properly detected, and invokes the ecotone
260+
// make sure the first block of the jovian upgrade is properly detected, and invokes the ecotone
261261
// cost function appropriately
262-
func TestFirstBlockIsthmusGasParams(t *testing.T) {
262+
func TestFirstBlockJovianGasParams(t *testing.T) {
263263
zeroTime := uint64(0)
264-
// create a config where isthmus upgrade is active
264+
// create a config where jovian upgrade is active
265265
config := &params.ChainConfig{
266266
Optimism: params.OptimismTestConfig.Optimism,
267267
RegolithTime: &zeroTime,
268268
EcotoneTime: &zeroTime,
269269
FjordTime: &zeroTime,
270-
IsthmusTime: &zeroTime,
270+
JovianTime: &zeroTime,
271271
}
272272
require.True(t, config.IsOptimismEcotone(0))
273-
require.True(t, config.IsOptimismIsthmus(0))
273+
require.True(t, config.IsOptimismJovian(0))
274274

275275
data := getEcotoneL1Attributes(
276276
baseFee,
@@ -322,13 +322,13 @@ func getEcotoneL1Attributes(baseFee, blobBaseFee, baseFeeScalar, blobBaseFeeScal
322322
return data
323323
}
324324

325-
func getIsthmusL1Attributes(baseFee, blobBaseFee, baseFeeScalar, blobBaseFeeScalar *big.Int) []byte {
325+
func getJovianL1Attributes(baseFee, blobBaseFee, baseFeeScalar, blobBaseFeeScalar *big.Int) []byte {
326326
ignored := big.NewInt(1234)
327327
data := []byte{}
328328
uint256Slice := make([]byte, 32)
329329
uint64Slice := make([]byte, 8)
330330
uint32Slice := make([]byte, 4)
331-
data = append(data, IsthmusL1AttributesSelector[:]...)
331+
data = append(data, JovianL1AttributesSelector[:]...)
332332
data = append(data, baseFeeScalar.FillBytes(uint32Slice)...)
333333
data = append(data, blobBaseFeeScalar.FillBytes(uint32Slice)...)
334334
data = append(data, ignored.FillBytes(uint64Slice)...)

params/config.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ type ChainConfig struct {
353353
GraniteTime *uint64 `json:"graniteTime,omitempty"` // Granite switch time (nil = no fork, 0 = already on Optimism Granite)
354354
HoloceneTime *uint64 `json:"holoceneTime,omitempty"` // Holocene switch time (nil = no fork, 0 = already on Optimism Holocene)
355355
IsthmusTime *uint64 `json:"isthmusTime,omitempty"` // Isthmus switch time (nil = no fork, 0 = already on Optimism Isthmus)
356+
JovianTime *uint64 `json:"jovianTime,omitempty"` // Jovian switch time (nil = no fork, 0 = already on Optimism Jovian)
356357

357358
InteropTime *uint64 `json:"interopTime,omitempty"` // Interop switch time (nil = no fork, 0 = already on optimism interop)
358359

@@ -515,11 +516,14 @@ func (c *ChainConfig) Description() string {
515516
banner += fmt.Sprintf(" - Granite: @%-10v\n", *c.GraniteTime)
516517
}
517518
if c.HoloceneTime != nil {
518-
banner += fmt.Sprintf(" - Holocene: @%-10v\n", *c.HoloceneTime)
519+
banner += fmt.Sprintf(" - Holocene: @%-10v\n", *c.HoloceneTime)
519520
}
520521
if c.IsthmusTime != nil {
521522
banner += fmt.Sprintf(" - Isthmus: @%-10v\n", *c.IsthmusTime)
522523
}
524+
if c.JovianTime != nil {
525+
banner += fmt.Sprintf(" - Jovian: @%-10v\n", *c.JovianTime)
526+
}
523527
if c.InteropTime != nil {
524528
banner += fmt.Sprintf(" - Interop: @%-10v\n", *c.InteropTime)
525529
}
@@ -664,6 +668,10 @@ func (c *ChainConfig) IsIsthmus(time uint64) bool {
664668
return isTimestampForked(c.IsthmusTime, time)
665669
}
666670

671+
func (c *ChainConfig) IsJovian(time uint64) bool {
672+
return isTimestampForked(c.JovianTime, time)
673+
}
674+
667675
func (c *ChainConfig) IsInterop(time uint64) bool {
668676
return isTimestampForked(c.InteropTime, time)
669677
}
@@ -706,6 +714,10 @@ func (c *ChainConfig) IsOptimismIsthmus(time uint64) bool {
706714
return c.IsOptimism() && c.IsIsthmus(time)
707715
}
708716

717+
func (c *ChainConfig) IsOptimismJovian(time uint64) bool {
718+
return c.IsOptimism() && c.IsJovian(time)
719+
}
720+
709721
// IsOptimismPreBedrock returns true iff this is an optimism node & bedrock is not yet active
710722
func (c *ChainConfig) IsOptimismPreBedrock(num *big.Int) bool {
711723
return c.IsOptimism() && !c.IsBedrock(num)

0 commit comments

Comments
 (0)