mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
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:
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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...)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user