@@ -133,6 +133,7 @@ var (
133133 ShanghaiTime : nil ,
134134 CancunTime : nil ,
135135 PragueTime : nil ,
136+ OsakaTime : nil ,
136137 VerkleTime : nil ,
137138 Ethash : new (EthashConfig ),
138139 Clique : nil ,
@@ -182,6 +183,7 @@ var (
182183 ShanghaiTime : nil ,
183184 CancunTime : nil ,
184185 PragueTime : nil ,
186+ OsakaTime : nil ,
185187 VerkleTime : nil ,
186188 TerminalTotalDifficulty : big .NewInt (math .MaxInt64 ),
187189 Ethash : nil ,
@@ -211,6 +213,7 @@ var (
211213 ShanghaiTime : nil ,
212214 CancunTime : nil ,
213215 PragueTime : nil ,
216+ OsakaTime : nil ,
214217 VerkleTime : nil ,
215218 TerminalTotalDifficulty : big .NewInt (math .MaxInt64 ),
216219 Ethash : new (EthashConfig ),
@@ -240,6 +243,7 @@ var (
240243 ShanghaiTime : newUint64 (0 ),
241244 CancunTime : newUint64 (0 ),
242245 PragueTime : newUint64 (0 ),
246+ OsakaTime : nil ,
243247 VerkleTime : nil ,
244248 TerminalTotalDifficulty : big .NewInt (0 ),
245249 Ethash : new (EthashConfig ),
@@ -269,6 +273,7 @@ var (
269273 ShanghaiTime : nil ,
270274 CancunTime : nil ,
271275 PragueTime : nil ,
276+ OsakaTime : nil ,
272277 VerkleTime : nil ,
273278 TerminalTotalDifficulty : big .NewInt (math .MaxInt64 ),
274279 Ethash : new (EthashConfig ),
@@ -318,6 +323,7 @@ type ChainConfig struct {
318323 ShanghaiTime * uint64 `json:"shanghaiTime,omitempty"` // Shanghai switch time (nil = no fork, 0 = already on shanghai)
319324 CancunTime * uint64 `json:"cancunTime,omitempty"` // Cancun switch time (nil = no fork, 0 = already on cancun)
320325 PragueTime * uint64 `json:"pragueTime,omitempty"` // Prague switch time (nil = no fork, 0 = already on prague)
326+ OsakaTime * uint64 `json:"osakaTime,omitempty"` // Osaka switch time (nil = no fork, 0 = already on osaka)
321327 VerkleTime * uint64 `json:"verkleTime,omitempty"` // Verkle switch time (nil = no fork, 0 = already on verkle)
322328
323329 // TerminalTotalDifficulty is the amount of total difficulty reached by
@@ -432,6 +438,9 @@ func (c *ChainConfig) Description() string {
432438 if c .PragueTime != nil {
433439 banner += fmt .Sprintf (" - Prague: @%-10v\n " , * c .PragueTime )
434440 }
441+ if c .OsakaTime != nil {
442+ banner += fmt .Sprintf (" - Osaka: @%-10v\n " , * c .OsakaTime )
443+ }
435444 if c .VerkleTime != nil {
436445 banner += fmt .Sprintf (" - Verkle: @%-10v\n " , * c .VerkleTime )
437446 }
@@ -533,6 +542,11 @@ func (c *ChainConfig) IsPrague(num *big.Int, time uint64) bool {
533542 return c .IsLondon (num ) && isTimestampForked (c .PragueTime , time )
534543}
535544
545+ // IsOsaka returns whether time is either equal to the Osaka fork time or greater.
546+ func (c * ChainConfig ) IsOsaka (num * big.Int , time uint64 ) bool {
547+ return c .IsLondon (num ) && isTimestampForked (c .OsakaTime , time )
548+ }
549+
536550// IsVerkle returns whether time is either equal to the Verkle fork time or greater.
537551func (c * ChainConfig ) IsVerkle (num * big.Int , time uint64 ) bool {
538552 return c .IsLondon (num ) && isTimestampForked (c .VerkleTime , time )
@@ -611,6 +625,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
611625 {name : "shanghaiTime" , timestamp : c .ShanghaiTime },
612626 {name : "cancunTime" , timestamp : c .CancunTime , optional : true },
613627 {name : "pragueTime" , timestamp : c .PragueTime , optional : true },
628+ {name : "osakaTime" , timestamp : c .OsakaTime , optional : true },
614629 {name : "verkleTime" , timestamp : c .VerkleTime , optional : true },
615630 } {
616631 if lastFork .name != "" {
@@ -715,6 +730,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int,
715730 if isForkTimestampIncompatible (c .PragueTime , newcfg .PragueTime , headTimestamp ) {
716731 return newTimestampCompatError ("Prague fork timestamp" , c .PragueTime , newcfg .PragueTime )
717732 }
733+ if isForkTimestampIncompatible (c .OsakaTime , newcfg .OsakaTime , headTimestamp ) {
734+ return newTimestampCompatError ("Osaka fork timestamp" , c .OsakaTime , newcfg .OsakaTime )
735+ }
718736 if isForkTimestampIncompatible (c .VerkleTime , newcfg .VerkleTime , headTimestamp ) {
719737 return newTimestampCompatError ("Verkle fork timestamp" , c .VerkleTime , newcfg .VerkleTime )
720738 }
@@ -737,6 +755,8 @@ func (c *ChainConfig) LatestFork(time uint64) forks.Fork {
737755 london := c .LondonBlock
738756
739757 switch {
758+ case c .IsOsaka (london , time ):
759+ return forks .Osaka
740760 case c .IsPrague (london , time ):
741761 return forks .Prague
742762 case c .IsCancun (london , time ):
@@ -888,7 +908,7 @@ type Rules struct {
888908 IsEIP2929 , IsEIP4762 bool
889909 IsByzantium , IsConstantinople , IsPetersburg , IsIstanbul bool
890910 IsBerlin , IsLondon bool
891- IsMerge , IsShanghai , IsCancun , IsPrague bool
911+ IsMerge , IsShanghai , IsCancun , IsPrague , IsOsaka bool
892912 IsVerkle bool
893913}
894914
@@ -918,6 +938,7 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules
918938 IsShanghai : isMerge && c .IsShanghai (num , timestamp ),
919939 IsCancun : isMerge && c .IsCancun (num , timestamp ),
920940 IsPrague : isMerge && c .IsPrague (num , timestamp ),
941+ IsOsaka : isMerge && c .IsOsaka (num , timestamp ),
921942 IsVerkle : isVerkle ,
922943 IsEIP4762 : isVerkle ,
923944 }
0 commit comments