mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-18 09:00:44 +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
|
||||
case forks.Cancun:
|
||||
frac = config.BlobScheduleConfig.Cancun.UpdateFraction
|
||||
case forks.Osaka:
|
||||
frac = config.BlobScheduleConfig.Osaka.UpdateFraction
|
||||
default:
|
||||
panic("calculating blob fee on unsupported fork")
|
||||
}
|
||||
|
|
@ -107,6 +109,8 @@ func MaxBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
|
|||
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,6 +133,8 @@ func LatestMaxBlobsPerBlock(cfg *params.ChainConfig) int {
|
|||
return s.Prague.Max
|
||||
case s.Cancun != nil:
|
||||
return s.Cancun.Max
|
||||
case s.Osaka != nil:
|
||||
return s.Osaka.Max
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
|
|
@ -148,6 +154,8 @@ func targetBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
|
|||
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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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