Skip to content
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

WS URL can be optional when LogBroadcaster is disabled #14364

Open
wants to merge 37 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b05a1a7
WS URL can be optional
huangzhen1997 Sep 5, 2024
71c84c6
add changeset
huangzhen1997 Sep 6, 2024
e99aae0
change
huangzhen1997 Sep 6, 2024
6737f0c
make WSURL optional
huangzhen1997 Sep 6, 2024
8df1659
fix test, and enforce SubscribeFilterLogs to fail when ws url not pro…
huangzhen1997 Sep 6, 2024
e1fa795
add comments
huangzhen1997 Sep 6, 2024
7f59b07
update changeset
huangzhen1997 Sep 6, 2024
48c7f1a
update dial logic and make ws optional not required
huangzhen1997 Sep 6, 2024
515888c
fix test
huangzhen1997 Sep 6, 2024
9ecc624
fix
huangzhen1997 Sep 9, 2024
01e9e08
fix lint
huangzhen1997 Sep 9, 2024
4b860a1
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
huangzhen1997 Sep 9, 2024
fdc5c8c
address comments
huangzhen1997 Sep 9, 2024
2660903
update comments
huangzhen1997 Sep 9, 2024
b3e270d
fix test
huangzhen1997 Sep 9, 2024
ba73ef6
add check when both ws and http missing
huangzhen1997 Sep 9, 2024
5bec775
add test and add restrictions
huangzhen1997 Sep 9, 2024
9a841ce
add comment
huangzhen1997 Sep 9, 2024
670ebb8
revert outdated change
huangzhen1997 Sep 9, 2024
799dc6c
remove extra line
huangzhen1997 Sep 9, 2024
427a8a0
fix test
huangzhen1997 Sep 9, 2024
7738ff0
revert changes from rpc client
huangzhen1997 Sep 10, 2024
795ee7b
unintended change
huangzhen1997 Sep 10, 2024
3b27171
remove unused
huangzhen1997 Sep 10, 2024
d3f523c
update verification logic
huangzhen1997 Sep 10, 2024
a71015d
add test fix
huangzhen1997 Sep 10, 2024
7908e2a
modify unit test to cover logbroadcaster enabled false
huangzhen1997 Sep 10, 2024
ae09d35
update doc
huangzhen1997 Sep 12, 2024
fe19568
udpate changeset
huangzhen1997 Sep 12, 2024
cc05a3f
address PR comments
huangzhen1997 Sep 13, 2024
d7a7719
address pr comments
huangzhen1997 Sep 13, 2024
3e92077
update invalid toml config
huangzhen1997 Sep 13, 2024
d7af044
fix test
huangzhen1997 Sep 13, 2024
4d83e3f
ws required for primary nodes when logbroadcaster enabled
huangzhen1997 Sep 16, 2024
d5dbade
minor
huangzhen1997 Sep 16, 2024
e8901e7
Dmytro's comments
huangzhen1997 Sep 19, 2024
2713252
fix nil ptr, more fix to come
huangzhen1997 Sep 19, 2024
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
8 changes: 8 additions & 0 deletions .changeset/silly-lies-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"chainlink": minor
---

Make websocket URL flag `WSURL` for `EVM.Nodes`, and apply logic so that:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Make websocket URL flag `WSURL` for `EVM.Nodes`, and apply logic so that:
Make websocket URL `WSURL` for `EVM.Nodes` optional, and apply logic so that:

* If WS URL was not provided, SubscribeFilterLogs should fail with an explicit error
* If WS URL was not provided LogBroadcaster should be disabled
#internal
jmank88 marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions common/client/mocks/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ type ChainConfig struct {
NoNewHeadsThresholdVal time.Duration
FinalizedBlockOffsetVal uint32
NoNewFinalizedHeadsThresholdVal time.Duration
NodeLogBroadcasterEnabled bool
}

func (t ChainConfig) LogBroadcasterEnabled() bool {
return t.NodeLogBroadcasterEnabled
}

func (t ChainConfig) NodeNoNewHeadsThreshold() time.Duration {
Expand Down
1 change: 1 addition & 0 deletions common/client/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type ChainConfig interface {
FinalityDepth() uint32
FinalityTagEnabled() bool
FinalizedBlockOffset() uint32
LogBroadcasterEnabled() bool
}

type Node[
Expand Down
4 changes: 2 additions & 2 deletions core/chains/evm/client/evm_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ func NewEvmClient(cfg evmconfig.NodePool, chainCfg commonclient.ChainConfig, cli
for i, node := range nodes {
if node.SendOnly != nil && *node.SendOnly {
rpc := NewRPCClient(lggr, empty, (*url.URL)(node.HTTPURL), *node.Name, int32(i), chainID,
commonclient.Secondary, cfg.FinalizedBlockPollInterval(), largePayloadRPCTimeout, defaultRPCTimeout, chainType)
commonclient.Secondary, cfg.FinalizedBlockPollInterval(), largePayloadRPCTimeout, defaultRPCTimeout, chainType, chainCfg.LogBroadcasterEnabled())
sendonly := commonclient.NewSendOnlyNode(lggr, (url.URL)(*node.HTTPURL),
*node.Name, chainID, rpc)
sendonlys = append(sendonlys, sendonly)
} else {
rpc := NewRPCClient(lggr, (url.URL)(*node.WSURL), (*url.URL)(node.HTTPURL), *node.Name, int32(i),
chainID, commonclient.Primary, cfg.FinalizedBlockPollInterval(), largePayloadRPCTimeout, defaultRPCTimeout, chainType)
chainID, commonclient.Primary, cfg.FinalizedBlockPollInterval(), largePayloadRPCTimeout, defaultRPCTimeout, chainType, chainCfg.LogBroadcasterEnabled())
primaryNode := commonclient.NewNode(cfg, chainCfg,
lggr, (url.URL)(*node.WSURL), (*url.URL)(node.HTTPURL), *node.Name, int32(i), chainID, *node.Order,
rpc, "EVM")
Expand Down
4 changes: 2 additions & 2 deletions core/chains/evm/client/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func NewChainClientWithTestNode(
}

lggr := logger.Test(t)
rpc := NewRPCClient(lggr, *parsed, rpcHTTPURL, "eth-primary-rpc-0", id, chainID, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "")
rpc := NewRPCClient(lggr, *parsed, rpcHTTPURL, "eth-primary-rpc-0", id, chainID, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)

n := commonclient.NewNode[*big.Int, *evmtypes.Head, RPCClient](
nodeCfg, clientMocks.ChainConfig{NoNewHeadsThresholdVal: noNewHeadsThreshold}, lggr, *parsed, rpcHTTPURL, "eth-primary-node-0", id, chainID, 1, rpc, "EVM")
Expand All @@ -155,7 +155,7 @@ func NewChainClientWithTestNode(
return nil, pkgerrors.Errorf("sendonly ethereum rpc url scheme must be http(s): %s", u.String())
}
var empty url.URL
rpc := NewRPCClient(lggr, empty, &sendonlyRPCURLs[i], fmt.Sprintf("eth-sendonly-rpc-%d", i), id, chainID, commonclient.Secondary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "")
rpc := NewRPCClient(lggr, empty, &sendonlyRPCURLs[i], fmt.Sprintf("eth-sendonly-rpc-%d", i), id, chainID, commonclient.Secondary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
s := commonclient.NewSendOnlyNode[*big.Int, RPCClient](
lggr, u, fmt.Sprintf("eth-sendonly-%d", i), chainID, rpc)
sendonlys = append(sendonlys, s)
Expand Down
46 changes: 33 additions & 13 deletions core/chains/evm/client/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ var (
float64(8 * time.Second),
},
}, []string{"evmChainID", "nodeName", "rpcHost", "isSendOnly", "success", "rpcCallName"})
errSubscribeFilterLogsNotAllowedWithoutWS = errors.New("SubscribeFilterLogs is not allowed without ws url")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we reusing these variables across multiple functions? If not, it might make sense to define them inline or make them public and use in tests

errWSAndHTTPBothMissing = errors.New("cannot dial rpc client when both ws and http info are missing")
errWSMissingWhenLogBroadcasterEnabled = errors.New("ws cannot be missing if LogBroadcaster is enabled")
)

// RPCClient includes all the necessary generalized RPC methods along with any additional chain-specific methods.
Expand Down Expand Up @@ -123,6 +126,7 @@ type rpcClient struct {
largePayloadRpcTimeout time.Duration
rpcTimeout time.Duration
finalizedBlockPollInterval time.Duration
logBroadcasterEnabled bool
chainType chaintype.ChainType

ws rawclient
Expand Down Expand Up @@ -162,6 +166,7 @@ func NewRPCClient(
largePayloadRpcTimeout time.Duration,
rpcTimeout time.Duration,
chainType chaintype.ChainType,
logBroadcasterEnabled bool,
) RPCClient {
r := &rpcClient{
largePayloadRpcTimeout: largePayloadRpcTimeout,
Expand All @@ -174,6 +179,7 @@ func NewRPCClient(
r.tier = tier
r.ws.uri = wsuri
r.finalizedBlockPollInterval = finalizedBlockPollInterval
r.logBroadcasterEnabled = logBroadcasterEnabled
if httpuri != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

RPC Client does not need to know about LogBroadcaster, this breaks abstraction

r.http = &rawclient{uri: *httpuri}
}
Expand All @@ -195,30 +201,41 @@ func (r *rpcClient) Dial(callerCtx context.Context) error {
ctx, cancel := r.makeQueryCtx(callerCtx, r.rpcTimeout)
defer cancel()

promEVMPoolRPCNodeDials.WithLabelValues(r.chainID.String(), r.name).Inc()
lggr := r.rpcLog.With("wsuri", r.ws.uri.Redacted())
if r.http != nil {
lggr = lggr.With("httpuri", r.http.uri.Redacted())
}
lggr.Debugw("RPC dial: evmclient.Client#dial")
if r.ws.uri.String() == "" {
if r.http == nil {
return errWSAndHTTPBothMissing
}

wsrpc, err := rpc.DialWebsocket(ctx, r.ws.uri.String(), "")
if err != nil {
promEVMPoolRPCNodeDialsFailed.WithLabelValues(r.chainID.String(), r.name).Inc()
return r.wrapRPCClientError(pkgerrors.Wrapf(err, "error while dialing websocket: %v", r.ws.uri.Redacted()))
if r.logBroadcasterEnabled {
return errWSMissingWhenLogBroadcasterEnabled
}
}

r.ws.rpc = wsrpc
r.ws.geth = ethclient.NewClient(wsrpc)
promEVMPoolRPCNodeDials.WithLabelValues(r.chainID.String(), r.name).Inc()
lggr := r.rpcLog
if r.ws.uri.String() != "" {
lggr = lggr.With("wsuri", r.ws.uri.Redacted())
wsrpc, err := rpc.DialWebsocket(ctx, r.ws.uri.String(), "")
if err != nil {
promEVMPoolRPCNodeDialsFailed.WithLabelValues(r.chainID.String(), r.name).Inc()
return r.wrapRPCClientError(pkgerrors.Wrapf(err, "error while dialing websocket: %v", r.ws.uri.Redacted()))
}

r.ws.rpc = wsrpc
r.ws.geth = ethclient.NewClient(wsrpc)
} else {
lggr = lggr.With("wsuri", "empty WS URI")
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is no need to include empty was URI into the log

}

if r.http != nil {
lggr = lggr.With("httpuri", r.http.uri.Redacted())
if err := r.DialHTTP(); err != nil {
return err
}
}

lggr.Debugw("RPC dial: evmclient.Client#dial")
promEVMPoolRPCNodeDialsSuccess.WithLabelValues(r.chainID.String(), r.name).Inc()

return nil
}

Expand Down Expand Up @@ -1215,6 +1232,9 @@ func (r *rpcClient) ClientVersion(ctx context.Context) (version string, err erro
}

func (r *rpcClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (_ ethereum.Subscription, err error) {
if r.ws.uri.String() == "" {
return nil, errSubscribeFilterLogsNotAllowedWithoutWS
}
ctx, cancel, chStopInFlight, ws, _ := r.acquireQueryCtx(ctx, r.rpcTimeout)
defer cancel()
lggr := r.newRqLggr().With("q", q)
Expand Down
55 changes: 44 additions & 11 deletions core/chains/evm/client/rpc_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,34 @@ func TestRPCClient_SubscribeNewHead(t *testing.T) {
}
return
}
t.Run("RPC client can't miss both WS and HTTP connection, if LogBroadcaster is disabled WS can be optional", func(t *testing.T) {
// ws and http cannot be both missing
emptyURL := url.URL{}
clientRPC := client.NewRPCClient(lggr, emptyURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
defer clientRPC.Close()
require.Error(t, clientRPC.Dial(ctx))

// ws provided, okay
server := testutils.NewWSServer(t, chainId, serverCallBack)
notEmptyURL := server.WSURL()
clientRPC = client.NewRPCClient(lggr, *notEmptyURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
require.Nil(t, clientRPC.Dial(ctx))

// ws not provided when LogBroadcaster is enabled, error
httpURL := url.URL{}
clientRPC = client.NewRPCClient(lggr, emptyURL, &httpURL, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
require.Error(t, clientRPC.Dial(ctx))

// ws not provided when LogBroadcaster is disabled, ok
clientRPC = client.NewRPCClient(lggr, emptyURL, &httpURL, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", false)
require.Nil(t, clientRPC.Dial(ctx))
})

t.Run("Updates chain info on new blocks", func(t *testing.T) {
server := testutils.NewWSServer(t, chainId, serverCallBack)
wsURL := server.WSURL()

rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "")
rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
defer rpc.Close()
require.NoError(t, rpc.Dial(ctx))
// set to default values
Expand Down Expand Up @@ -111,7 +134,7 @@ func TestRPCClient_SubscribeNewHead(t *testing.T) {
server := testutils.NewWSServer(t, chainId, serverCallBack)
wsURL := server.WSURL()

rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "")
rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
defer rpc.Close()
require.NoError(t, rpc.Dial(ctx))
ch := make(chan *evmtypes.Head)
Expand All @@ -136,7 +159,7 @@ func TestRPCClient_SubscribeNewHead(t *testing.T) {
server := testutils.NewWSServer(t, chainId, serverCallBack)
wsURL := server.WSURL()

rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "")
rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
defer rpc.Close()
require.NoError(t, rpc.Dial(ctx))
var wg sync.WaitGroup
Expand All @@ -160,7 +183,7 @@ func TestRPCClient_SubscribeNewHead(t *testing.T) {
t.Run("Block's chain ID matched configured", func(t *testing.T) {
server := testutils.NewWSServer(t, chainId, serverCallBack)
wsURL := server.WSURL()
rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "")
rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
defer rpc.Close()
require.NoError(t, rpc.Dial(ctx))
ch := make(chan *evmtypes.Head)
Expand All @@ -177,7 +200,7 @@ func TestRPCClient_SubscribeNewHead(t *testing.T) {
})
wsURL := server.WSURL()
observedLggr, observed := logger.TestObserved(t, zap.DebugLevel)
rpc := client.NewRPCClient(observedLggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "")
rpc := client.NewRPCClient(observedLggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
require.NoError(t, rpc.Dial(ctx))
server.Close()
_, err := rpc.SubscribeNewHead(ctx, make(chan *evmtypes.Head))
Expand All @@ -187,7 +210,7 @@ func TestRPCClient_SubscribeNewHead(t *testing.T) {
t.Run("Subscription error is properly wrapper", func(t *testing.T) {
server := testutils.NewWSServer(t, chainId, serverCallBack)
wsURL := server.WSURL()
rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "")
rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
defer rpc.Close()
require.NoError(t, rpc.Dial(ctx))
sub, err := rpc.SubscribeNewHead(ctx, make(chan *evmtypes.Head))
Expand All @@ -209,13 +232,23 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) {
lggr := logger.Test(t)
ctx, cancel := context.WithTimeout(tests.Context(t), tests.WaitTimeout(t))
defer cancel()
t.Run("Failed SubscribeFilterLogs when WSURL is empty", func(t *testing.T) {
// ws is optional when LogBroadcaster is disabled, however SubscribeFilterLogs will return error if ws is missing
httpURL := url.URL{}
observedLggr, _ := logger.TestObserved(t, zap.DebugLevel)
rpcClient := client.NewRPCClient(observedLggr, url.URL{}, &httpURL, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", false)
require.Nil(t, rpcClient.Dial(ctx))

_, err := rpcClient.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log))
require.Error(t, err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you ensure that we return proper error msg?

})
t.Run("Failed SubscribeFilterLogs logs and returns proper error", func(t *testing.T) {
server := testutils.NewWSServer(t, chainId, func(reqMethod string, reqParams gjson.Result) (resp testutils.JSONRPCResponse) {
return resp
})
wsURL := server.WSURL()
observedLggr, observed := logger.TestObserved(t, zap.DebugLevel)
rpc := client.NewRPCClient(observedLggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "")
rpc := client.NewRPCClient(observedLggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
require.NoError(t, rpc.Dial(ctx))
server.Close()
_, err := rpc.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log))
Expand All @@ -232,7 +265,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) {
return resp
})
wsURL := server.WSURL()
rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "")
rpc := client.NewRPCClient(lggr, *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
defer rpc.Close()
require.NoError(t, rpc.Dial(ctx))
sub, err := rpc.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log))
Expand Down Expand Up @@ -281,7 +314,7 @@ func TestRPCClient_LatestFinalizedBlock(t *testing.T) {
}

server := createRPCServer()
rpc := client.NewRPCClient(lggr, *server.URL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "")
rpc := client.NewRPCClient(lggr, *server.URL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, "", true)
require.NoError(t, rpc.Dial(ctx))
defer rpc.Close()
server.Head = &evmtypes.Head{Number: 128}
Expand Down Expand Up @@ -391,7 +424,7 @@ func TestRpcClientLargePayloadTimeout(t *testing.T) {
// use something unreasonably large for RPC timeout to ensure that we use largePayloadRPCTimeout
const rpcTimeout = time.Hour
const largePayloadRPCTimeout = tests.TestInterval
rpc := client.NewRPCClient(logger.Test(t), *rpcURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, largePayloadRPCTimeout, rpcTimeout, "")
rpc := client.NewRPCClient(logger.Test(t), *rpcURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, largePayloadRPCTimeout, rpcTimeout, "", true)
require.NoError(t, rpc.Dial(ctx))
defer rpc.Close()
err := testCase.Fn(ctx, rpc)
Expand Down Expand Up @@ -431,7 +464,7 @@ func TestAstarCustomFinality(t *testing.T) {

const expectedFinalizedBlockNumber = int64(4)
const expectedFinalizedBlockHash = "0x7441e97acf83f555e0deefef86db636bc8a37eb84747603412884e4df4d22804"
rpcClient := client.NewRPCClient(logger.Test(t), *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainAstar)
rpcClient := client.NewRPCClient(logger.Test(t), *wsURL, nil, "rpc", 1, chainId, commonclient.Primary, 0, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainAstar, true)
defer rpcClient.Close()
err := rpcClient.Dial(tests.Context(t))
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion core/config/docs/chains-evm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ ObservationGracePeriod = '1s' # Default
[[EVM.Nodes]]
# Name is a unique (per-chain) identifier for this node.
Name = 'foo' # Example
# WSURL is the WS(S) endpoint for this node. Required for primary nodes.
# WSURL is the WS(S) endpoint for this node. Can be empty string when `LogBroadcasterEnabled` is `false`
WSURL = 'wss://web.socket/test' # Example
# HTTPURL is the HTTP(S) endpoint for this node. Required for all nodes.
HTTPURL = 'https://foo.web' # Example
Expand Down
2 changes: 1 addition & 1 deletion docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9137,7 +9137,7 @@ Name is a unique (per-chain) identifier for this node.
```toml
WSURL = 'wss://web.socket/test' # Example
```
WSURL is the WS(S) endpoint for this node. Required for primary nodes.
WSURL is the WS(S) endpoint for this node. Can be empty string when `LogBroadcasterEnabled` is `false`

### HTTPURL
```toml
Expand Down
Loading