mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
consensus/misc: sort forks chronologically
This commit is contained in:
parent
14fbce0d31
commit
34ce6f6785
1 changed files with 8 additions and 8 deletions
|
|
@ -83,12 +83,12 @@ func CalcExcessBlobGas(config *params.ChainConfig, parent *types.Header, headTim
|
|||
func CalcBlobFee(config *params.ChainConfig, header *types.Header) *big.Int {
|
||||
var frac uint64
|
||||
switch config.LatestFork(header.Time) {
|
||||
case forks.Osaka:
|
||||
frac = config.BlobScheduleConfig.Osaka.UpdateFraction
|
||||
case forks.Prague:
|
||||
frac = config.BlobScheduleConfig.Prague.UpdateFraction
|
||||
case forks.Cancun:
|
||||
frac = config.BlobScheduleConfig.Cancun.UpdateFraction
|
||||
case forks.Osaka:
|
||||
frac = config.BlobScheduleConfig.Osaka.UpdateFraction
|
||||
default:
|
||||
panic("calculating blob fee on unsupported fork")
|
||||
}
|
||||
|
|
@ -105,12 +105,12 @@ func MaxBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
|
|||
s = cfg.BlobScheduleConfig
|
||||
)
|
||||
switch {
|
||||
case cfg.IsOsaka(london, time) && s.Osaka != nil:
|
||||
return s.Osaka.Max
|
||||
case cfg.IsPrague(london, time) && s.Prague != nil:
|
||||
return s.Prague.Max
|
||||
case cfg.IsCancun(london, time) && s.Cancun != nil:
|
||||
return s.Cancun.Max
|
||||
case cfg.IsOsaka(london, time) && s.Osaka != nil:
|
||||
return s.Osaka.Max
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
|
|
@ -129,12 +129,12 @@ func LatestMaxBlobsPerBlock(cfg *params.ChainConfig) int {
|
|||
return 0
|
||||
}
|
||||
switch {
|
||||
case s.Osaka != nil:
|
||||
return s.Osaka.Max
|
||||
case s.Prague != nil:
|
||||
return s.Prague.Max
|
||||
case s.Cancun != nil:
|
||||
return s.Cancun.Max
|
||||
case s.Osaka != nil:
|
||||
return s.Osaka.Max
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
|
|
@ -150,12 +150,12 @@ func targetBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
|
|||
s = cfg.BlobScheduleConfig
|
||||
)
|
||||
switch {
|
||||
case cfg.IsOsaka(london, time) && s.Osaka != nil:
|
||||
return s.Osaka.Target
|
||||
case cfg.IsPrague(london, time) && s.Prague != nil:
|
||||
return s.Prague.Target
|
||||
case cfg.IsCancun(london, time) && s.Cancun != nil:
|
||||
return s.Cancun.Target
|
||||
case cfg.IsOsaka(london, time) && s.Osaka != nil:
|
||||
return s.Osaka.Target
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue