Skip to content

Commit

Permalink
Merge pull request #47 from crytic/fix-kt-2
Browse files Browse the repository at this point in the history
remove grafana and upgrade kurtosis
  • Loading branch information
bsamuels453 authored Jan 9, 2024
2 parents 0e39911 + 684d1bf commit bda680f
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 54 deletions.
25 changes: 10 additions & 15 deletions network-configs/devnet-12.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
participants:
- el_client_type: geth
el_client_image: ethpandaops/geth:master-5b57727
- el_client_type: nethermind
el_client_image: nethermindeth/nethermind:release-1.25.0
el_extra_labels: {"ethereum-package.partition": "partA"}
cl_client_type: lighthouse
cl_client_image: ethpandaops/lighthouse:sidecar-inclusion-proof-e5a0e2c
cl_client_image: ethpandaops/lighthouse:unstable-c55608b
beacon_extra_labels: {"ethereum-package.partition": "partA"}
validator_extra_labels: {"ethereum-package.partition": "partA"}
el_min_cpu: 1000
Expand All @@ -18,12 +18,12 @@ participants:
v_max_cpu: 1000
v_min_mem: 1028
v_max_mem: 1028
count: 2
count: 1
- el_client_type: nethermind
el_client_image: ethpandaops/nethermind:master-dcec565
el_client_image: nethermindeth/nethermind:release-1.25.0
el_extra_labels: {"ethereum-package.partition": "partA"}
cl_client_type: teku
cl_client_image: ethpandaops/teku:master-992b224
cl_client_type: lighthouse
cl_client_image: ethpandaops/lighthouse:unstable-c55608b
beacon_extra_labels: {"ethereum-package.partition": "partA"}
validator_extra_labels: {"ethereum-package.partition": "partA"}
el_min_cpu: 1000
Expand All @@ -42,8 +42,8 @@ participants:
- el_client_type: reth
el_client_image: ethpandaops/reth:main-471c28e
el_extra_labels: {"ethereum-package.partition": "partB"}
cl_client_type: lodestar
cl_client_image: ethpandaops/lodestar:blobs-inclproof-d5a5a47
cl_client_type: prysm
cl_client_image: gcr.io/prysmaticlabs/prysm/beacon-chain:HEAD-929e9d,gcr.io/prysmaticlabs/prysm/validator:HEAD-929e9d
beacon_extra_labels: {"ethereum-package.partition": "partB"}
validator_extra_labels: {"ethereum-package.partition": "partB"}
el_min_cpu: 1000
Expand All @@ -61,13 +61,8 @@ participants:
count: 1
network_params:
deneb_fork_epoch: 1
num_validator_keys_per_node: 32
seconds_per_slot: 6
genesis_delay: 120
additional_services:
- prometheus_grafana
- beacon_metrics_gazer
- dora
- tx_spammer
- blob_spammer
parallel_keystore_generation: true
persistent: true
13 changes: 9 additions & 4 deletions pkg/health/ethereum/execution_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@ func (c *ExecRpcClient) GetLatestBlockBy(ctx context.Context, blockType string)
"Unknown block error", //nethermind
"unknown block", //reth
}
if err.Error() == notFinalizingErrors[0] ||
err.Error() == notFinalizingErrors[1] ||
err.Error() == notFinalizingErrors[2] ||
err.Error() == notFinalizingErrors[3] {
noFinalBlockFound := false
for _, msg := range notFinalizingErrors {
if err.Error() == msg {
noFinalBlockFound = true
break
}
}

if noFinalBlockFound {
choice = &ClientForkChoice{
Pod: c.session.Pod,
BlockNumber: 0,
Expand Down
43 changes: 23 additions & 20 deletions pkg/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"attacknet/cmd/pkg/project"
"context"
"errors"
"fmt"
"time"

"github.com/kurtosis-tech/stacktrace"
Expand All @@ -28,28 +29,20 @@ func StartTestSuite(ctx context.Context, cfg *project.ConfigParsed) error {
}

// todo: move these into setupServices or something.
log.Infof("Creating a Grafana client")
grafanaTunnel, err := CreateGrafanaClient(ctx, kubeClient, cfg.AttacknetConfig)
if err != nil {
return err
}
defer func() {
grafanaTunnel.Cleanup(false)
}()

// todo: set up grafana health checks/alerting here

// todo: wait for finality or other network pre-conditions here.
// probably check for initial health checks here too.

//ds, err := grafanaTunnel.Client.GetDatasource(ctx, 1)
//grafanaTunnel.Client.CreateAlertNotification()
//log.Infof("Creating a Grafana client")
//grafanaTunnel, err := CreateGrafanaClient(ctx, kubeClient, cfg.AttacknetConfig)
//if err != nil {
// return err
//}
//defer func() {
// grafanaTunnel.Cleanup(false)
//}()

// create chaos-mesh client
log.Infof("Creating a chaos-mesh client")
chaosClient, err := chaos_mesh.CreateClient(enclave.Namespace, kubeClient)
if err != nil {
grafanaTunnel.Cleanup(true)
// grafanaTunnel.Cleanup(true)
return err
}

Expand All @@ -64,14 +57,14 @@ func StartTestSuite(ctx context.Context, cfg *project.ConfigParsed) error {

faultSession, err := chaosClient.StartFault(ctx, cfg.Tests[0].FaultSpec)
if err != nil {
grafanaTunnel.Cleanup(true)
// grafanaTunnel.Cleanup(true)
return err
}

// start core logic loop here.
err = waitForInjectionCompleted(ctx, faultSession)
if err != nil {
grafanaTunnel.Cleanup(true)
// grafanaTunnel.Cleanup(true)
return err
}
var timeToSleep time.Duration
Expand All @@ -94,12 +87,22 @@ func StartTestSuite(ctx context.Context, cfg *project.ConfigParsed) error {

err = waitForFaultRecovery(ctx, faultSession)
if err != nil {
grafanaTunnel.Cleanup(true)
// grafanaTunnel.Cleanup(true)
return err
}

_, err = hc.RunChecksUntilTimeout(ctx)

if err != nil {
log.Errorf("Errors encountered while running health checks: %s", err.Error())
}

// handle post-fault inspection
if cfg.AttacknetConfig.AllowPostFaultInspection {
log.Info("Press enter to terminate the port-forward connection.")
_, _ = fmt.Scanln()
}

return err
}

Expand Down
11 changes: 5 additions & 6 deletions test-suites/clock-skew.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
attacknetConfig:
grafanaPodName: grafana
grafanaPodPort: 3000
waitBeforeInjectionSeconds: 60
reuseDevnetBetweenRuns: false
waitBeforeInjectionSeconds: 300
reuseDevnetBetweenRuns: true
allowPostFaultInspection: true

harnessConfig:
networkPackage: github.com/kurtosis-tech/ethereum-package
networkConfig: default.yaml
networkConfig: devnet-12.yaml
networkType: ethereum

tests:
Expand All @@ -22,6 +22,5 @@ tests:
kurtosistech.com.custom/ethereum-package.client-type: beacon
mode: all
action: delay
timeOffset: '-5m'
duration: 10m

timeOffset: '-1m'
duration: 1m
7 changes: 3 additions & 4 deletions test-suites/cpu-stress.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
attacknetConfig:
grafanaPodName: grafana
grafanaPodPort: 3000
waitBeforeInjectionSeconds: 10
waitBeforeInjectionSeconds: 300
reuseDevnetBetweenRuns: true
existingDevnetNamespace: kt-ethereum
allowPostFaultInspection: true

harnessConfig:
networkPackage: github.com/kurtosis-tech/ethereum-package
networkConfig: default.yaml
networkConfig: devnet-12.yaml
networkType: ethereum

tests:
Expand All @@ -27,7 +26,7 @@ tests:
# kurtosistech.com.custom/ethereum-package.client-type: beacon
# kurtosistech.com.custom/ethereum-package.client-type: execution
#kurtosistech.com/id: cl-3-prysm-geth
kurtosistech.com/id: cl-2-prysm-geth
kurtosistech.com/id: cl-3-prysm-reth
stressors:
cpu:
workers: 30 # number of threads that apply stress defined by `load`. workers * load may exceed 100.
Expand Down
9 changes: 4 additions & 5 deletions test-suites/io-fault.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
attacknetConfig:
grafanaPodName: grafana
grafanaPodPort: 3000
waitBeforeInjectionSeconds: 10
reuseDevnetBetweenRuns: true
existingDevnetNamespace: kt-ethereum
waitBeforeInjectionSeconds: 300
reuseDevnetBetweenRuns: false
allowPostFaultInspection: true

harnessConfig:
networkPackage: github.com/kurtosis-tech/ethereum-package
networkConfig: default.yaml
networkConfig: devnet-12.yaml
networkType: ethereum

tests:
Expand All @@ -29,7 +28,7 @@ tests:

errno: 5
percent: 50
duration: 120s
duration: 30s



0 comments on commit bda680f

Please sign in to comment.