Skip to content

Commit

Permalink
Add Jovian time config
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog committed Jan 13, 2025
1 parent 928070c commit 3921492
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ type ChainConfig struct {
GraniteTime *uint64 `json:"graniteTime,omitempty"` // Granite switch time (nil = no fork, 0 = already on Optimism Granite)
HoloceneTime *uint64 `json:"holoceneTime,omitempty"` // Holocene switch time (nil = no fork, 0 = already on Optimism Holocene)
IsthmusTime *uint64 `json:"isthmusTime,omitempty"` // Isthmus switch time (nil = no fork, 0 = already on Optimism Isthmus)
JovianTime *uint64 `json:"jovianTime,omitempty"` // Jovian switch time (nil = no fork, 0 = already on Optimism Jovian)

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

Expand Down Expand Up @@ -515,11 +516,14 @@ func (c *ChainConfig) Description() string {
banner += fmt.Sprintf(" - Granite: @%-10v\n", *c.GraniteTime)
}
if c.HoloceneTime != nil {
banner += fmt.Sprintf(" - Holocene: @%-10v\n", *c.HoloceneTime)
banner += fmt.Sprintf(" - Holocene: @%-10v\n", *c.HoloceneTime)
}
if c.IsthmusTime != nil {
banner += fmt.Sprintf(" - Isthmus: @%-10v\n", *c.IsthmusTime)
}
if c.JovianTime != nil {
banner += fmt.Sprintf(" - Jovian: @%-10v\n", *c.JovianTime)
}
if c.InteropTime != nil {
banner += fmt.Sprintf(" - Interop: @%-10v\n", *c.InteropTime)
}
Expand Down Expand Up @@ -664,6 +668,10 @@ func (c *ChainConfig) IsIsthmus(time uint64) bool {
return isTimestampForked(c.IsthmusTime, time)
}

func (c *ChainConfig) IsJovian(time uint64) bool {
return isTimestampForked(c.JovianTime, time)
}

func (c *ChainConfig) IsInterop(time uint64) bool {
return isTimestampForked(c.InteropTime, time)
}
Expand Down Expand Up @@ -706,6 +714,10 @@ func (c *ChainConfig) IsOptimismIsthmus(time uint64) bool {
return c.IsOptimism() && c.IsIsthmus(time)
}

func (c *ChainConfig) IsOptimismJovian(time uint64) bool {
return c.IsOptimism() && c.IsJovian(time)
}

// IsOptimismPreBedrock returns true iff this is an optimism node & bedrock is not yet active
func (c *ChainConfig) IsOptimismPreBedrock(num *big.Int) bool {
return c.IsOptimism() && !c.IsBedrock(num)
Expand Down

0 comments on commit 3921492

Please sign in to comment.