Skip to content

Commit 377bbb5

Browse files
authored
Add Jovian time config (#463)
* Add Jovian time config * Add Jovian in all the places
1 parent 35e2c85 commit 377bbb5

File tree

10 files changed

+55
-12
lines changed

10 files changed

+55
-12
lines changed

cmd/geth/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ func makeFullNode(ctx *cli.Context) *node.Node {
218218
cfg.Eth.OverrideOptimismIsthmus = &v
219219
}
220220

221+
if ctx.IsSet(utils.OverrideOptimismJovian.Name) {
222+
v := ctx.Uint64(utils.OverrideOptimismJovian.Name)
223+
cfg.Eth.OverrideOptimismJovian = &v
224+
}
225+
221226
if ctx.IsSet(utils.OverrideOptimismInterop.Name) {
222227
v := ctx.Uint64(utils.OverrideOptimismInterop.Name)
223228
cfg.Eth.OverrideOptimismInterop = &v

cmd/geth/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ var (
7070
utils.OverrideOptimismFjord,
7171
utils.OverrideOptimismGranite,
7272
utils.OverrideOptimismHolocene,
73-
utils.OverrideOptimismInterop,
7473
utils.OverrideOptimismIsthmus,
74+
utils.OverrideOptimismJovian,
75+
utils.OverrideOptimismInterop,
7576
utils.EnablePersonal, // deprecated
7677
utils.TxPoolLocalsFlag,
7778
utils.TxPoolNoLocalsFlag,

cmd/utils/flags.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,19 @@ var (
273273
Usage: "Manually specify the Optimism Granite fork timestamp, overriding the bundled setting",
274274
Category: flags.EthCategory,
275275
}
276+
OverrideOptimismHolocene = &cli.Uint64Flag{
277+
Name: "override.holocene",
278+
Usage: "Manually specify the Optimism Holocene fork timestamp, overriding the bundled setting",
279+
Category: flags.EthCategory,
280+
}
276281
OverrideOptimismIsthmus = &cli.Uint64Flag{
277282
Name: "override.isthmus",
278283
Usage: "Manually specify the Optimism Isthmus fork timestamp, overriding the bundled setting",
279284
Category: flags.EthCategory,
280285
}
281-
OverrideOptimismHolocene = &cli.Uint64Flag{
282-
Name: "override.holocene",
283-
Usage: "Manually specify the Optimism Holocene fork timestamp, overriding the bundled setting",
286+
OverrideOptimismJovian = &cli.Uint64Flag{
287+
Name: "override.jovian",
288+
Usage: "Manually specify the Optimism Jovian fork timestamp, overriding the bundled setting",
284289
Category: flags.EthCategory,
285290
}
286291
OverrideOptimismInterop = &cli.Uint64Flag{

core/genesis.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ type ChainOverrides struct {
285285
OverrideOptimismGranite *uint64
286286
OverrideOptimismHolocene *uint64
287287
OverrideOptimismIsthmus *uint64
288+
OverrideOptimismJovian *uint64
288289
OverrideOptimismInterop *uint64
289290
ApplySuperchainUpgrades bool
290291
}
@@ -355,6 +356,9 @@ func (o *ChainOverrides) apply(cfg *params.ChainConfig) (*params.ChainConfig, er
355356
cpy.IsthmusTime = o.OverrideOptimismIsthmus
356357
cpy.PragueTime = o.OverrideOptimismIsthmus
357358
}
359+
if o.OverrideOptimismJovian != nil {
360+
cpy.JovianTime = o.OverrideOptimismJovian
361+
}
358362
if o.OverrideOptimismInterop != nil {
359363
cpy.InteropTime = o.OverrideOptimismInterop
360364
}

eth/backend.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
247247
if config.OverrideOptimismIsthmus != nil {
248248
overrides.OverrideOptimismIsthmus = config.OverrideOptimismIsthmus
249249
}
250+
if config.OverrideOptimismJovian != nil {
251+
overrides.OverrideOptimismJovian = config.OverrideOptimismJovian
252+
}
250253
if config.OverrideOptimismInterop != nil {
251254
overrides.OverrideOptimismInterop = config.OverrideOptimismInterop
252255
}

eth/ethconfig/config.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,12 @@ type Config struct {
165165

166166
OverrideOptimismHolocene *uint64 `toml:",omitempty"`
167167

168-
OverrideOptimismInterop *uint64 `toml:",omitempty"`
169-
170168
OverrideOptimismIsthmus *uint64 `toml:",omitempty"`
171169

170+
OverrideOptimismJovian *uint64 `toml:",omitempty"`
171+
172+
OverrideOptimismInterop *uint64 `toml:",omitempty"`
173+
172174
// ApplySuperchainUpgrades requests the node to load chain-configuration from the superchain-registry.
173175
ApplySuperchainUpgrades bool `toml:",omitempty"`
174176

eth/ethconfig/gen_config.go

Lines changed: 12 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

params/config.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ type ChainConfig struct {
345345
GraniteTime *uint64 `json:"graniteTime,omitempty"` // Granite switch time (nil = no fork, 0 = already on Optimism Granite)
346346
HoloceneTime *uint64 `json:"holoceneTime,omitempty"` // Holocene switch time (nil = no fork, 0 = already on Optimism Holocene)
347347
IsthmusTime *uint64 `json:"isthmusTime,omitempty"` // Isthmus switch time (nil = no fork, 0 = already on Optimism Isthmus)
348+
JovianTime *uint64 `json:"jovianTime,omitempty"` // Jovian switch time (nil = no fork, 0 = already on Optimism Jovian)
348349

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

@@ -501,6 +502,9 @@ func (c *ChainConfig) Description() string {
501502
if c.IsthmusTime != nil {
502503
banner += fmt.Sprintf(" - Isthmus: @%-10v\n", *c.IsthmusTime)
503504
}
505+
if c.JovianTime != nil {
506+
banner += fmt.Sprintf(" - Jovian: @%-10v\n", *c.JovianTime)
507+
}
504508
if c.InteropTime != nil {
505509
banner += fmt.Sprintf(" - Interop: @%-10v\n", *c.InteropTime)
506510
}
@@ -659,6 +663,10 @@ func (c *ChainConfig) IsIsthmus(time uint64) bool {
659663
return isTimestampForked(c.IsthmusTime, time)
660664
}
661665

666+
func (c *ChainConfig) IsJovian(time uint64) bool {
667+
return isTimestampForked(c.JovianTime, time)
668+
}
669+
662670
func (c *ChainConfig) IsInterop(time uint64) bool {
663671
return isTimestampForked(c.InteropTime, time)
664672
}
@@ -701,6 +709,10 @@ func (c *ChainConfig) IsOptimismIsthmus(time uint64) bool {
701709
return c.IsOptimism() && c.IsIsthmus(time)
702710
}
703711

712+
func (c *ChainConfig) IsOptimismJovian(time uint64) bool {
713+
return c.IsOptimism() && c.IsJovian(time)
714+
}
715+
704716
// IsOptimismPreBedrock returns true iff this is an optimism node & bedrock is not yet active
705717
func (c *ChainConfig) IsOptimismPreBedrock(num *big.Int) bool {
706718
return c.IsOptimism() && !c.IsBedrock(num)
@@ -892,6 +904,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int,
892904
if isForkTimestampIncompatible(c.IsthmusTime, newcfg.IsthmusTime, headTimestamp, genesisTimestamp) {
893905
return newTimestampCompatError("Isthmus fork timestamp", c.IsthmusTime, newcfg.IsthmusTime)
894906
}
907+
if isForkTimestampIncompatible(c.JovianTime, newcfg.JovianTime, headTimestamp, genesisTimestamp) {
908+
return newTimestampCompatError("Jovian fork timestamp", c.JovianTime, newcfg.JovianTime)
909+
}
895910
if isForkTimestampIncompatible(c.InteropTime, newcfg.InteropTime, headTimestamp, genesisTimestamp) {
896911
return newTimestampCompatError("Interop fork timestamp", c.InteropTime, newcfg.InteropTime)
897912
}

params/superchain.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func LoadOPStackChainConfig(chConfig *superchain.ChainConfig) (*ChainConfig, err
5555
GraniteTime: hardforks.GraniteTime,
5656
HoloceneTime: hardforks.HoloceneTime,
5757
IsthmusTime: hardforks.IsthmusTime,
58+
JovianTime: hardforks.JovianTime,
5859
TerminalTotalDifficulty: common.Big0,
5960
Ethash: nil,
6061
Clique: nil,

superchain/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ type HardforkConfig struct {
4141
GraniteTime *uint64 `toml:"granite_time"`
4242
HoloceneTime *uint64 `toml:"holocene_time"`
4343
IsthmusTime *uint64 `toml:"isthmus_time"`
44+
JovianTime *uint64 `toml:"jovian_time"`
4445
}
4546

4647
type OptimismConfig struct {

0 commit comments

Comments
 (0)