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
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
golang 1.24.1
3 changes: 2 additions & 1 deletion multinode/send_only_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net/url"
"strconv"
"sync"

"github.com/smartcontractkit/chainlink-common/pkg/logger"
Expand Down Expand Up @@ -111,7 +112,7 @@ func (s *sendOnlyNode[CHAIN_ID, RPC]) start() {
}
s.setState(nodeStateDialed)

if s.chainID.String() == "0" {
if s.chainID.String() == strconv.Itoa(NullClientChainID) {
// Skip verification if chainID is zero
s.log.Warn("sendonly rpc ChainID verification skipped")
} else {
Expand Down
4 changes: 2 additions & 2 deletions multinode/send_only_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ func TestStartSendOnlyNode(t *testing.T) {
tests.AssertEventually(t, func() bool { return s.State() == nodeStateUnusable })
tests.RequireLogMessage(t, observedLogs, "Dial failed: SendOnly Node is unusable")
})
t.Run("Default ChainID(0) produces warn and skips checks", func(t *testing.T) {
t.Run("Default ChainID(1399100) produces warn and skips checks", func(t *testing.T) {
t.Parallel()
lggr, observedLogs := logger.TestObserved(t, zap.WarnLevel)
client := newMockSendOnlyClient[ID](t)
client.On("Close").Once()
client.On("Dial", mock.Anything).Return(nil).Once()
s := NewSendOnlyNode(lggr, makeMockNodeMetrics(t), url.URL{}, t.Name(), NewIDFromInt(0), client)
s := NewSendOnlyNode(lggr, makeMockNodeMetrics(t), url.URL{}, t.Name(), NewIDFromInt(1399100), client)

defer func() { assert.NoError(t, s.Close()) }()
err := s.Start(tests.Context(t))
Expand Down
2 changes: 2 additions & 0 deletions multinode/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/jpillora/backoff"
)

const NullClientChainID = 1399100
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where did this value come from?


func RandomID() ID {
// #nosec G404
id := rand.Int63n(math.MaxInt32) + 10000
Expand Down
Loading