update interop genesis for fulu (#15948)

This commit is contained in:
Daniel Briskin
2025-11-08 06:49:03 +09:00
committed by GitHub
parent de0825f880
commit 619334115a
3 changed files with 26 additions and 0 deletions

View File

@@ -113,6 +113,21 @@ func GethPragueTime(genesisTime time.Time, cfg *clparams.BeaconChainConfig) *uin
return pragueTime
}
// GethOsakaTime calculates the absolute time of the osaka (aka fulu) fork block
// by adding the relative time of the capella the fork epoch to the given genesis timestamp.
func GethOsakaTime(genesisTime time.Time, cfg *clparams.BeaconChainConfig) *uint64 {
var osakaTime *uint64
if cfg.FuluForkEpoch != math.MaxUint64 {
startSlot, err := slots.EpochStart(cfg.FuluForkEpoch)
if err == nil {
startTime := slots.UnsafeStartTime(genesisTime, startSlot)
newTime := uint64(startTime.Unix())
osakaTime = &newTime
}
}
return osakaTime
}
// GethTestnetGenesis creates a genesis.json for eth1 clients with a set of defaults suitable for ephemeral testnets,
// like in an e2e test. The parameters are minimal but the full value is returned unmarshaled so that it can be
// customized as desired.
@@ -130,6 +145,10 @@ func GethTestnetGenesis(genesis time.Time, cfg *clparams.BeaconChainConfig) *cor
if cfg.ElectraForkEpoch == 0 {
pragueTime = &genesisTime
}
osakaTime := GethOsakaTime(genesis, cfg)
if cfg.FuluForkEpoch == 0 {
osakaTime = &genesisTime
}
cc := &params.ChainConfig{
ChainID: big.NewInt(defaultTestChainId),
HomesteadBlock: bigz,
@@ -151,6 +170,7 @@ func GethTestnetGenesis(genesis time.Time, cfg *clparams.BeaconChainConfig) *cor
ShanghaiTime: shanghaiTime,
CancunTime: cancunTime,
PragueTime: pragueTime,
OsakaTime: osakaTime,
DepositContractAddress: common.HexToAddress(cfg.DepositContractAddress),
BlobScheduleConfig: &params.BlobScheduleConfig{
Cancun: &params.BlobConfig{