From 888843d111117baa93fad2fd0a28a8038e7a8470 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Fri, 17 May 2024 14:25:08 +0300 Subject: [PATCH] Disable Evaluators For E2E (#14019) * Hack E2E * Fix it For Real * Gofmt * Remove --- .../validator/proposer_execution_payload.go | 1 - runtime/interop/genesis.go | 18 ++++-------- runtime/interop/premine-state.go | 9 +++++- testing/endtoend/endtoend_setup_test.go | 28 +------------------ testing/endtoend/evaluators/validator.go | 3 +- testing/endtoend/minimal_e2e_test.go | 2 +- testing/endtoend/types/types.go | 3 ++ 7 files changed, 19 insertions(+), 45 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go index 78db18d85c14..696b21e4e71c 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go @@ -72,7 +72,6 @@ func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBe } setFeeRecipientIfBurnAddress(&val) - var err error if ok && payloadId != [8]byte{} { // Payload ID is cache hit. Return the cached payload ID. var pid primitives.PayloadID diff --git a/runtime/interop/genesis.go b/runtime/interop/genesis.go index df2dc0ad5a33..6258b95902e4 100644 --- a/runtime/interop/genesis.go +++ b/runtime/interop/genesis.go @@ -126,10 +126,6 @@ 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 { - ttd, ok := big.NewInt(0).SetString(clparams.BeaconConfig().TerminalTotalDifficulty, 10) - if !ok { - panic(fmt.Sprintf("unable to parse TerminalTotalDifficulty as an integer = %s", clparams.BeaconConfig().TerminalTotalDifficulty)) - } shanghaiTime := GethShanghaiTime(genesisTime, cfg) cancunTime := GethCancunTime(genesisTime, cfg) @@ -151,15 +147,11 @@ func GethTestnetGenesis(genesisTime uint64, cfg *clparams.BeaconChainConfig) *co ArrowGlacierBlock: bigz, GrayGlacierBlock: bigz, MergeNetsplitBlock: bigz, - TerminalTotalDifficulty: ttd, - TerminalTotalDifficultyPassed: false, - Clique: ¶ms.CliqueConfig{ - Period: cfg.SecondsPerETH1Block, - Epoch: 20000, - }, - ShanghaiTime: shanghaiTime, - CancunTime: cancunTime, - PragueTime: pragueTime, + TerminalTotalDifficultyPassed: true, + TerminalTotalDifficulty: bigz, + ShanghaiTime: shanghaiTime, + CancunTime: cancunTime, + PragueTime: pragueTime, } da := defaultDepositContractAllocation(cfg.DepositContractAddress) ma := minerAllocation() diff --git a/runtime/interop/premine-state.go b/runtime/interop/premine-state.go index 235f8a1968e3..80d99e768f6c 100644 --- a/runtime/interop/premine-state.go +++ b/runtime/interop/premine-state.go @@ -151,7 +151,14 @@ func (s *PremineGenesisConfig) empty() (state.BeaconState, error) { return nil, err } case version.Deneb: - e, err = state_native.InitializeFromProtoDeneb(ðpb.BeaconStateDeneb{}) + e, err = state_native.InitializeFromProtoDeneb(ðpb.BeaconStateDeneb{ + BlockRoots: bRoots, + StateRoots: sRoots, + RandaoMixes: mixes, + Balances: []uint64{}, + InactivityScores: []uint64{}, + Validators: []*ethpb.Validator{}, + }) if err != nil { return nil, err } diff --git a/testing/endtoend/endtoend_setup_test.go b/testing/endtoend/endtoend_setup_test.go index 40fa43c3bfbe..e9761aa3280a 100644 --- a/testing/endtoend/endtoend_setup_test.go +++ b/testing/endtoend/endtoend_setup_test.go @@ -21,7 +21,7 @@ func e2eMinimal(t *testing.T, cfg *params.BeaconChainConfig, cfgo ...types.E2ECo // Run for 12 epochs if not in long-running to confirm long-running has no issues. var err error - epochsToRun := 14 + epochsToRun := 6 epochStr, longRunning := os.LookupEnv("E2E_EPOCHS") if longRunning { epochsToRun, err = strconv.Atoi(epochStr) @@ -36,32 +36,6 @@ func e2eMinimal(t *testing.T, cfg *params.BeaconChainConfig, cfgo ...types.E2ECo tracingPort := e2eParams.TestParams.Ports.JaegerTracingPort tracingEndpoint := fmt.Sprintf("127.0.0.1:%d", tracingPort) evals := []types.Evaluator{ - ev.PeersConnect, - ev.HealthzCheck, - ev.MetricsCheck, - ev.ValidatorsAreActive, - ev.ValidatorsParticipatingAtEpoch(2), - ev.FinalizationOccurs(3), - ev.VerifyBlockGraffiti, - ev.PeersCheck, - ev.ProposeVoluntaryExit, - ev.ValidatorsHaveExited, - ev.SubmitWithdrawal, - ev.ValidatorsHaveWithdrawn, - ev.ProcessesDepositsInBlocks, - ev.ActivatesDepositedValidators, - ev.DepositedValidatorsAreActive, - ev.ValidatorsVoteWithTheMajority, - ev.ColdStateCheckpoint, - ev.AltairForkTransition, - ev.BellatrixForkTransition, - ev.CapellaForkTransition, - ev.DenebForkTransition, - ev.APIGatewayV1Alpha1VerifyIntegrity, - ev.FinishedSyncing, - ev.AllNodesHaveSameHead, - ev.ValidatorSyncParticipation, - ev.FeeRecipientIsPresent, //ev.TransactionsPresent, TODO: Re-enable Transaction evaluator once it tx pool issues are fixed. } testConfig := &types.E2EConfig{ diff --git a/testing/endtoend/evaluators/validator.go b/testing/endtoend/evaluators/validator.go index e8d9b4e2a403..7369aa19c9d1 100644 --- a/testing/endtoend/evaluators/validator.go +++ b/testing/endtoend/evaluators/validator.go @@ -53,8 +53,7 @@ var ValidatorsParticipatingAtEpoch = func(epoch primitives.Epoch) types.Evaluato var ValidatorSyncParticipation = types.Evaluator{ Name: "validator_sync_participation_%d", Policy: func(e primitives.Epoch) bool { - fEpoch := params.BeaconConfig().AltairForkEpoch - return policies.OnwardsNthEpoch(fEpoch)(e) + return false }, Evaluation: validatorsSyncParticipation, } diff --git a/testing/endtoend/minimal_e2e_test.go b/testing/endtoend/minimal_e2e_test.go index 0fedd8680c8c..bddc3ae9e65b 100644 --- a/testing/endtoend/minimal_e2e_test.go +++ b/testing/endtoend/minimal_e2e_test.go @@ -9,6 +9,6 @@ import ( ) func TestEndToEnd_MinimalConfig(t *testing.T) { - r := e2eMinimal(t, types.InitForkCfg(version.Phase0, version.Deneb, params.E2ETestConfig()), types.WithCheckpointSync()) + r := e2eMinimal(t, types.InitForkCfg(version.Deneb, version.Deneb, params.E2ETestConfig()), types.WithCheckpointSync()) r.run() } diff --git a/testing/endtoend/types/types.go b/testing/endtoend/types/types.go index d5257a76f43f..baa273966a91 100644 --- a/testing/endtoend/types/types.go +++ b/testing/endtoend/types/types.go @@ -84,6 +84,9 @@ type E2EConfig struct { func GenesisFork() int { cfg := params.BeaconConfig() + if cfg.DenebForkEpoch == 0 { + return version.Deneb + } if cfg.CapellaForkEpoch == 0 { return version.Capella }