Compare commits

...

2 Commits

Author SHA1 Message Date
Raul Jordan
393a871db1 Merge branch 'develop' into revert-10986-revert-10973-slasher-scenario-test 2022-07-08 03:00:04 +00:00
Raul Jordan
0b38a80ba4 Revert "Revert "Move Slasher E2E To Scenario Test" (#10986)"
This reverts commit c9a366c36a.
2022-07-07 18:10:21 -04:00
4 changed files with 24 additions and 45 deletions

View File

@@ -52,7 +52,6 @@ go_test(
"endtoend_setup_test.go",
"endtoend_test.go",
"minimal_e2e_test.go",
"minimal_slashing_e2e_test.go",
"slasher_simulator_e2e_test.go",
],
args = ["-test.v"],

View File

@@ -3,6 +3,7 @@ package endtoend
import (
"testing"
ev "github.com/prysmaticlabs/prysm/testing/endtoend/evaluators"
"github.com/prysmaticlabs/prysm/testing/endtoend/types"
)
@@ -18,6 +19,20 @@ func TestEndToEnd_MinimalConfig_Web3Signer(t *testing.T) {
e2eMinimal(t, types.WithRemoteSigner()).run()
}
func TestEndToEnd_MinimalConfig_Slasher(t *testing.T) {
e2eMinimal(
t,
types.WithSlasher(
ev.PeersConnect,
ev.HealthzCheck,
ev.ValidatorsSlashedAfterEpoch(4),
ev.SlashedValidatorsLoseBalanceAfterEpoch(4),
ev.InjectDoubleVoteOnEpoch(2),
ev.InjectDoubleBlockOnEpoch(2),
),
).run()
}
func TestEndToEnd_ScenarioRun_EEOffline(t *testing.T) {
t.Skip("TODO(#10242) Prysm is current unable to handle an offline e2e")
runner := e2eMinimal(t)

View File

@@ -1,44 +0,0 @@
package endtoend
import (
"fmt"
"testing"
"github.com/prysmaticlabs/prysm/config/params"
ev "github.com/prysmaticlabs/prysm/testing/endtoend/evaluators"
e2eParams "github.com/prysmaticlabs/prysm/testing/endtoend/params"
"github.com/prysmaticlabs/prysm/testing/endtoend/types"
"github.com/prysmaticlabs/prysm/testing/require"
)
func TestEndToEnd_Slasher_MinimalConfig(t *testing.T) {
params.SetupTestConfigCleanup(t)
params.OverrideBeaconConfig(params.E2ETestConfig().Copy())
require.NoError(t, e2eParams.Init(t, e2eParams.StandardBeaconCount))
tracingPort := e2eParams.TestParams.Ports.JaegerTracingPort
tracingEndpoint := fmt.Sprintf("127.0.0.1:%d", tracingPort)
testConfig := &types.E2EConfig{
BeaconFlags: []string{
"--slasher",
},
ValidatorFlags: []string{},
EpochsToRun: 4,
TestSync: false,
TestFeature: false,
TestDeposits: false,
Evaluators: []types.Evaluator{
ev.PeersConnect,
ev.HealthzCheck,
ev.ValidatorsSlashedAfterEpoch(4),
ev.SlashedValidatorsLoseBalanceAfterEpoch(4),
ev.InjectDoubleVoteOnEpoch(2),
ev.InjectDoubleBlockOnEpoch(2),
},
EvalInterceptor: defaultInterceptor,
TracingSinkEndpoint: tracingEndpoint,
}
newTestRunner(t, testConfig).run()
}

View File

@@ -23,6 +23,14 @@ func WithRemoteSigner() E2EConfigOpt {
}
}
func WithSlasher(evs ...Evaluator) E2EConfigOpt {
return func(cfg *E2EConfig) {
cfg.UseSlasher = true
cfg.Evaluators = evs
cfg.BeaconFlags = append(cfg.BeaconFlags, "--slasher")
}
}
func WithCheckpointSync() E2EConfigOpt {
return func(cfg *E2EConfig) {
cfg.TestCheckpointSync = true
@@ -37,6 +45,7 @@ type E2EConfig struct {
UsePrysmShValidator bool
UsePprof bool
UseWeb3RemoteSigner bool
UseSlasher bool
TestDeposits bool
UseFixedPeerIDs bool
UseValidatorCrossClient bool