Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/capabilities/gateway_connector/service_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gatewayconnector

import (
"context"
"fmt"

"github.com/ethereum/go-ethereum/common"
"github.com/jonboulle/clockwork"
Expand Down Expand Up @@ -67,7 +68,7 @@ func (e *ServiceWrapper) Start(ctx context.Context) error {
configuredNodeAddress := common.HexToAddress(nodeAddress)
err := e.keystore.CheckEnabled(ctx, configuredNodeAddress)
if err != nil {
return err
return fmt.Errorf("failed to start GatewayConnectorServiceWrapper: %w (node address: %s)", err, configuredNodeAddress)
}

translated := translateConfigs(conf)
Expand Down
1 change: 1 addition & 0 deletions core/config/capabilities_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type GatewayConnector interface {
WSHandshakeTimeoutMillis() uint32
AuthMinChallengeLen() int
AuthTimestampToleranceSec() uint32
Valid() bool
}

type ConnectorGateway interface {
Expand Down
2 changes: 1 addition & 1 deletion core/services/chainlink/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ func newCREServices(
srvcs = append(srvcs, closerService{name: "WorkflowExecutionLimiter", Closer: workflowLimits})

var gatewayConnectorWrapper *gatewayconnector.ServiceWrapper
if capCfg.GatewayConnector().DonID() != "" {
if capCfg.GatewayConnector().Valid() {
globalLogger.Debugw("Creating GatewayConnector wrapper", "donID", capCfg.GatewayConnector().DonID())
chainID, ok := new(big.Int).SetString(capCfg.GatewayConnector().ChainIDForNodeKey(), 0)
if !ok {
Expand Down
5 changes: 5 additions & 0 deletions core/services/chainlink/config_capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ type gatewayConnector struct {
func (c *gatewayConnector) ChainIDForNodeKey() string {
return *c.c.ChainIDForNodeKey
}

func (c *gatewayConnector) NodeAddress() string {
return *c.c.NodeAddress
}
Expand All @@ -263,6 +264,10 @@ func (c *gatewayConnector) DonID() string {
return *c.c.DonID
}

func (c *gatewayConnector) Valid() bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what observability can we emit to alleviate the partial config scenario?

it's good that the node will boot; but it won't function correctly. my concern is that we will make it even easier to misconfigure the system and it won't be able to detect it. maybe a simple library that emits feature enable metrics that is integrated in the Start call of the service lib; so that any StartOnce emits a node uuid and service name.

Or perhaps we can leverage existing HealthCheck abstraction to do something similar. I'd rather have the Service attempt to start, detect partial config, and report itself in a bad state.

@jmank88 wdyt?

return c.ChainIDForNodeKey() != "" && c.NodeAddress() != "" && c.DonID() != ""
}

func (c *gatewayConnector) Gateways() []config.ConnectorGateway {
t := make([]config.ConnectorGateway, len(c.c.Gateways))
for index, element := range c.c.Gateways {
Expand Down
Loading