-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add gateway connector capability config #14325
Changes from 1 commit
fc3bc6b
6bcb60d
80b5f62
518b858
6f0e185
b07269a
21b241c
9e6cc1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -509,6 +509,28 @@ DeltaReconcile = '1m' # Default | |
# but the host and port must be fully specified and cannot be empty. You can specify `0.0.0.0` (IPv4) or `::` (IPv6) to listen on all interfaces, but that is not recommended. | ||
ListenAddresses = ['1.2.3.4:9999', '[a52d:0:a88:1274::abcd]:1337'] # Example | ||
|
||
[Capabilities.WorkflowConnectorConfig] | ||
# ChainIDForNodeKey is the ChainID of the network | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "ChainIDForNodeKey is the ChainID of the network associated with a private key to be used for authentication with Gateway nodes" |
||
ChainIDForNodeKey = '1' # Example | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed before, you'll also need to provide the desired address of a key you want to use. You can handle it in a separate PR but it will save you some trouble if you don't have to re-generate all test outputs again. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've generated |
||
|
||
[Capabilities.WorkflowConnectorConfig.GatewayConnectorConfig] | ||
# NodeAddress is Workflow Node address | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "NodeAddress is the address of the desired private key to be used for authentication with Gateway nodes" |
||
NodeAddress = '0x68902d681c28119f9b2531473a417088bf008e59' # Example | ||
# DonID is the Id of the Don | ||
DonID = 'example_don' # Example | ||
# WsHandshakeTimeoutMillis is Websocket handshake timeout | ||
WsHandshakeTimeoutMillis = 1000 # Example | ||
# AuthMinChallengeLen is the minimum number of bytes in Authentication | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "... number of bytes in authentication challenge payload" |
||
AuthMinChallengeLen = 10 # Example | ||
# AuthTimestampToleranceSec is Authentication timestamp tolerance | ||
AuthTimestampToleranceSec = 10 # Example | ||
|
||
[[Capabilities.WorkflowConnectorConfig.GatewayConnectorConfig.Gateways]] | ||
# ID of the Gateway | ||
ID = 'example_gateway' # Example | ||
# URL of the Gateway | ||
URL = 'ws://localhost:8081/node' # Example | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change "ws" to "wss" |
||
|
||
[Keeper] | ||
# **ADVANCED** | ||
# DefaultTransactionQueueDepth controls the queue size for `DropOldestStrategy` in Keeper. Set to 0 to use `SendEvery` strategy instead. | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -9,8 +9,6 @@ import ( | |||||
"regexp" | ||||||
"strings" | ||||||
|
||||||
"math/big" | ||||||
|
||||||
"github.com/google/uuid" | ||||||
"go.uber.org/multierr" | ||||||
"go.uber.org/zap/zapcore" | ||||||
|
@@ -1484,7 +1482,7 @@ func (drl *DispatcherRateLimit) setFrom(f *DispatcherRateLimit) { | |||||
|
||||||
type GatewayConnectorConfig struct { | ||||||
NodeAddress *string | ||||||
DonId *string | ||||||
DonID *string | ||||||
Gateways []ConnectorGatewayConfig | ||||||
WsHandshakeTimeoutMillis *uint32 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think
Suggested change
|
||||||
AuthMinChallengeLen *int | ||||||
|
@@ -1496,8 +1494,8 @@ func (r *GatewayConnectorConfig) setFrom(f *GatewayConnectorConfig) { | |||||
r.NodeAddress = f.NodeAddress | ||||||
} | ||||||
|
||||||
if f.DonId != nil { | ||||||
r.DonId = f.DonId | ||||||
if f.DonID != nil { | ||||||
r.DonID = f.DonID | ||||||
} | ||||||
|
||||||
// TODO: verify this copy by reference is ok, or does array need to be copied by value | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resolve this TODO please - most likely reference is OK (@cedric-cordenier ?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I commented this on the previous PR: it's fine to use the reference here, but the interface implementation (the getter) should do a deep copy before returning it. This will prevent bugs with a caller modifying the underlying array. |
||||||
|
@@ -1519,22 +1517,20 @@ func (r *GatewayConnectorConfig) setFrom(f *GatewayConnectorConfig) { | |||||
} | ||||||
|
||||||
type ConnectorGatewayConfig struct { | ||||||
Id *string | ||||||
ID *string | ||||||
URL *string | ||||||
} | ||||||
type WorkflowConnectorConfig struct { | ||||||
ChainIDForNodeKey *big.Int | ||||||
GatewayConnectorConfig *GatewayConnectorConfig `json:"gatewayConnectorConfig"` | ||||||
ChainIDForNodeKey *string | ||||||
GatewayConnectorConfig GatewayConnectorConfig `json:"gatewayConnectorConfig"` | ||||||
} | ||||||
|
||||||
func (r *WorkflowConnectorConfig) setFrom(f *WorkflowConnectorConfig) { | ||||||
if len(f.ChainIDForNodeKey.Bits()) != 0 { | ||||||
if f.ChainIDForNodeKey != nil { | ||||||
r.ChainIDForNodeKey = f.ChainIDForNodeKey | ||||||
} | ||||||
|
||||||
if !reflect.ValueOf(f.GatewayConnectorConfig).IsZero() { | ||||||
r.GatewayConnectorConfig.setFrom(f.GatewayConnectorConfig) | ||||||
} | ||||||
r.GatewayConnectorConfig.setFrom(&f.GatewayConnectorConfig) | ||||||
} | ||||||
|
||||||
type Capabilities struct { | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like you ran update with a production (non dev/test mode) chainlink binary There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK, my build has always been a dev binary via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ COMMANDS: | |
|
||
OPTIONS: | ||
--help, -h show help | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should merge these two structs for simplicity. WorkflowConnectorConfig is not a great name (I know I proposed it myself). How about we flatten everything into GatewayConnectorConfig? Simply move ChainIDForNodeKey() in there.