mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +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 {
|
func CalcBlobFee(config *params.ChainConfig, header *types.Header) *big.Int {
|
||||||
var frac uint64
|
var frac uint64
|
||||||
switch config.LatestFork(header.Time) {
|
switch config.LatestFork(header.Time) {
|
||||||
|
case forks.Osaka:
|
||||||
|
frac = config.BlobScheduleConfig.Osaka.UpdateFraction
|
||||||
case forks.Prague:
|
case forks.Prague:
|
||||||
frac = config.BlobScheduleConfig.Prague.UpdateFraction
|
frac = config.BlobScheduleConfig.Prague.UpdateFraction
|
||||||
case forks.Cancun:
|
case forks.Cancun:
|
||||||
frac = config.BlobScheduleConfig.Cancun.UpdateFraction
|
frac = config.BlobScheduleConfig.Cancun.UpdateFraction
|
||||||
case forks.Osaka:
|
|
||||||
frac = config.BlobScheduleConfig.Osaka.UpdateFraction
|
|
||||||
default:
|
default:
|
||||||
panic("calculating blob fee on unsupported fork")
|
panic("calculating blob fee on unsupported fork")
|
||||||
}
|
}
|
||||||
|
|
@ -105,12 +105,12 @@ func MaxBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
|
||||||
s = cfg.BlobScheduleConfig
|
s = cfg.BlobScheduleConfig
|
||||||
)
|
)
|
||||||
switch {
|
switch {
|
||||||
|
case cfg.IsOsaka(london, time) && s.Osaka != nil:
|
||||||
|
return s.Osaka.Max
|
||||||
case cfg.IsPrague(london, time) && s.Prague != nil:
|
case cfg.IsPrague(london, time) && s.Prague != nil:
|
||||||
return s.Prague.Max
|
return s.Prague.Max
|
||||||
case cfg.IsCancun(london, time) && s.Cancun != nil:
|
case cfg.IsCancun(london, time) && s.Cancun != nil:
|
||||||
return s.Cancun.Max
|
return s.Cancun.Max
|
||||||
case cfg.IsOsaka(london, time) && s.Osaka != nil:
|
|
||||||
return s.Osaka.Max
|
|
||||||
default:
|
default:
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
@ -129,12 +129,12 @@ func LatestMaxBlobsPerBlock(cfg *params.ChainConfig) int {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
switch {
|
switch {
|
||||||
|
case s.Osaka != nil:
|
||||||
|
return s.Osaka.Max
|
||||||
case s.Prague != nil:
|
case s.Prague != nil:
|
||||||
return s.Prague.Max
|
return s.Prague.Max
|
||||||
case s.Cancun != nil:
|
case s.Cancun != nil:
|
||||||
return s.Cancun.Max
|
return s.Cancun.Max
|
||||||
case s.Osaka != nil:
|
|
||||||
return s.Osaka.Max
|
|
||||||
default:
|
default:
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
@ -150,12 +150,12 @@ func targetBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
|
||||||
s = cfg.BlobScheduleConfig
|
s = cfg.BlobScheduleConfig
|
||||||
)
|
)
|
||||||
switch {
|
switch {
|
||||||
|
case cfg.IsOsaka(london, time) && s.Osaka != nil:
|
||||||
|
return s.Osaka.Target
|
||||||
case cfg.IsPrague(london, time) && s.Prague != nil:
|
case cfg.IsPrague(london, time) && s.Prague != nil:
|
||||||
return s.Prague.Target
|
return s.Prague.Target
|
||||||
case cfg.IsCancun(london, time) && s.Cancun != nil:
|
case cfg.IsCancun(london, time) && s.Cancun != nil:
|
||||||
return s.Cancun.Target
|
return s.Cancun.Target
|
||||||
case cfg.IsOsaka(london, time) && s.Osaka != nil:
|
|
||||||
return s.Osaka.Target
|
|
||||||
default:
|
default:
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue