mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 07:37:20 +00:00
params: add osaka blob schedule (#31174)
Prevents crashes when running execution spec tests for osaka
This commit is contained in:
parent
32c6aa8a1a
commit
ef00a6e9a2
4 changed files with 28 additions and 0 deletions
|
|
@ -83,6 +83,8 @@ 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:
|
||||
|
|
@ -103,6 +105,8 @@ 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:
|
||||
|
|
@ -125,6 +129,8 @@ 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:
|
||||
|
|
@ -144,6 +150,8 @@ 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:
|
||||
|
|
|
|||
|
|
@ -281,6 +281,7 @@ func TestVerkleGenesisCommit(t *testing.T) {
|
|||
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
||||
Cancun: params.DefaultCancunBlobConfig,
|
||||
Prague: params.DefaultPragueBlobConfig,
|
||||
Osaka: params.DefaultOsakaBlobConfig,
|
||||
Verkle: params.DefaultPragueBlobConfig,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -317,10 +317,17 @@ var (
|
|||
Max: 9,
|
||||
UpdateFraction: 5007716,
|
||||
}
|
||||
// DefaultOsakaBlobConfig is the default blob configuration for the Osaka fork.
|
||||
DefaultOsakaBlobConfig = &BlobConfig{
|
||||
Target: 6,
|
||||
Max: 9,
|
||||
UpdateFraction: 5007716,
|
||||
}
|
||||
// DefaultBlobSchedule is the latest configured blob schedule for test chains.
|
||||
DefaultBlobSchedule = &BlobScheduleConfig{
|
||||
Cancun: DefaultCancunBlobConfig,
|
||||
Prague: DefaultPragueBlobConfig,
|
||||
Osaka: DefaultOsakaBlobConfig,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -501,6 +508,7 @@ type BlobConfig struct {
|
|||
type BlobScheduleConfig struct {
|
||||
Cancun *BlobConfig `json:"cancun,omitempty"`
|
||||
Prague *BlobConfig `json:"prague,omitempty"`
|
||||
Osaka *BlobConfig `json:"osaka,omitempty"`
|
||||
Verkle *BlobConfig `json:"verkle,omitempty"`
|
||||
}
|
||||
|
||||
|
|
@ -732,6 +740,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
|
|||
}{
|
||||
{name: "cancun", timestamp: c.CancunTime, config: bsc.Cancun},
|
||||
{name: "prague", timestamp: c.PragueTime, config: bsc.Prague},
|
||||
{name: "osaka", timestamp: c.OsakaTime, config: bsc.Osaka},
|
||||
} {
|
||||
if cur.config != nil {
|
||||
if err := cur.config.validate(); err != nil {
|
||||
|
|
|
|||
|
|
@ -431,6 +431,11 @@ var Forks = map[string]*params.ChainConfig{
|
|||
PragueTime: u64(0),
|
||||
OsakaTime: u64(0),
|
||||
DepositContractAddress: params.MainnetChainConfig.DepositContractAddress,
|
||||
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
||||
Cancun: params.DefaultCancunBlobConfig,
|
||||
Prague: params.DefaultPragueBlobConfig,
|
||||
Osaka: params.DefaultOsakaBlobConfig,
|
||||
},
|
||||
},
|
||||
"PragueToOsakaAtTime15k": {
|
||||
ChainID: big.NewInt(1),
|
||||
|
|
@ -453,6 +458,11 @@ var Forks = map[string]*params.ChainConfig{
|
|||
PragueTime: u64(0),
|
||||
OsakaTime: u64(15_000),
|
||||
DepositContractAddress: params.MainnetChainConfig.DepositContractAddress,
|
||||
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
||||
Cancun: params.DefaultCancunBlobConfig,
|
||||
Prague: params.DefaultPragueBlobConfig,
|
||||
Osaka: params.DefaultOsakaBlobConfig,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue