Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ var (
utils.OverrideLorentz,
utils.OverrideMaxwell,
utils.OverrideFermi,
utils.OverrideOsaka,
utils.OverrideVerkle,
utils.MultiDataBaseFlag,
}, utils.DatabaseFlags),
Expand Down Expand Up @@ -344,6 +345,10 @@ func initGenesis(ctx *cli.Context) error {
v := ctx.Uint64(utils.OverrideFermi.Name)
overrides.OverrideFermi = &v
}
if ctx.IsSet(utils.OverrideOsaka.Name) {
v := ctx.Uint64(utils.OverrideOsaka.Name)
overrides.OverrideOsaka = &v
}
if ctx.IsSet(utils.OverrideVerkle.Name) {
v := ctx.Uint64(utils.OverrideVerkle.Name)
overrides.OverrideVerkle = &v
Expand Down
4 changes: 4 additions & 0 deletions cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
v := ctx.Uint64(utils.OverrideFermi.Name)
cfg.Eth.OverrideFermi = &v
}
if ctx.IsSet(utils.OverrideOsaka.Name) {
v := ctx.Uint64(utils.OverrideOsaka.Name)
cfg.Eth.OverrideOsaka = &v
}
if ctx.IsSet(utils.OverrideVerkle.Name) {
v := ctx.Uint64(utils.OverrideVerkle.Name)
cfg.Eth.OverrideVerkle = &v
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ var (
utils.OverrideLorentz,
utils.OverrideMaxwell,
utils.OverrideFermi,
utils.OverrideOsaka,
utils.OverrideVerkle,
utils.OverrideFullImmutabilityThreshold,
utils.OverrideMinBlocksForBlobRequests,
Expand Down
5 changes: 5 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ var (
Usage: "Manually specify the Fermi fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverrideOsaka = &cli.Uint64Flag{
Name: "override.osaka",
Usage: "Manually specify the Osaka fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverrideVerkle = &cli.Uint64Flag{
Name: "override.verkle",
Usage: "Manually specify the Verkle fork timestamp, overriding the bundled setting",
Expand Down
4 changes: 4 additions & 0 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ type ChainOverrides struct {
OverrideLorentz *uint64
OverrideMaxwell *uint64
OverrideFermi *uint64
OverrideOsaka *uint64
OverrideVerkle *uint64
}

Expand Down Expand Up @@ -300,6 +301,9 @@ func (o *ChainOverrides) apply(cfg *params.ChainConfig) error {
if o.OverrideFermi != nil {
cfg.FermiTime = o.OverrideFermi
}
if o.OverrideOsaka != nil {
cfg.OsakaTime = o.OverrideOsaka
}
if o.OverrideVerkle != nil {
cfg.VerkleTime = o.OverrideVerkle
}
Expand Down
4 changes: 4 additions & 0 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
chainConfig.FermiTime = config.OverrideFermi
overrides.OverrideFermi = config.OverrideFermi
}
if config.OverrideOsaka != nil {
chainConfig.OsakaTime = config.OverrideOsaka
overrides.OverrideOsaka = config.OverrideOsaka
}
if config.OverrideVerkle != nil {
chainConfig.VerkleTime = config.OverrideVerkle
overrides.OverrideVerkle = config.OverrideVerkle
Expand Down
4 changes: 2 additions & 2 deletions eth/ethconfig/gen_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 28 additions & 6 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,13 @@ var (
LorentzTime: newUint64(1745903100), // 2025-04-29 05:05:00 AM UTC
MaxwellTime: newUint64(1751250600), // 2025-06-30 02:30:00 AM UTC
FermiTime: nil,
OsakaTime: nil,

Parlia: &ParliaConfig{},
BlobScheduleConfig: &BlobScheduleConfig{
Cancun: DefaultCancunBlobConfig,
Prague: DefaultPragueBlobConfigBSC,
Osaka: DefaultOsakaBlobConfigBSC,
},
}

Expand Down Expand Up @@ -273,11 +275,13 @@ var (
LorentzTime: newUint64(1744097580), // 2025-04-08 07:33:00 AM UTC
MaxwellTime: newUint64(1748243100), // 2025-05-26 07:05:00 AM UTC
FermiTime: newUint64(1762741500), // 2025-11-10 02:25:00 AM UTC
OsakaTime: nil,

Parlia: &ParliaConfig{},
BlobScheduleConfig: &BlobScheduleConfig{
Cancun: DefaultCancunBlobConfig,
Prague: DefaultPragueBlobConfigBSC,
Osaka: DefaultOsakaBlobConfigBSC,
},
}

Expand Down Expand Up @@ -322,11 +326,13 @@ var (
MaxwellTime: newUint64(0),
// TODO: set them to `0` when passed on the mainnet
FermiTime: nil,
OsakaTime: nil,

Parlia: &ParliaConfig{},
BlobScheduleConfig: &BlobScheduleConfig{
Cancun: DefaultCancunBlobConfig,
Prague: DefaultPragueBlobConfigBSC,
Osaka: DefaultOsakaBlobConfigBSC,
},
}

Expand Down Expand Up @@ -592,6 +598,7 @@ var (
}

DefaultPragueBlobConfigBSC = DefaultCancunBlobConfig
DefaultOsakaBlobConfigBSC = DefaultCancunBlobConfig
)

// NetworkNames are user friendly names to use in the chain spec banner.
Expand Down Expand Up @@ -645,10 +652,10 @@ type ChainConfig struct {
BohrTime *uint64 `json:"bohrTime,omitempty"` // Bohr switch time (nil = no fork, 0 = already on bohr)
PascalTime *uint64 `json:"pascalTime,omitempty"` // Pascal switch time (nil = no fork, 0 = already on pascal)
PragueTime *uint64 `json:"pragueTime,omitempty"` // Prague switch time (nil = no fork, 0 = already on prague)
OsakaTime *uint64 `json:"osakaTime,omitempty"` // Osaka switch time (nil = no fork, 0 = already on osaka)
LorentzTime *uint64 `json:"lorentzTime,omitempty"` // Lorentz switch time (nil = no fork, 0 = already on lorentz)
MaxwellTime *uint64 `json:"maxwellTime,omitempty"` // Maxwell switch time (nil = no fork, 0 = already on maxwell)
FermiTime *uint64 `json:"fermiTime,omitempty"` // Fermi switch time (nil = no fork, 0 = already on fermi)
OsakaTime *uint64 `json:"osakaTime,omitempty"` // Osaka switch time (nil = no fork, 0 = already on osaka)
VerkleTime *uint64 `json:"verkleTime,omitempty"` // Verkle switch time (nil = no fork, 0 = already on verkle)

// TerminalTotalDifficulty is the amount of total difficulty reached by
Expand Down Expand Up @@ -825,9 +832,14 @@ func (c *ChainConfig) String() string {
FermiTime = big.NewInt(0).SetUint64(*c.FermiTime)
}

var OsakaTime *big.Int
if c.OsakaTime != nil {
OsakaTime = big.NewInt(0).SetUint64(*c.OsakaTime)
}

return fmt.Sprintf("{ChainID: %v, Engine: %v, Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, "+
"MirrorSync: %v, Bruno: %v, Berlin: %v, YOLO v3: %v, CatalystBlock: %v, London: %v, ArrowGlacier: %v, MergeFork:%v, Euler: %v, Gibbs: %v, Nano: %v, Moran: %v, Planck: %v,Luban: %v, Plato: %v, Hertz: %v, Hertzfix: %v, "+
"ShanghaiTime: %v, KeplerTime: %v, FeynmanTime: %v, FeynmanFixTime: %v, CancunTime: %v, HaberTime: %v, HaberFixTime: %v, BohrTime: %v, PascalTime: %v, PragueTime: %v, LorentzTime: %v, MaxwellTime: %v, FermiTime: %v}",
"ShanghaiTime: %v, KeplerTime: %v, FeynmanTime: %v, FeynmanFixTime: %v, CancunTime: %v, HaberTime: %v, HaberFixTime: %v, BohrTime: %v, PascalTime: %v, PragueTime: %v, LorentzTime: %v, MaxwellTime: %v, FermiTime: %v, OsakaTime: %v}",
c.ChainID,
engine,
c.HomesteadBlock,
Expand Down Expand Up @@ -873,6 +885,7 @@ func (c *ChainConfig) String() string {
LorentzTime,
MaxwellTime,
FermiTime,
OsakaTime,
)
}

Expand Down Expand Up @@ -1278,6 +1291,15 @@ func (c *ChainConfig) IsOsaka(num *big.Int, time uint64) bool {
return c.IsLondon(num) && isTimestampForked(c.OsakaTime, time)
}

// IsOnOsaka eturns whether currentBlockTime is either equal to the Osaka fork time or greater firstly.
func (c *ChainConfig) IsOnOsaka(currentBlockNumber *big.Int, lastBlockTime uint64, currentBlockTime uint64) bool {
lastBlockNumber := new(big.Int)
if currentBlockNumber.Cmp(big.NewInt(1)) >= 0 {
lastBlockNumber.Sub(currentBlockNumber, big.NewInt(1))
}
return !c.IsOsaka(lastBlockNumber, lastBlockTime) && c.IsOsaka(currentBlockNumber, currentBlockTime)
}

// IsVerkle returns whether time is either equal to the Verkle fork time or greater.
func (c *ChainConfig) IsVerkle(num *big.Int, time uint64) bool {
return c.IsLondon(num) && isTimestampForked(c.VerkleTime, time)
Expand Down Expand Up @@ -1360,10 +1382,10 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
{name: "bohrTime", timestamp: c.BohrTime},
{name: "pascalTime", timestamp: c.PascalTime},
{name: "pragueTime", timestamp: c.PragueTime},
{name: "osakaTime", timestamp: c.OsakaTime, optional: true},
{name: "lorentzTime", timestamp: c.LorentzTime},
{name: "maxwellTime", timestamp: c.MaxwellTime},
{name: "fermiTime", timestamp: c.FermiTime},
{name: "osakaTime", timestamp: c.OsakaTime},
{name: "verkleTime", timestamp: c.VerkleTime, optional: true},
} {
if lastFork.name != "" {
Expand Down Expand Up @@ -1565,9 +1587,6 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int,
if isForkTimestampIncompatible(c.PragueTime, newcfg.PragueTime, headTimestamp) {
return newTimestampCompatError("Prague fork timestamp", c.PragueTime, newcfg.PragueTime)
}
if isForkTimestampIncompatible(c.OsakaTime, newcfg.OsakaTime, headTimestamp) {
return newTimestampCompatError("Osaka fork timestamp", c.OsakaTime, newcfg.OsakaTime)
}
if isForkTimestampIncompatible(c.LorentzTime, newcfg.LorentzTime, headTimestamp) {
return newTimestampCompatError("Lorentz fork timestamp", c.LorentzTime, newcfg.LorentzTime)
}
Expand All @@ -1577,6 +1596,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int,
if isForkTimestampIncompatible(c.FermiTime, newcfg.FermiTime, headTimestamp) {
return newTimestampCompatError("FermiTime fork timestamp", c.FermiTime, newcfg.FermiTime)
}
if isForkTimestampIncompatible(c.OsakaTime, newcfg.OsakaTime, headTimestamp) {
return newTimestampCompatError("Osaka fork timestamp", c.OsakaTime, newcfg.OsakaTime)
}
if isForkTimestampIncompatible(c.VerkleTime, newcfg.VerkleTime, headTimestamp) {
return newTimestampCompatError("Verkle fork timestamp", c.VerkleTime, newcfg.VerkleTime)
}
Expand Down