Skip to content

Commit

Permalink
making configs dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
james-prysm committed Nov 5, 2024
1 parent 608eb1a commit 2939be1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 12 deletions.
15 changes: 11 additions & 4 deletions runtime/interop/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 := &params.ChainConfig{
ChainID: big.NewInt(defaultTestChainId),
HomesteadBlock: bigz,
Expand All @@ -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,
}
Expand Down
33 changes: 25 additions & 8 deletions testing/endtoend/endtoend_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 2939be1

Please sign in to comment.