Skip to content

Commit

Permalink
Merge develop and resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
b-gopalswami committed Nov 20, 2024
2 parents a3a95f5 + 2ea3aef commit cd7a8de
Show file tree
Hide file tree
Showing 109 changed files with 1,531 additions and 1,388 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-foxes-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

#removed Remove unused ocr1 key files.
1 change: 1 addition & 0 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ runs:
with:
go-version-file: ${{ inputs.go-version-file }}
cache: false
check-latest: true

- name: Get branch name
if: ${{ inputs.only-modules == 'false' }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/find-new-flaky-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ jobs:
- name: Set up Go 1.21.9
uses: actions/setup-go@v5.0.2
with:
go-version: '1.21.9'
cache: false

- name: Install flakeguard
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
- name: Lint Go
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
with:
version: v1.59.1
version: v1.62.0
# We already cache these directories in setup-go
skip-pkg-cache: true
skip-build-cache: true
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
golang 1.22.8
golang 1.23.3
mockery 2.46.3
nodejs 20.13.1
pnpm 9.4.0
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/compute/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
)

const (
CapabilityIDCompute = "custom_compute@1.0.0"
CapabilityIDCompute = "custom-compute@1.0.0"

binaryKey = "binary"
configKey = "config"
Expand Down
3 changes: 2 additions & 1 deletion core/capabilities/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@ func (w *launcher) exposeCapabilities(ctx context.Context, myPeerID p2ptypes.Pee

err = w.addReceiver(ctx, capability, don, newActionServer)
if err != nil {
return fmt.Errorf("failed to add action server-side receiver: %w", err)
w.lggr.Errorw("failed to add action server-side receiver - it won't be exposed remotely", "id", cid, "error", err)
// continue attempting other capabilities
}
case capabilities.CapabilityTypeConsensus:
w.lggr.Warn("no remote client configured for capability type consensus, skipping configuration")
Expand Down
4 changes: 2 additions & 2 deletions core/chainlink.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build image: Chainlink binary
FROM golang:1.22-bullseye as buildgo
FROM golang:1.23-bullseye as buildgo
RUN go version
WORKDIR /chainlink

Expand Down Expand Up @@ -31,7 +31,7 @@ RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-feeds | xargs
RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-solana | xargs -I % ln -s % /chainlink-solana

# Build image: Plugins
FROM golang:1.22-bullseye as buildplugins
FROM golang:1.23-bullseye as buildplugins
RUN go version

WORKDIR /chainlink-feeds
Expand Down
1 change: 1 addition & 0 deletions core/cmd/admin_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ func (s *Shell) Profile(c *cli.Context) error {
}
respContent := string(b)
// taken from pprof.Profile https://github.com/golang/go/blob/release-branch.go1.20/src/net/http/pprof/pprof.go#L133
// note: no longer triggers as of 1.23
if strings.Contains(respContent, "profile duration exceeds server's WriteTimeout") {
errs <- fmt.Errorf("%w: %s", ErrProfileTooLong, respContent)
} else {
Expand Down
2 changes: 1 addition & 1 deletion core/cmd/shell_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ func (s *Shell) runNode(c *cli.Context) error {
}
}

if s.Config.Capabilities().Peering().Enabled() {
if s.Config.Capabilities().WorkflowRegistry().Address() != "" {
err2 := app.GetKeyStore().Workflow().EnsureKey(rootCtx)
if err2 != nil {
return errors.Wrap(err2, "failed to ensure workflow key")
Expand Down
30 changes: 0 additions & 30 deletions core/cmd/shell_remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,36 +463,6 @@ func TestShell_ChangePassword(t *testing.T) {
require.Contains(t, err.Error(), "Unauthorized")
}

func TestShell_Profile_InvalidSecondsParam(t *testing.T) {
t.Parallel()

app := startNewApplicationV2(t, nil)
u := cltest.NewUserWithSession(t, app.AuthenticationProvider())
enteredStrings := []string{u.Email, cltest.Password}
prompter := &cltest.MockCountingPrompter{T: t, EnteredStrings: enteredStrings}

client := app.NewAuthenticatingShell(prompter)

set := flag.NewFlagSet("test", 0)
flagSetApplyFromAction(client.RemoteLogin, set, "")

require.NoError(t, set.Set("file", "../internal/fixtures/apicredentials"))
require.NoError(t, set.Set("bypass-version-check", "true"))

c := cli.NewContext(nil, set, nil)
err := client.RemoteLogin(c)
require.NoError(t, err)

// pick a value larger than the default http service write timeout
d := app.Config.WebServer().HTTPWriteTimeout() + 2*time.Second
set.Uint("seconds", uint(d.Seconds()), "")
tDir := t.TempDir()
set.String("output_dir", tDir, "")
err = client.Profile(cli.NewContext(nil, set, nil))
wantErr := cmd.ErrProfileTooLong
require.ErrorAs(t, err, &wantErr)
}

func TestShell_Profile(t *testing.T) {
t.Parallel()

Expand Down
8 changes: 8 additions & 0 deletions core/config/capabilities_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ type CapabilitiesExternalRegistry interface {
RelayID() types.RelayID
}

type CapabilitiesWorkflowRegistry interface {
Address() string
NetworkID() string
ChainID() string
RelayID() types.RelayID
}

type GatewayConnector interface {
ChainIDForNodeKey() string
NodeAddress() string
Expand All @@ -30,5 +37,6 @@ type Capabilities interface {
Peering() P2P
Dispatcher() Dispatcher
ExternalRegistry() CapabilitiesExternalRegistry
WorkflowRegistry() CapabilitiesWorkflowRegistry
GatewayConnector() GatewayConnector
}
8 changes: 8 additions & 0 deletions core/config/docs/core.toml
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,14 @@ 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.WorkflowRegistry]
# Address is the address for the workflow registry contract.
Address = '0x0' # Example
# NetworkID identifies the target network where the remote registry is located.
NetworkID = 'evm' # Default
# ChainID identifies the target chain id where the remote registry is located.
ChainID = '1' # Default

[Capabilities.ExternalRegistry]
# Address is the address for the capabilities registry contract.
Address = '0x0' # Example
Expand Down
22 changes: 22 additions & 0 deletions core/config/toml/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,26 @@ func (r *ExternalRegistry) setFrom(f *ExternalRegistry) {
}
}

type WorkflowRegistry struct {
Address *string
NetworkID *string
ChainID *string
}

func (r *WorkflowRegistry) setFrom(f *WorkflowRegistry) {
if f.Address != nil {
r.Address = f.Address
}

if f.NetworkID != nil {
r.NetworkID = f.NetworkID
}

if f.ChainID != nil {
r.ChainID = f.ChainID
}
}

type Dispatcher struct {
SupportedVersion *int
ReceiverBufferSize *int
Expand Down Expand Up @@ -1541,12 +1561,14 @@ type Capabilities struct {
Peering P2P `toml:",omitempty"`
Dispatcher Dispatcher `toml:",omitempty"`
ExternalRegistry ExternalRegistry `toml:",omitempty"`
WorkflowRegistry WorkflowRegistry `toml:",omitempty"`
GatewayConnector GatewayConnector `toml:",omitempty"`
}

func (c *Capabilities) setFrom(f *Capabilities) {
c.Peering.setFrom(&f.Peering)
c.ExternalRegistry.setFrom(&f.ExternalRegistry)
c.WorkflowRegistry.setFrom(&f.WorkflowRegistry)
c.Dispatcher.setFrom(&f.Dispatcher)
c.GatewayConnector.setFrom(&f.GatewayConnector)
}
Expand Down
16 changes: 15 additions & 1 deletion core/platform/monitoring.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package platform

import (
"iter"
"slices"
)

// Observability keys
const (
KeyCapabilityID = "capabilityID"
Expand All @@ -12,4 +17,13 @@ const (
KeyStepRef = "stepRef"
)

var OrderedLabelKeys = []string{KeyStepRef, KeyStepID, KeyTriggerID, KeyCapabilityID, KeyWorkflowExecutionID, KeyWorkflowID}
func LabelKeysSorted() iter.Seq[string] {
return slices.Values([]string{
KeyStepRef,
KeyStepID,
KeyTriggerID,
KeyCapabilityID,
KeyWorkflowExecutionID,
KeyWorkflowID,
})
}
4 changes: 2 additions & 2 deletions core/scripts/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink/core/scripts

go 1.22.8
go 1.23

// Make sure we're working with the latest chainlink libs
replace github.com/smartcontractkit/chainlink/v2 => ../../
Expand All @@ -24,7 +24,7 @@ require (
github.com/prometheus/client_golang v1.20.5
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241120111740-a6a70ec7692b
github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241106193309-5560cd76211a
github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1094,8 +1094,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB
github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec h1:5vS1k8Qn09p8SQ3JzvS8iy4Pve7s3aVq+UPIdl74smY=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068 h1:2llRW4Tn9W/EZp2XvXclQ9IjeTBwwxVPrrqaerX+vCE=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241120111740-a6a70ec7692b h1:mm46AlaafEhvGjJvuAb0VoLLM3NKAVnwKZ+iUCNL/sg=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241120111740-a6a70ec7692b/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo=
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 h1:1BMTG66HnCIz+KMBWGvyzELNM6VHGwv2WKFhN7H49Sg=
Expand Down
26 changes: 26 additions & 0 deletions core/services/chainlink/config_capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ func (c *capabilitiesConfig) ExternalRegistry() config.CapabilitiesExternalRegis
}
}

func (c *capabilitiesConfig) WorkflowRegistry() config.CapabilitiesWorkflowRegistry {
return &capabilitiesWorkflowRegistry{
c: c.c.WorkflowRegistry,
}
}

func (c *capabilitiesConfig) Dispatcher() config.Dispatcher {
return &dispatcher{d: c.c.Dispatcher}
}
Expand Down Expand Up @@ -88,6 +94,26 @@ func (c *capabilitiesExternalRegistry) Address() string {
return *c.c.Address
}

type capabilitiesWorkflowRegistry struct {
c toml.WorkflowRegistry
}

func (c *capabilitiesWorkflowRegistry) RelayID() types.RelayID {
return types.NewRelayID(c.NetworkID(), c.ChainID())
}

func (c *capabilitiesWorkflowRegistry) NetworkID() string {
return *c.c.NetworkID
}

func (c *capabilitiesWorkflowRegistry) ChainID() string {
return *c.c.ChainID
}

func (c *capabilitiesWorkflowRegistry) Address() string {
return *c.c.Address
}

type gatewayConnector struct {
c toml.GatewayConnector
}
Expand Down
5 changes: 5 additions & 0 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,11 @@ func TestConfig_Marshal(t *testing.T) {
ChainID: ptr("1"),
NetworkID: ptr("evm"),
},
WorkflowRegistry: toml.WorkflowRegistry{
Address: ptr(""),
ChainID: ptr("1"),
NetworkID: ptr("evm"),
},
Dispatcher: toml.Dispatcher{
SupportedVersion: ptr(1),
ReceiverBufferSize: ptr(10000),
Expand Down
5 changes: 5 additions & 0 deletions core/services/chainlink/testdata/config-empty-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ Address = ''
NetworkID = 'evm'
ChainID = '1'

[Capabilities.WorkflowRegistry]
Address = ''
NetworkID = 'evm'
ChainID = '1'

[Capabilities.GatewayConnector]
ChainIDForNodeKey = ''
NodeAddress = ''
Expand Down
5 changes: 5 additions & 0 deletions core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ Address = ''
NetworkID = 'evm'
ChainID = '1'

[Capabilities.WorkflowRegistry]
Address = ''
NetworkID = 'evm'
ChainID = '1'

[Capabilities.GatewayConnector]
ChainIDForNodeKey = '11155111'
NodeAddress = '0x68902d681c28119f9b2531473a417088bf008e59'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ Address = ''
NetworkID = 'evm'
ChainID = '1'

[Capabilities.WorkflowRegistry]
Address = ''
NetworkID = 'evm'
ChainID = '1'

[Capabilities.GatewayConnector]
ChainIDForNodeKey = ''
NodeAddress = ''
Expand Down
Loading

0 comments on commit cd7a8de

Please sign in to comment.