diff --git a/runtime/interop/genesis.go b/runtime/interop/genesis.go index 6b165c86f08..d9bfb167bac 100644 --- a/runtime/interop/genesis.go +++ b/runtime/interop/genesis.go @@ -126,11 +126,18 @@ func GethPragueTime(genesisTime uint64, cfg *clparams.BeaconChainConfig) *uint64 // like in an e2e test. The parameters are minimal but the full value is returned unmarshaled so that it can be // customized as desired. func GethTestnetGenesis(genesisTime uint64, cfg *clparams.BeaconChainConfig) *core.Genesis { - //shanghaiTime := GethShanghaiTime(genesisTime, cfg) - // TODO: make these times dynamic... + shanghaiTime := GethShanghaiTime(genesisTime, cfg) + if cfg.CapellaForkEpoch == 0 { + shanghaiTime = &genesisTime + } cancunTime := GethCancunTime(genesisTime, cfg) - shanghaiTime := genesisTime + if cfg.DenebForkEpoch == 0 { + cancunTime = &genesisTime + } pragueTime := GethPragueTime(genesisTime, cfg) + if cfg.ElectraForkEpoch == 0 { + pragueTime = &genesisTime + } cc := ¶ms.ChainConfig{ ChainID: big.NewInt(defaultTestChainId), HomesteadBlock: bigz, @@ -150,7 +157,7 @@ func GethTestnetGenesis(genesisTime uint64, cfg *clparams.BeaconChainConfig) *co MergeNetsplitBlock: bigz, TerminalTotalDifficulty: bigz, TerminalTotalDifficultyPassed: true, - ShanghaiTime: &shanghaiTime, + ShanghaiTime: shanghaiTime, CancunTime: cancunTime, PragueTime: pragueTime, } diff --git a/testing/endtoend/endtoend_setup_test.go b/testing/endtoend/endtoend_setup_test.go index 7cd3984b950..81ef7c300a8 100644 --- a/testing/endtoend/endtoend_setup_test.go +++ b/testing/endtoend/endtoend_setup_test.go @@ -53,16 +53,25 @@ func e2eMinimal(t *testing.T, cfg *params.BeaconChainConfig, cfgo ...types.E2ECo ev.DepositedValidatorsAreActive, ev.ValidatorsVoteWithTheMajority, ev.ColdStateCheckpoint, - //ev.AltairForkTransition, TODO: Re-enable if able to start from older fork. - //ev.BellatrixForkTransition, - //ev.CapellaForkTransition, - ev.DenebForkTransition, ev.FinishedSyncing, ev.AllNodesHaveSameHead, ev.ValidatorSyncParticipation, ev.FeeRecipientIsPresent, //ev.TransactionsPresent, TODO: Re-enable Transaction evaluator once it tx pool issues are fixed. } + if cfg.AltairForkEpoch != 0 && cfg.AltairForkEpoch != params.BeaconConfig().FarFutureEpoch { + evals = append(evals, ev.AltairForkTransition) + } + if cfg.BellatrixForkEpoch != 0 && cfg.BellatrixForkEpoch != params.BeaconConfig().FarFutureEpoch { + evals = append(evals, ev.BellatrixForkTransition) + } + if cfg.CapellaForkEpoch != 0 && cfg.CapellaForkEpoch != params.BeaconConfig().FarFutureEpoch { + evals = append(evals, ev.CapellaForkTransition) + } + if cfg.DenebForkEpoch != 0 && cfg.DenebForkEpoch != params.BeaconConfig().FarFutureEpoch { + evals = append(evals, ev.DenebForkTransition) + } + testConfig := &types.E2EConfig{ BeaconFlags: []string{ fmt.Sprintf("--slots-per-archive-point=%d", params.BeaconConfig().SlotsPerEpoch*16), @@ -128,15 +137,23 @@ func e2eMainnet(t *testing.T, usePrysmSh, useMultiClient bool, cfg *params.Beaco ev.ValidatorsHaveWithdrawn, ev.DepositedValidatorsAreActive, ev.ColdStateCheckpoint, - //ev.AltairForkTransition, TODO: Re-enable if able to start from older fork. - //ev.BellatrixForkTransition, - //ev.CapellaForkTransition, - ev.DenebForkTransition, ev.FinishedSyncing, ev.AllNodesHaveSameHead, ev.FeeRecipientIsPresent, //ev.TransactionsPresent, TODO: Re-enable Transaction evaluator once it tx pool issues are fixed. } + if cfg.AltairForkEpoch != 0 && cfg.AltairForkEpoch != params.BeaconConfig().FarFutureEpoch { + evals = append(evals, ev.AltairForkTransition) + } + if cfg.BellatrixForkEpoch != 0 && cfg.BellatrixForkEpoch != params.BeaconConfig().FarFutureEpoch { + evals = append(evals, ev.BellatrixForkTransition) + } + if cfg.CapellaForkEpoch != 0 && cfg.CapellaForkEpoch != params.BeaconConfig().FarFutureEpoch { + evals = append(evals, ev.CapellaForkTransition) + } + if cfg.DenebForkEpoch != 0 && cfg.DenebForkEpoch != params.BeaconConfig().FarFutureEpoch { + evals = append(evals, ev.DenebForkTransition) + } testConfig := &types.E2EConfig{ BeaconFlags: []string{ fmt.Sprintf("--slots-per-archive-point=%d", params.BeaconConfig().SlotsPerEpoch*16),