Skip to content

Commit

Permalink
core: service audit (#15055)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Nov 2, 2024
1 parent a0fbd3a commit 0e199bb
Show file tree
Hide file tree
Showing 15 changed files with 92 additions and 95 deletions.
4 changes: 2 additions & 2 deletions core/capabilities/gateway_connector/service_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewGatewayConnectorServiceWrapper(config config.GatewayConnector, keystore
config: config,
keystore: keystore,
clock: clock,
lggr: lggr,
lggr: lggr.Named("GatewayConnectorServiceWrapper"),
}
}

Expand Down Expand Up @@ -106,7 +106,7 @@ func (e *ServiceWrapper) HealthReport() map[string]error {
}

func (e *ServiceWrapper) Name() string {
return "GatewayConnectorServiceWrapper"
return e.lggr.Name()
}

func (e *ServiceWrapper) GetGatewayConnector() connector.GatewayConnector {
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (w *launcher) HealthReport() map[string]error {
}

func (w *launcher) Name() string {
return "CapabilitiesLauncher"
return w.lggr.Name()
}

func (w *launcher) Launch(ctx context.Context, state *registrysyncer.LocalRegistry) error {
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/remote/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,5 +236,5 @@ func (d *dispatcher) HealthReport() map[string]error {
}

func (d *dispatcher) Name() string {
return "Dispatcher"
return d.lggr.Name()
}
2 changes: 1 addition & 1 deletion core/capabilities/remote/target/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,5 @@ func (c *client) HealthReport() map[string]error {
}

func (c *client) Name() string {
return "TargetClient"
return c.lggr.Name()
}
2 changes: 1 addition & 1 deletion core/capabilities/remote/target/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,5 +226,5 @@ func (r *server) HealthReport() map[string]error {
}

func (r *server) Name() string {
return "TargetServer"
return r.lggr.Name()
}
2 changes: 1 addition & 1 deletion core/capabilities/remote/trigger_publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,5 +333,5 @@ func (p *triggerPublisher) HealthReport() map[string]error {
}

func (p *triggerPublisher) Name() string {
return "TriggerPublisher"
return p.lggr.Name()
}
4 changes: 2 additions & 2 deletions core/capabilities/remote/trigger_subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package remote
import (
"context"
"errors"
sync "sync"
"sync"
"time"

commoncap "github.com/smartcontractkit/chainlink-common/pkg/capabilities"
Expand Down Expand Up @@ -269,5 +269,5 @@ func (s *triggerSubscriber) HealthReport() map[string]error {
}

func (s *triggerSubscriber) Name() string {
return "TriggerSubscriber"
return s.lggr.Name()
}
2 changes: 1 addition & 1 deletion core/capabilities/webapi/trigger/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (h *triggerConnectorHandler) HealthReport() map[string]error {
}

func (h *triggerConnectorHandler) Name() string {
return "WebAPITrigger"
return h.lggr.Name()
}

func (h *triggerConnectorHandler) sendResponse(ctx context.Context, gatewayID string, requestBody *api.MessageBody, payload any) error {
Expand Down
2 changes: 1 addition & 1 deletion core/services/p2p/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,5 @@ func (p *peer) HealthReport() map[string]error {
}

func (p *peer) Name() string {
return "P2PPeer"
return p.lggr.Name()
}
4 changes: 2 additions & 2 deletions core/services/p2p/wrapper/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewExternalPeerWrapper(keystoreP2P keystore.P2P, p2pConfig config.P2P, ds s
return &peerWrapper{
keystoreP2P: keystoreP2P,
p2pConfig: p2pConfig,
lggr: lggr,
lggr: lggr.Named("PeerWrapper"),
ds: ds,
}
}
Expand Down Expand Up @@ -126,7 +126,7 @@ func (e *peerWrapper) HealthReport() map[string]error {
}

func (e *peerWrapper) Name() string {
return "PeerWrapper"
return e.lggr.Name()
}

func (e *peerWrapper) Sign(msg []byte) ([]byte, error) {
Expand Down
8 changes: 2 additions & 6 deletions core/services/registrysyncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,10 @@ func (s *registrySyncer) Close() error {
})
}

func (s *registrySyncer) Ready() error {
return nil
}

func (s *registrySyncer) HealthReport() map[string]error {
return nil
return map[string]error{s.Name(): s.Healthy()}
}

func (s *registrySyncer) Name() string {
return "RegistrySyncer"
return s.lggr.Name()
}
10 changes: 2 additions & 8 deletions core/services/relay/evm/chain_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,11 @@ func (w *chainWriter) Close() error {
}

func (w *chainWriter) HealthReport() map[string]error {
return map[string]error{
w.Name(): nil,
}
return map[string]error{w.Name(): w.Healthy()}
}

func (w *chainWriter) Name() string {
return "chain-writer"
}

func (w *chainWriter) Ready() error {
return nil
return w.logger.Name()
}

func (w *chainWriter) Start(ctx context.Context) error {
Expand Down
Loading

0 comments on commit 0e199bb

Please sign in to comment.