diff --git a/slasher/node/BUILD.bazel b/slasher/node/BUILD.bazel index 1c2c24a01e..f9aecbcebc 100644 --- a/slasher/node/BUILD.bazel +++ b/slasher/node/BUILD.bazel @@ -14,6 +14,7 @@ go_library( "//shared/featureconfig:go_default_library", "//shared/prometheus:go_default_library", "//shared/tracing:go_default_library", + "//shared/version:go_default_library", "//slasher/beaconclient:go_default_library", "//slasher/db:go_default_library", "//slasher/db/kv:go_default_library", diff --git a/slasher/node/node.go b/slasher/node/node.go index 7bf45a11ea..782f8b710c 100644 --- a/slasher/node/node.go +++ b/slasher/node/node.go @@ -20,6 +20,7 @@ import ( "github.com/prysmaticlabs/prysm/shared/featureconfig" "github.com/prysmaticlabs/prysm/shared/prometheus" "github.com/prysmaticlabs/prysm/shared/tracing" + "github.com/prysmaticlabs/prysm/shared/version" "github.com/prysmaticlabs/prysm/slasher/beaconclient" "github.com/prysmaticlabs/prysm/slasher/db" "github.com/prysmaticlabs/prysm/slasher/db/kv" @@ -104,6 +105,10 @@ func (s *SlasherNode) Start() { s.services.StartAll() s.lock.Unlock() + log.WithFields(logrus.Fields{ + "version": version.GetVersion(), + }).Info("Starting slasher client") + stop := s.stop go func() { sigc := make(chan os.Signal, 1) diff --git a/slasher/rpc/server.go b/slasher/rpc/server.go index 23a559f44c..e2d0c9e196 100644 --- a/slasher/rpc/server.go +++ b/slasher/rpc/server.go @@ -14,7 +14,6 @@ import ( "github.com/prysmaticlabs/prysm/slasher/beaconclient" "github.com/prysmaticlabs/prysm/slasher/db" "github.com/prysmaticlabs/prysm/slasher/detection" - log "github.com/sirupsen/logrus" "go.opencensus.io/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/slasher/rpc/service.go b/slasher/rpc/service.go index 8371e00613..d51e906412 100644 --- a/slasher/rpc/service.go +++ b/slasher/rpc/service.go @@ -8,17 +8,16 @@ import ( "fmt" "net" - "github.com/prysmaticlabs/prysm/slasher/beaconclient" - middleware "github.com/grpc-ecosystem/go-grpc-middleware" recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" grpc_opentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing" grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" slashpb "github.com/prysmaticlabs/prysm/proto/slashing" "github.com/prysmaticlabs/prysm/shared/traceutil" + "github.com/prysmaticlabs/prysm/slasher/beaconclient" "github.com/prysmaticlabs/prysm/slasher/db" "github.com/prysmaticlabs/prysm/slasher/detection" - log "github.com/sirupsen/logrus" + "github.com/sirupsen/logrus" "go.opencensus.io/plugin/ocgrpc" "google.golang.org/grpc" "google.golang.org/grpc/credentials" @@ -53,6 +52,8 @@ type Config struct { BeaconClient *beaconclient.Service } +var log = logrus.WithField("prefix", "rpc") + // NewService instantiates a new RPC service instance that will // be registered into a running beacon node. func NewService(ctx context.Context, cfg *Config) *Service { @@ -105,8 +106,6 @@ func (s *Service) Start() { s.credentialError = err } opts = append(opts, grpc.Creds(creds)) - } else { - log.Warn("You are using an insecure gRPC connection! Provide a certificate and key to connect securely") } s.grpcServer = grpc.NewServer(opts...) diff --git a/slasher/rpc/service_test.go b/slasher/rpc/service_test.go index a3b78bfc61..d5e739e267 100644 --- a/slasher/rpc/service_test.go +++ b/slasher/rpc/service_test.go @@ -52,7 +52,6 @@ func TestRPC_InsecureEndpoint(t *testing.T) { rpcService.Start() testutil.AssertLogsContain(t, hook, fmt.Sprint("listening on port")) - testutil.AssertLogsContain(t, hook, "You are using an insecure gRPC connection") if err := rpcService.Stop(); err != nil { t.Error(err)