Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 89928ac

Browse files
authored
Revert "Feature/optional ws url" (#1540)
Reverts #1527 wss changes will ship with core 2.17 release
1 parent e41e7b4 commit 89928ac

36 files changed

+103
-695
lines changed

.changeset/four-kangaroos-appear.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/happy-feet-rhyme.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

.changeset/kind-numbers-melt.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

.changeset/moody-rules-agree.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

.changeset/silly-lies-boil.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/integration-tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ jobs:
170170
only-new-issues: false # disabled for PRs due to unreliability
171171
args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml
172172
working-directory: ${{ matrix.project.path }}
173-
continue-on-error: true
174173

175174
build-chainlink:
176175
environment: integration
@@ -585,7 +584,7 @@ jobs:
585584
test_config_chainlink_version: ${{ inputs.evm-ref || github.sha }}
586585
test_config_selected_networks: ${{ env.SELECTED_NETWORKS }}
587586
test_config_logging_run_id: ${{ github.run_id }}
588-
test_config_logstream_log_targets: "file"
587+
test_config_logstream_log_targets: ${{ vars.LOGSTREAM_LOG_TARGETS }}
589588
test_config_test_log_collect: ${{ vars.TEST_LOG_COLLECT }}
590589
cl_repo: ${{ env.CHAINLINK_IMAGE }}
591590
cl_image_tag: ${{ inputs.evm-ref || github.sha }}${{ matrix.product.tag_suffix }}
@@ -607,7 +606,7 @@ jobs:
607606
go_coverage_src_dir: /var/tmp/go-coverage
608607
go_coverage_dest_dir: ${{ github.workspace }}/.covdata
609608
DEFAULT_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }}
610-
DEFAULT_LOKI_TENANT_ID: "promtail"
609+
DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
611610
DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push
612611
DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
613612
DEFAULT_GRAFANA_BASE_URL: "http://localhost:8080/primary"

common/client/node.go

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ type NodeConfig interface {
4545
FinalizedBlockPollInterval() time.Duration
4646
EnforceRepeatableRead() bool
4747
DeathDeclarationDelay() time.Duration
48-
NewHeadsPollInterval() time.Duration
4948
}
5049

5150
type ChainConfig interface {
@@ -91,14 +90,14 @@ type node[
9190
services.StateMachine
9291
lfcLog logger.Logger
9392
name string
94-
id int
93+
id int32
9594
chainID CHAIN_ID
9695
nodePoolCfg NodeConfig
9796
chainCfg ChainConfig
9897
order int32
9998
chainFamily string
10099

101-
ws *url.URL
100+
ws url.URL
102101
http *url.URL
103102

104103
rpc RPC
@@ -121,10 +120,10 @@ func NewNode[
121120
nodeCfg NodeConfig,
122121
chainCfg ChainConfig,
123122
lggr logger.Logger,
124-
wsuri *url.URL,
123+
wsuri url.URL,
125124
httpuri *url.URL,
126125
name string,
127-
id int,
126+
id int32,
128127
chainID CHAIN_ID,
129128
nodeOrder int32,
130129
rpc RPC,
@@ -136,10 +135,8 @@ func NewNode[
136135
n.chainID = chainID
137136
n.nodePoolCfg = nodeCfg
138137
n.chainCfg = chainCfg
138+
n.ws = wsuri
139139
n.order = nodeOrder
140-
if wsuri != nil {
141-
n.ws = wsuri
142-
}
143140
if httpuri != nil {
144141
n.http = httpuri
145142
}
@@ -159,10 +156,7 @@ func NewNode[
159156
}
160157

161158
func (n *node[CHAIN_ID, HEAD, RPC]) String() string {
162-
s := fmt.Sprintf("(%s)%s", Primary.String(), n.name)
163-
if n.ws != nil {
164-
s = s + fmt.Sprintf(":%s", n.ws.String())
165-
}
159+
s := fmt.Sprintf("(%s)%s:%s", Primary.String(), n.name, n.ws.String())
166160
if n.http != nil {
167161
s = s + fmt.Sprintf(":%s", n.http.String())
168162
}

common/client/node_test.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ type testNodeConfig struct {
2020
enforceRepeatableRead bool
2121
finalizedBlockPollInterval time.Duration
2222
deathDeclarationDelay time.Duration
23-
newHeadsPollInterval time.Duration
24-
}
25-
26-
func (n testNodeConfig) NewHeadsPollInterval() time.Duration {
27-
return n.newHeadsPollInterval
2823
}
2924

3025
func (n testNodeConfig) PollFailureThreshold() uint32 {
@@ -67,10 +62,10 @@ type testNodeOpts struct {
6762
config testNodeConfig
6863
chainConfig clientMocks.ChainConfig
6964
lggr logger.Logger
70-
wsuri *url.URL
65+
wsuri url.URL
7166
httpuri *url.URL
7267
name string
73-
id int
68+
id int32
7469
chainID types.ID
7570
nodeOrder int32
7671
rpc *mockNodeClient[types.ID, Head]

core/chains/evm/client/config_builder.go

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func NewClientConfigs(
4343
deathDeclarationDelay time.Duration,
4444
noNewFinalizedHeadsThreshold time.Duration,
4545
finalizedBlockPollInterval time.Duration,
46-
newHeadsPollInterval time.Duration,
46+
4747
) (commonclient.ChainConfig, evmconfig.NodePool, []*toml.Node, error) {
4848
nodes, err := parseNodeConfigs(nodeCfgs)
4949
if err != nil {
@@ -59,7 +59,6 @@ func NewClientConfigs(
5959
EnforceRepeatableRead: enforceRepeatableRead,
6060
DeathDeclarationDelay: commonconfig.MustNewDuration(deathDeclarationDelay),
6161
FinalizedBlockPollInterval: commonconfig.MustNewDuration(finalizedBlockPollInterval),
62-
NewHeadsPollInterval: commonconfig.MustNewDuration(newHeadsPollInterval),
6362
}
6463
nodePoolCfg := &evmconfig.NodePoolConfig{C: nodePool}
6564
chainConfig := &evmconfig.EVMConfig{
@@ -80,21 +79,15 @@ func NewClientConfigs(
8079
func parseNodeConfigs(nodeCfgs []NodeConfig) ([]*toml.Node, error) {
8180
nodes := make([]*toml.Node, len(nodeCfgs))
8281
for i, nodeCfg := range nodeCfgs {
83-
var wsURL, httpURL *commonconfig.URL
84-
// wsUrl requirement will be checked in EVMConfig validation
85-
if nodeCfg.WSURL != nil {
86-
wsURL = commonconfig.MustParseURL(*nodeCfg.WSURL)
87-
}
88-
89-
if nodeCfg.HTTPURL == nil {
90-
return nil, fmt.Errorf("node config [%d]: missing HTTP URL", i)
82+
if nodeCfg.WSURL == nil || nodeCfg.HTTPURL == nil {
83+
return nil, fmt.Errorf("node config [%d]: missing WS or HTTP URL", i)
9184
}
92-
93-
httpURL = commonconfig.MustParseURL(*nodeCfg.HTTPURL)
85+
wsUrl := commonconfig.MustParseURL(*nodeCfg.WSURL)
86+
httpUrl := commonconfig.MustParseURL(*nodeCfg.HTTPURL)
9487
node := &toml.Node{
9588
Name: nodeCfg.Name,
96-
WSURL: wsURL,
97-
HTTPURL: httpURL,
89+
WSURL: wsUrl,
90+
HTTPURL: httpUrl,
9891
SendOnly: nodeCfg.SendOnly,
9992
Order: nodeCfg.Order,
10093
}

core/chains/evm/client/config_builder_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ func TestClientConfigBuilder(t *testing.T) {
3737
finalityDepth := ptr(uint32(10))
3838
finalityTagEnabled := ptr(true)
3939
noNewHeadsThreshold := time.Second
40-
newHeadsPollInterval := 0 * time.Second
4140
chainCfg, nodePool, nodes, err := client.NewClientConfigs(selectionMode, leaseDuration, chainTypeStr, nodeConfigs,
4241
pollFailureThreshold, pollInterval, syncThreshold, nodeIsSyncingEnabled, noNewHeadsThreshold, finalityDepth,
43-
finalityTagEnabled, finalizedBlockOffset, enforceRepeatableRead, deathDeclarationDelay, noNewFinalizedBlocksThreshold,
44-
pollInterval, newHeadsPollInterval)
42+
finalityTagEnabled, finalizedBlockOffset, enforceRepeatableRead, deathDeclarationDelay, noNewFinalizedBlocksThreshold, pollInterval)
4543
require.NoError(t, err)
4644

4745
// Validate node pool configs
@@ -54,7 +52,6 @@ func TestClientConfigBuilder(t *testing.T) {
5452
require.Equal(t, *enforceRepeatableRead, nodePool.EnforceRepeatableRead())
5553
require.Equal(t, deathDeclarationDelay, nodePool.DeathDeclarationDelay())
5654
require.Equal(t, pollInterval, nodePool.FinalizedBlockPollInterval())
57-
require.Equal(t, newHeadsPollInterval, nodePool.NewHeadsPollInterval())
5855

5956
// Validate node configs
6057
require.Equal(t, *nodeConfigs[0].Name, *nodes[0].Name)
@@ -93,15 +90,15 @@ func TestNodeConfigs(t *testing.T) {
9390
require.Len(t, tomlNodes, len(nodeConfigs))
9491
})
9592

96-
t.Run("ws can be optional", func(t *testing.T) {
93+
t.Run("parsing missing ws url fails", func(t *testing.T) {
9794
nodeConfigs := []client.NodeConfig{
9895
{
9996
Name: ptr("foo1"),
10097
HTTPURL: ptr("http://foo1.test"),
10198
},
10299
}
103100
_, err := client.ParseTestNodeConfigs(nodeConfigs)
104-
require.Nil(t, err)
101+
require.Error(t, err)
105102
})
106103

107104
t.Run("parsing missing http url fails", func(t *testing.T) {

0 commit comments

Comments
 (0)