forked from forks/go-ethereum
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 {
|
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:
|
||||||
|
|
@ -103,6 +105,8 @@ 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:
|
||||||
|
|
@ -125,6 +129,8 @@ 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:
|
||||||
|
|
@ -144,6 +150,8 @@ 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:
|
||||||
|
|
|
||||||
|
|
@ -281,6 +281,7 @@ func TestVerkleGenesisCommit(t *testing.T) {
|
||||||
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
||||||
Cancun: params.DefaultCancunBlobConfig,
|
Cancun: params.DefaultCancunBlobConfig,
|
||||||
Prague: params.DefaultPragueBlobConfig,
|
Prague: params.DefaultPragueBlobConfig,
|
||||||
|
Osaka: params.DefaultOsakaBlobConfig,
|
||||||
Verkle: params.DefaultPragueBlobConfig,
|
Verkle: params.DefaultPragueBlobConfig,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -317,10 +317,17 @@ var (
|
||||||
Max: 9,
|
Max: 9,
|
||||||
UpdateFraction: 5007716,
|
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 is the latest configured blob schedule for test chains.
|
||||||
DefaultBlobSchedule = &BlobScheduleConfig{
|
DefaultBlobSchedule = &BlobScheduleConfig{
|
||||||
Cancun: DefaultCancunBlobConfig,
|
Cancun: DefaultCancunBlobConfig,
|
||||||
Prague: DefaultPragueBlobConfig,
|
Prague: DefaultPragueBlobConfig,
|
||||||
|
Osaka: DefaultOsakaBlobConfig,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -501,6 +508,7 @@ type BlobConfig struct {
|
||||||
type BlobScheduleConfig struct {
|
type BlobScheduleConfig struct {
|
||||||
Cancun *BlobConfig `json:"cancun,omitempty"`
|
Cancun *BlobConfig `json:"cancun,omitempty"`
|
||||||
Prague *BlobConfig `json:"prague,omitempty"`
|
Prague *BlobConfig `json:"prague,omitempty"`
|
||||||
|
Osaka *BlobConfig `json:"osaka,omitempty"`
|
||||||
Verkle *BlobConfig `json:"verkle,omitempty"`
|
Verkle *BlobConfig `json:"verkle,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -732,6 +740,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
|
||||||
}{
|
}{
|
||||||
{name: "cancun", timestamp: c.CancunTime, config: bsc.Cancun},
|
{name: "cancun", timestamp: c.CancunTime, config: bsc.Cancun},
|
||||||
{name: "prague", timestamp: c.PragueTime, config: bsc.Prague},
|
{name: "prague", timestamp: c.PragueTime, config: bsc.Prague},
|
||||||
|
{name: "osaka", timestamp: c.OsakaTime, config: bsc.Osaka},
|
||||||
} {
|
} {
|
||||||
if cur.config != nil {
|
if cur.config != nil {
|
||||||
if err := cur.config.validate(); err != nil {
|
if err := cur.config.validate(); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -431,6 +431,11 @@ var Forks = map[string]*params.ChainConfig{
|
||||||
PragueTime: u64(0),
|
PragueTime: u64(0),
|
||||||
OsakaTime: u64(0),
|
OsakaTime: u64(0),
|
||||||
DepositContractAddress: params.MainnetChainConfig.DepositContractAddress,
|
DepositContractAddress: params.MainnetChainConfig.DepositContractAddress,
|
||||||
|
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
||||||
|
Cancun: params.DefaultCancunBlobConfig,
|
||||||
|
Prague: params.DefaultPragueBlobConfig,
|
||||||
|
Osaka: params.DefaultOsakaBlobConfig,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"PragueToOsakaAtTime15k": {
|
"PragueToOsakaAtTime15k": {
|
||||||
ChainID: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
|
|
@ -453,6 +458,11 @@ var Forks = map[string]*params.ChainConfig{
|
||||||
PragueTime: u64(0),
|
PragueTime: u64(0),
|
||||||
OsakaTime: u64(15_000),
|
OsakaTime: u64(15_000),
|
||||||
DepositContractAddress: params.MainnetChainConfig.DepositContractAddress,
|
DepositContractAddress: params.MainnetChainConfig.DepositContractAddress,
|
||||||
|
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
||||||
|
Cancun: params.DefaultCancunBlobConfig,
|
||||||
|
Prague: params.DefaultPragueBlobConfig,
|
||||||
|
Osaka: params.DefaultOsakaBlobConfig,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue