Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"errors"
"fmt"
"io"
"math"
"math/big"
"runtime"
"slices"
Expand Down Expand Up @@ -2659,13 +2658,11 @@ func (bc *BlockChain) reportBlock(block *types.Block, res *ProcessResult, err er
// logForkReadiness will write a log when a future fork is scheduled, but not
// active. This is useful so operators know their client is ready for the fork.
func (bc *BlockChain) logForkReadiness(block *types.Block) {
config := bc.Config()
current, last := config.LatestFork(block.Time()), config.LatestFork(math.MaxUint64)
current := bc.Config().LatestFork(block.Time())

// Short circuit if the timestamp of the last fork is undefined,
// or if the network has already passed the last configured fork.
t := config.Timestamp(last)
if t == nil || current >= last {
// Short circuit if the timestamp of the last fork is undefined.
t := bc.Config().Timestamp(current + 1)
if t == nil {
return
}
at := time.Unix(int64(*t), 0)
Expand All @@ -2675,7 +2672,7 @@ func (bc *BlockChain) logForkReadiness(block *types.Block) {
// - Enough time has passed since last alert
now := time.Now()
if now.Before(at) && now.After(bc.lastForkReadyAlert.Add(forkReadyInterval)) {
log.Info("Ready for fork activation", "fork", last, "date", at.Format(time.RFC822),
log.Info("Ready for fork activation", "fork", current+1, "date", at.Format(time.RFC822),
"remaining", time.Until(at).Round(time.Second), "timestamp", at.Unix())
bc.lastForkReadyAlert = time.Now()
}
Expand Down
5 changes: 5 additions & 0 deletions params/forks/forks.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,9 @@ var forkToString = map[Fork]string{
Cancun: "Cancun",
Prague: "Prague",
Osaka: "Osaka",
BPO1: "BPO1",
BPO2: "BPO2",
BPO3: "BPO3",
BPO4: "BPO4",
BPO5: "BPO5",
}