@@ -411,6 +411,11 @@ type ChainConfig struct {
411411 PragueTime * uint64 `json:"pragueTime,omitempty"` // Prague switch time (nil = no fork, 0 = already on prague)
412412 OsakaTime * uint64 `json:"osakaTime,omitempty"` // Osaka switch time (nil = no fork, 0 = already on osaka)
413413 VerkleTime * uint64 `json:"verkleTime,omitempty"` // Verkle switch time (nil = no fork, 0 = already on verkle)
414+ BPO1Time * uint64 `json:"bpo1Time,omitempty"` // BPO1 switch time (nil = no fork, 0 = already on bpo1)
415+ BPO2Time * uint64 `json:"bpo2Time,omitempty"` // BPO2 switch time (nil = no fork, 0 = already on bpo2)
416+ BPO3Time * uint64 `json:"bpo3Time,omitempty"` // BPO3 switch time (nil = no fork, 0 = already on bpo3)
417+ BPO4Time * uint64 `json:"bpo4Time,omitempty"` // BPO4 switch time (nil = no fork, 0 = already on bpo4)
418+ BPO5Time * uint64 `json:"bpo5Time,omitempty"` // BPO5 switch time (nil = no fork, 0 = already on bpo5)
414419
415420 // TerminalTotalDifficulty is the amount of total difficulty reached by
416421 // the network that triggers the consensus upgrade.
@@ -531,6 +536,21 @@ func (c *ChainConfig) Description() string {
531536 if c .VerkleTime != nil {
532537 banner += fmt .Sprintf (" - Verkle: @%-10v\n " , * c .VerkleTime )
533538 }
539+ if c .BPO1Time != nil {
540+ banner += fmt .Sprintf (" - BPO1: @%-10v\n " , * c .BPO1Time )
541+ }
542+ if c .BPO2Time != nil {
543+ banner += fmt .Sprintf (" - BPO2: @%-10v\n " , * c .BPO2Time )
544+ }
545+ if c .BPO3Time != nil {
546+ banner += fmt .Sprintf (" - BPO3: @%-10v\n " , * c .BPO3Time )
547+ }
548+ if c .BPO4Time != nil {
549+ banner += fmt .Sprintf (" - BPO4: @%-10v\n " , * c .BPO4Time )
550+ }
551+ if c .BPO5Time != nil {
552+ banner += fmt .Sprintf (" - BPO5: @%-10v\n " , * c .BPO5Time )
553+ }
534554 return banner
535555}
536556
@@ -547,6 +567,11 @@ type BlobScheduleConfig struct {
547567 Prague * BlobConfig `json:"prague,omitempty"`
548568 Osaka * BlobConfig `json:"osaka,omitempty"`
549569 Verkle * BlobConfig `json:"verkle,omitempty"`
570+ BPO1 * BlobConfig `json:"bpo1,omitempty"`
571+ BPO2 * BlobConfig `json:"bpo2,omitempty"`
572+ BPO3 * BlobConfig `json:"bpo3,omitempty"`
573+ BPO4 * BlobConfig `json:"bpo4,omitempty"`
574+ BPO5 * BlobConfig `json:"bpo5,omitempty"`
550575}
551576
552577// IsHomestead returns whether num is either equal to the homestead block or greater.
@@ -654,6 +679,31 @@ func (c *ChainConfig) IsVerkle(num *big.Int, time uint64) bool {
654679 return c .IsLondon (num ) && isTimestampForked (c .VerkleTime , time )
655680}
656681
682+ // IsBPO1 returns whether time is either equal to the BPO1 fork time or greater.
683+ func (c * ChainConfig ) IsBPO1 (num * big.Int , time uint64 ) bool {
684+ return c .IsLondon (num ) && isTimestampForked (c .BPO1Time , time )
685+ }
686+
687+ // IsBPO2 returns whether time is either equal to the BPO2 fork time or greater.
688+ func (c * ChainConfig ) IsBPO2 (num * big.Int , time uint64 ) bool {
689+ return c .IsLondon (num ) && isTimestampForked (c .BPO2Time , time )
690+ }
691+
692+ // IsBPO3 returns whether time is either equal to the BPO3 fork time or greater.
693+ func (c * ChainConfig ) IsBPO3 (num * big.Int , time uint64 ) bool {
694+ return c .IsLondon (num ) && isTimestampForked (c .BPO3Time , time )
695+ }
696+
697+ // IsBPO4 returns whether time is either equal to the BPO4 fork time or greater.
698+ func (c * ChainConfig ) IsBPO4 (num * big.Int , time uint64 ) bool {
699+ return c .IsLondon (num ) && isTimestampForked (c .BPO4Time , time )
700+ }
701+
702+ // IsBPO5 returns whether time is either equal to the BPO5 fork time or greater.
703+ func (c * ChainConfig ) IsBPO5 (num * big.Int , time uint64 ) bool {
704+ return c .IsLondon (num ) && isTimestampForked (c .BPO5Time , time )
705+ }
706+
657707// IsVerkleGenesis checks whether the verkle fork is activated at the genesis block.
658708//
659709// Verkle mode is considered enabled if the verkle fork time is configured,
@@ -729,6 +779,11 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
729779 {name : "pragueTime" , timestamp : c .PragueTime , optional : true },
730780 {name : "osakaTime" , timestamp : c .OsakaTime , optional : true },
731781 {name : "verkleTime" , timestamp : c .VerkleTime , optional : true },
782+ {name : "bpo1" , timestamp : c .BPO1Time , optional : true },
783+ {name : "bpo2" , timestamp : c .BPO2Time , optional : true },
784+ {name : "bpo3" , timestamp : c .BPO3Time , optional : true },
785+ {name : "bpo4" , timestamp : c .BPO4Time , optional : true },
786+ {name : "bpo5" , timestamp : c .BPO5Time , optional : true },
732787 } {
733788 if lastFork .name != "" {
734789 switch {
@@ -778,6 +833,11 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
778833 {name : "cancun" , timestamp : c .CancunTime , config : bsc .Cancun },
779834 {name : "prague" , timestamp : c .PragueTime , config : bsc .Prague },
780835 {name : "osaka" , timestamp : c .OsakaTime , config : bsc .Osaka },
836+ {name : "bpo1" , timestamp : c .BPO1Time , config : bsc .BPO1 },
837+ {name : "bpo2" , timestamp : c .BPO2Time , config : bsc .BPO2 },
838+ {name : "bpo3" , timestamp : c .BPO3Time , config : bsc .BPO3 },
839+ {name : "bpo4" , timestamp : c .BPO4Time , config : bsc .BPO4 },
840+ {name : "bpo5" , timestamp : c .BPO5Time , config : bsc .BPO5 },
781841 } {
782842 if cur .config != nil {
783843 if err := cur .config .validate (); err != nil {
@@ -878,6 +938,21 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int,
878938 if isForkTimestampIncompatible (c .VerkleTime , newcfg .VerkleTime , headTimestamp ) {
879939 return newTimestampCompatError ("Verkle fork timestamp" , c .VerkleTime , newcfg .VerkleTime )
880940 }
941+ if isForkTimestampIncompatible (c .BPO1Time , newcfg .BPO1Time , headTimestamp ) {
942+ return newTimestampCompatError ("BPO1 fork timestamp" , c .BPO1Time , newcfg .BPO1Time )
943+ }
944+ if isForkTimestampIncompatible (c .BPO2Time , newcfg .BPO2Time , headTimestamp ) {
945+ return newTimestampCompatError ("BPO2 fork timestamp" , c .BPO2Time , newcfg .BPO2Time )
946+ }
947+ if isForkTimestampIncompatible (c .BPO3Time , newcfg .BPO3Time , headTimestamp ) {
948+ return newTimestampCompatError ("BPO3 fork timestamp" , c .BPO3Time , newcfg .BPO3Time )
949+ }
950+ if isForkTimestampIncompatible (c .BPO4Time , newcfg .BPO4Time , headTimestamp ) {
951+ return newTimestampCompatError ("BPO4 fork timestamp" , c .BPO4Time , newcfg .BPO4Time )
952+ }
953+ if isForkTimestampIncompatible (c .BPO5Time , newcfg .BPO5Time , headTimestamp ) {
954+ return newTimestampCompatError ("BPO5 fork timestamp" , c .BPO5Time , newcfg .BPO5Time )
955+ }
881956 return nil
882957}
883958
0 commit comments