Skip to content

Commit

Permalink
Add missing fjord getters/print on startup (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
danyalprout authored Apr 23, 2024
1 parent 517f013 commit eb94eab
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 @@ -545,6 +545,9 @@ func (c *ChainConfig) Description() string {
if c.EcotoneTime != nil {
banner += fmt.Sprintf(" - Ecotone: @%-10v\n", *c.EcotoneTime)
}
if c.FjordTime != nil {
banner += fmt.Sprintf(" - Fjord: @%-10v\n", *c.FjordTime)
}
if c.InteropTime != nil {
banner += fmt.Sprintf(" - Interop: @%-10v\n", *c.InteropTime)
}
Expand Down Expand Up @@ -668,6 +671,10 @@ func (c *ChainConfig) IsEcotone(time uint64) bool {
return isTimestampForked(c.EcotoneTime, time)
}

func (c *ChainConfig) IsFjord(time uint64) bool {
return isTimestampForked(c.FjordTime, time)
}

func (c *ChainConfig) IsInterop(time uint64) bool {
return isTimestampForked(c.InteropTime, time)
}
Expand All @@ -694,6 +701,10 @@ func (c *ChainConfig) IsOptimismEcotone(time uint64) bool {
return c.IsOptimism() && c.IsEcotone(time)
}

func (c *ChainConfig) IsOptimismFjord(time uint64) bool {
return c.IsOptimism() && c.IsFjord(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 Expand Up @@ -1034,7 +1045,7 @@ type Rules struct {
IsMerge, IsShanghai, IsCancun, IsPrague bool
IsVerkle bool
IsOptimismBedrock, IsOptimismRegolith bool
IsOptimismCanyon bool
IsOptimismCanyon, IsOptimismFjord bool
}

// Rules ensures c's ChainID is not nil.
Expand Down Expand Up @@ -1066,5 +1077,6 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules
IsOptimismBedrock: isMerge && c.IsOptimismBedrock(num),
IsOptimismRegolith: isMerge && c.IsOptimismRegolith(timestamp),
IsOptimismCanyon: isMerge && c.IsOptimismCanyon(timestamp),
IsOptimismFjord: isMerge && c.IsOptimismFjord(timestamp),
}
}

0 comments on commit eb94eab

Please sign in to comment.