Log commit hash on slasher startup (#6138)

* Add version log to slasher
* Add slasher version log on startup
* Remove duplicate log
* Merge refs/heads/master into slasher-commit
* Fix tet
* Merge branch 'slasher-commit' of github.com:prysmaticlabs/prysm into slasher-commit
* Undo
* Fix log in rpc
* Merge refs/heads/master into slasher-commit
* Merge refs/heads/master into slasher-commit
* Merge refs/heads/master into slasher-commit
* Merge refs/heads/master into slasher-commit
This commit is contained in:
Ivan Martinez
2020-06-05 08:04:12 -04:00
committed by GitHub
parent fd3cb0be55
commit e37c9d1334
5 changed files with 10 additions and 7 deletions

View File

@@ -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",

View File

@@ -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)

View File

@@ -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"

View File

@@ -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...)

View File

@@ -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)