Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
Browse files Browse the repository at this point in the history
…fixCCIPChaos
  • Loading branch information
kalverra committed Oct 17, 2024
2 parents 929f5f3 + 2111c5e commit 5df190c
Show file tree
Hide file tree
Showing 104 changed files with 1,814 additions and 20,370 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-rats-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Fix testWSServer issue causing panic in testing #internal
3 changes: 3 additions & 0 deletions .github/actions/goreleaser-build-sign-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ inputs:
runs:
using: composite
steps:
- # We need QEMU to test the cross architecture builds after they're built.
name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Setup docker buildx
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0
- name: Setup go
Expand Down
58 changes: 42 additions & 16 deletions .github/actions/goreleaser-build-sign-publish/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,23 @@ function main() {
);
}

const artifactsJsonPath = findArtifactsJson();
const dockerImages = extractDockerImages(artifactsJsonPath);
const artifacts = getArtifacts();
const dockerImages = extractDockerImages(artifacts);
const repoSha = execSync("git rev-parse HEAD", { encoding: "utf-8" }).trim();

const results = dockerImages.map((image) => {
try {
console.log(`Checking version for image: ${image}, expected version: ${chainlinkVersion}, expected SHA: ${repoSha}`);
console.log(
`Checking version for image: ${image}, expected version: ${chainlinkVersion}, expected SHA: ${repoSha}`
);
const versionOutput = execSync(`docker run --rm ${image} --version`, {
encoding: "utf-8",
});
console.log(`Output from image ${image}: ${versionOutput}`);

const cleanedOutput = versionOutput.replace("chainlink version ", "").trim();
const cleanedOutput = versionOutput
.replace("chainlink version ", "")
.trim();
const [version, sha] = cleanedOutput.split("@");
if (!version || !sha) {
throw new Error("Version or SHA not found in output.");
Expand Down Expand Up @@ -94,7 +98,7 @@ function printSummary(results) {
}
}

function findArtifactsJson() {
function getArtifacts() {
const distDir = path.resolve(process.cwd(), "dist");
const files = [];

Expand All @@ -103,8 +107,17 @@ function findArtifactsJson() {
for (const item of items) {
const fullPath = path.join(dir, item.name);
if (item.isDirectory()) {
findJsonFiles(fullPath);
// Skip child directories if an artifacts.json exists in the current directory
const parentArtifacts = path.join(dir, "artifacts.json");
if (fs.existsSync(parentArtifacts)) {
console.log(
`Skipping child directory: ${fullPath} because a parent artifacts.json exists at: ${parentArtifacts}`
);
} else {
findJsonFiles(fullPath);
}
} else if (item.isFile() && item.name === "artifacts.json") {
console.log(`Found artifacts.json at: ${fullPath}`);
files.push(fullPath);
}
}
Expand All @@ -115,20 +128,33 @@ function findArtifactsJson() {
if (files.length === 0) {
console.error("Error: No artifacts.json found in /dist.");
process.exit(1);
} else if (files.length > 1) {
console.error("Error: Multiple artifacts.json files found.");
process.exit(1);
}

return files[0];
}
// Merge all artifacts.json files into one
let mergedArtifacts = [];

function extractDockerImages(artifactsJsonPath) {
console.log(`Reading artifacts.json from: ${artifactsJsonPath}`);
const artifactsJson = JSON.parse(fs.readFileSync(artifactsJsonPath, "utf-8"));
for (const file of files) {
const artifactsJson = JSON.parse(fs.readFileSync(file, "utf-8"));
mergedArtifacts = mergedArtifacts.concat(artifactsJson);
}

// Remove duplicate Docker images based on the artifact name
const uniqueArtifacts = Array.from(
new Map(
mergedArtifacts.map((artifact) => [artifact.name, artifact])
).values()
);

return uniqueArtifacts;
}

const dockerImages = artifactsJson
.filter((artifact) => artifact.type === "Docker Image")
function extractDockerImages(artifacts) {
const dockerImages = artifacts
.filter(
(artifact) =>
artifact.type === "Docker Image" ||
artifact.type === "Published Docker Image"
)
.map((artifact) => artifact.name);

if (dockerImages.length === 0) {
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/build-publish-develop-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ name: "Build and Publish GoReleaser"

on:
pull_request:
# The default types are opened, synchronize, and reopened
# See https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
# We add a label trigger too, since when the build-publish label is added to a PR, we want to build and publish
types:
- opened
- synchronize
- reopened
- labeled
push:
branches:
- develop
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/crib-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
echo $GITHUB_WORKSPACE
- name: Deploy and validate CRIB Environment for Core
uses: smartcontractkit/.github/actions/crib-deploy-environment@fa63a0fb95039c4d89fec6a9a78b53c0cacf5457 # crib-deploy-environment@2.0.0
uses: smartcontractkit/.github/actions/crib-deploy-environment@a4058228b4b9b6e30bb0e2b883e3b4f0cd447970 # crib-deploy-environment@2.1.0
id: deploy-crib
with:
github-token: ${{ steps.token.outputs.access-token }}
Expand Down
7 changes: 0 additions & 7 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -369,13 +369,6 @@ packages:
outpkg: mock_contracts
interfaces:
EVM2EVMOffRampInterface:
github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_offramp_1_0_0:
config:
dir: core/gethwrappers/ccip/mocks/v1_0_0/
filename: evm2_evm_off_ramp_interface.go
outpkg: mock_contracts
interfaces:
EVM2EVMOffRampInterface:
github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store:
config:
dir: core/gethwrappers/ccip/mocks/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import (

"github.com/smartcontractkit/chainlink-ccip/chainconfig"
ccipreader "github.com/smartcontractkit/chainlink-ccip/pkg/reader"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"

"github.com/stretchr/testify/require"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (

"github.com/smartcontractkit/chainlink-ccip/pkg/contractreader"
"github.com/smartcontractkit/chainlink-ccip/pkg/reader"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
"github.com/smartcontractkit/chainlink-ccip/pluginconfig"
"github.com/smartcontractkit/chainlink-common/pkg/types"
cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"

evmconfig "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/client"
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/ccipevm/commitcodec.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/smartcontractkit/libocr/offchainreporting2plus/types"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_encoding_utils"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers"
Expand Down
5 changes: 3 additions & 2 deletions core/capabilities/ccip/ccipevm/commitcodec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import (
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/smartcontractkit/libocr/offchainreporting2plus/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
"github.com/smartcontractkit/libocr/offchainreporting2plus/types"

cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
)
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/ccipevm/executecodec.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers"
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/ccipevm/executecodec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/core"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"

"github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils"
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/ccipevm/gas_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ccipevm
import (
"math"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/ccipevm/gas_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/assert"

"github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
"github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
)

func Test_calculateMessageMaxGas(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions core/capabilities/ccip/ccipevm/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"math/rand"
"testing"

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/message_hasher"

"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/message_hasher"
)

func Test_decodeExtraArgs(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/ccipevm/msghasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"

"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/ccipevm/msghasher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/ethereum/go-ethereum/core"
"github.com/stretchr/testify/require"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/message_hasher"
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/ccipevm/rmncrypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
)

// encodingUtilsAbi is the ABI for the EncodingUtils contract.
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/ccipevm/rmncrypto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/ethereum/go-ethereum/common"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"

"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/ccipevm/tokendata.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ccipevm
import (
"context"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"

"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers"
)
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/ccipevm/tokendata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/stretchr/testify/require"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"

"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers"
Expand Down
5 changes: 3 additions & 2 deletions core/capabilities/ccip/delegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
"strconv"
"time"

"github.com/smartcontractkit/chainlink-common/pkg/loop"
"golang.org/x/exp/maps"

"github.com/smartcontractkit/chainlink-common/pkg/loop"

"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"
configsevm "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm"
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/launcher"
Expand All @@ -27,10 +28,10 @@ import (

"github.com/smartcontractkit/chainlink-ccip/pkg/consts"
ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"

chainsel "github.com/smartcontractkit/chain-selectors"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"

"github.com/smartcontractkit/chainlink/v2/core/config"
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/launcher/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"github.com/smartcontractkit/chainlink-ccip/chainconfig"
cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
it "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccip_integration_tests/integrationhelpers"
cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest"
Expand Down
3 changes: 2 additions & 1 deletion core/capabilities/ccip/oraclecreator/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/google/uuid"
"github.com/prometheus/client_golang/prometheus"

chainsel "github.com/smartcontractkit/chain-selectors"
"github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper"

Expand All @@ -28,13 +29,13 @@ import (
ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types"

"github.com/smartcontractkit/chainlink-common/pkg/loop"
cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"

commitocr3 "github.com/smartcontractkit/chainlink-ccip/commit"
"github.com/smartcontractkit/chainlink-ccip/commit/merkleroot/rmn"
execocr3 "github.com/smartcontractkit/chainlink-ccip/execute"
"github.com/smartcontractkit/chainlink-ccip/pkg/consts"
ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
"github.com/smartcontractkit/chainlink-ccip/pluginconfig"

"github.com/smartcontractkit/chainlink-common/pkg/types"
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/ccip/types/mocks/home_chain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"

"github.com/smartcontractkit/libocr/ragep2p/types"
)
Expand Down
Loading

0 comments on commit 5df190c

Please sign in to comment.