mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-22 15:59:26 +00:00
Merge branch 'osaka-blobschedule' into eof-opcodes
This commit is contained in:
commit
0e4c4c21af
3 changed files with 27 additions and 0 deletions
|
|
@ -87,6 +87,8 @@ func CalcBlobFee(config *params.ChainConfig, header *types.Header) *big.Int {
|
||||||
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")
|
||||||
}
|
}
|
||||||
|
|
@ -107,6 +109,8 @@ func MaxBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
|
||||||
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,6 +133,8 @@ func LatestMaxBlobsPerBlock(cfg *params.ChainConfig) int {
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
@ -148,6 +154,8 @@ func targetBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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