Skip to content

Commit 046e2cd

Browse files
authored
params: add bpo forks to eth_config (#32579)
BPO forks should also be included in eth_config response.
1 parent 1f7f95d commit 046e2cd

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

params/config.go

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,16 @@ func (c *ChainConfig) LatestFork(time uint64) forks.Fork {
972972
london := c.LondonBlock
973973

974974
switch {
975+
case c.IsBPO5(london, time):
976+
return forks.BPO5
977+
case c.IsBPO4(london, time):
978+
return forks.BPO4
979+
case c.IsBPO3(london, time):
980+
return forks.BPO3
981+
case c.IsBPO2(london, time):
982+
return forks.BPO2
983+
case c.IsBPO1(london, time):
984+
return forks.BPO1
975985
case c.IsOsaka(london, time):
976986
return forks.Osaka
977987
case c.IsPrague(london, time):
@@ -988,12 +998,22 @@ func (c *ChainConfig) LatestFork(time uint64) forks.Fork {
988998
// BlobConfig returns the blob config associated with the provided fork.
989999
func (c *ChainConfig) BlobConfig(fork forks.Fork) *BlobConfig {
9901000
switch fork {
1001+
case forks.BPO5:
1002+
return c.BlobScheduleConfig.BPO5
1003+
case forks.BPO4:
1004+
return c.BlobScheduleConfig.BPO4
1005+
case forks.BPO3:
1006+
return c.BlobScheduleConfig.BPO3
1007+
case forks.BPO2:
1008+
return c.BlobScheduleConfig.BPO2
1009+
case forks.BPO1:
1010+
return c.BlobScheduleConfig.BPO1
9911011
case forks.Osaka:
992-
return DefaultOsakaBlobConfig
1012+
return c.BlobScheduleConfig.Osaka
9931013
case forks.Prague:
994-
return DefaultPragueBlobConfig
1014+
return c.BlobScheduleConfig.Prague
9951015
case forks.Cancun:
996-
return DefaultCancunBlobConfig
1016+
return c.BlobScheduleConfig.Cancun
9971017
default:
9981018
return nil
9991019
}
@@ -1023,6 +1043,16 @@ func (c *ChainConfig) ActiveSystemContracts(time uint64) map[string]common.Addre
10231043
// the fork isn't defined or isn't a time-based fork.
10241044
func (c *ChainConfig) Timestamp(fork forks.Fork) *uint64 {
10251045
switch {
1046+
case fork == forks.BPO5:
1047+
return c.BPO5Time
1048+
case fork == forks.BPO4:
1049+
return c.BPO4Time
1050+
case fork == forks.BPO3:
1051+
return c.BPO3Time
1052+
case fork == forks.BPO2:
1053+
return c.BPO2Time
1054+
case fork == forks.BPO1:
1055+
return c.BPO1Time
10261056
case fork == forks.Osaka:
10271057
return c.OsakaTime
10281058
case fork == forks.Prague:

params/forks/forks.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ const (
4040
Cancun
4141
Prague
4242
Osaka
43+
BPO1
44+
BPO2
45+
BPO3
46+
BPO4
47+
BPO5
4348
)
4449

4550
// String implements fmt.Stringer.

0 commit comments

Comments
 (0)