From c640a694c01ce06deb89d696163abdaa0f36d43f Mon Sep 17 00:00:00 2001 From: y0sher Date: Wed, 13 Dec 2023 18:19:04 +0200 Subject: [PATCH] add all tests rotated, remove one problematic test that isn't slashable --- .../intercept/slashinginterceptor/slashing.go | 18 +++++++++++------- .../intercept/slashinginterceptor/tests.go | 16 ++++++++-------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/e2e/beacon_proxy/intercept/slashinginterceptor/slashing.go b/e2e/beacon_proxy/intercept/slashinginterceptor/slashing.go index bdca0df535..202e300644 100644 --- a/e2e/beacon_proxy/intercept/slashinginterceptor/slashing.go +++ b/e2e/beacon_proxy/intercept/slashinginterceptor/slashing.go @@ -98,15 +98,19 @@ func New( zap.Any("end_epoch", s.endEpoch), zap.Any("sleep_epoch", s.sleepEpoch), ) - first := true + a := 0 + p := 0 for _, validator := range validators { - proposerTest := ProposerSlashingTests[1] - attesterTest := AttesterSlashingTests[3] - if first { - proposerTest = ProposerSlashingTests[0] - attesterTest = AttesterSlashingTests[0] - first = false + if a == len(AttesterSlashingTests) { + a = 0 } + if p == len(ProposerSlashingTests) { + p = 0 + } + attesterTest := AttesterSlashingTests[a] + proposerTest := ProposerSlashingTests[p] + a++ + p++ s.validators[validator.Index] = &validatorState{ validator: validator, proposerTest: proposerTest, // TODO: extract from validators.json diff --git a/e2e/beacon_proxy/intercept/slashinginterceptor/tests.go b/e2e/beacon_proxy/intercept/slashinginterceptor/tests.go index b17d57ada0..98d7f6b623 100644 --- a/e2e/beacon_proxy/intercept/slashinginterceptor/tests.go +++ b/e2e/beacon_proxy/intercept/slashinginterceptor/tests.go @@ -85,14 +85,14 @@ var AttesterSlashingTests = []AttesterSlashingTest{ return nil }, }, - { - Name: "HigherSource_SameTarget_SameRoot", - Slashable: true, - Apply: func(data *phase0.AttestationData) error { - data.Source.Epoch += startEndEpochsDiff - return nil - }, - }, + //{ + // Name: "HigherSource_SameTarget_SameRoot", + // Slashable: true, + // Apply: func(data *phase0.AttestationData) error { + // data.Source.Epoch += startEndEpochsDiff + // return nil + // }, + //}, { Name: "LowerSource_HigherTarget_SameRoot", Slashable: true,