Skip to content

Commit

Permalink
Merge branch 'nonevm-984-reorg' into nonevm-984-reorg-soak
Browse files Browse the repository at this point in the history
  • Loading branch information
Farber98 committed Dec 23, 2024
2 parents 3e014d7 + da1ee68 commit 84de493
Show file tree
Hide file tree
Showing 83 changed files with 5,696 additions and 848 deletions.
1 change: 1 addition & 0 deletions .github/workflows/e2e_custom_cl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,5 @@ jobs:
env:
E2E_TEST_CHAINLINK_IMAGE: ${{ env.CL_ECR }}
E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret
CHAINLINK_USER_TEAM: ${{ github.event.inputs.team || 'BIX' }}

54 changes: 54 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,57 @@ jobs:
cd /repo/contracts &&\
cargo check &&\
cargo clippy -- -D warnings"
relay_run_interface_tests:
name: Relay Run Interface Tests
runs-on: ubuntu-latest-8cores-32GB
needs: [get_projectserum_version, build_wrapped_anchor_image]
steps:
- name: Checkout sources
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5

- name: Cache cargo target dir
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: contracts/target
key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: cache docker build image
id: cache-image
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
fail-on-cache-miss: true
path: contracts/docker-build.tar
key: ${{ runner.os }}-docker-pnpm-build-${{ needs.get_projectserum_version.outputs.projectserum_version }}-${{ hashFiles('**/Cargo.lock') }}

- name: load cached image
run: |
docker load --input docker-build.tar
- name: Setup go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: "./integration-tests/go.mod"
check-latest: true
cache-dependency-path: "./integration-tests/go.sum"

- name: Install gotestloghelper
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/gotestloghelper@latest

- name: Install Solana CLI
run: ../scripts/install-solana-ci.sh

- name: Test Relay Interfaces
run: |
set -eoux pipefail
# compile artifacts
solana-keygen new -o id.json --no-bip39-passphrase
docker run -v "$(pwd)/../":/repo chainlink-solana:build bash -c "\
set -eoux pipefail &&\
RUSTUP_HOME=\"/root/.rustup\" &&\
FORCE_COLOR=1 &&\
cd /repo/contracts &&\
anchor build"
cd ..
make test_relay_integration
12 changes: 8 additions & 4 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# 12/26 - @njegosrailic: I reviewed the codeowners file and confirmed all the teams are appropriate.

# CODEOWNERS Best Practices
# 1. Per Github docs: "Order is important; the last matching pattern takes the most precedence."
# Please define less specific codeowner paths before more specific codeowner paths in order for the more specific rule to have priority
# The following doc explains the CODEOWNERS file syntax:
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-syntax

# global ownership
* @smartcontractkit/bix-build
Expand All @@ -11,11 +15,11 @@
# gauntlet ownership
/gauntlet @smartcontractkit/devx @smartcontractkit/bix-build

# relayer ownership
/pkg @smartcontractkit/bix-build

# monitoring ownership
/pkg/monitoring @smartcontractkit/realtime

# LOOP Plugin commands
/pkg/solana/cmd/chainlink-solana @smartcontractkit/foundations @smartcontractkit/bix-build

# CI/CD
/.github/** @smartcontractkit/releng
/.github/** @smartcontractkit/releng @smartcontractkit/bix-build
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ test_relay_unit:

test_smoke:
cd ./integration-tests &&\
SELECTED_NETWORKS=SIMULATED go test -timeout 24h -count=1 -json $(args) -run TestSolanaOCRV2Smoke ./smoke 2>&1 | tee /tmp/gotest.log | gotestloghelper -json -tlogprefix -singlepackage -color
SELECTED_NETWORKS=SIMULATED go test -timeout 1h -count=1 -json $(args) -run TestSolanaOCRV2Smoke ./smoke 2>&1 | tee /tmp/gotest.log | gotestloghelper -json -tlogprefix -singlepackage -color

test_relay_integration:
cd ./integration-tests &&\
go test -timeout 20m -count=1 -json $(args) ./relayinterface/... 2>&1 | tee /tmp/gotest.log | gotestloghelper -json -tlogprefix -singlepackage -color

.PHONY: gomods
gomods: ## Install gomods
Expand Down
1 change: 1 addition & 0 deletions contracts/Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ test = "pnpm run test"

[programs.localnet]
access_controller = "9xi644bRR8birboDGdTiwBq3C7VEeR7VuamRYYXCubUW"
contract-reader-interface = "6AfuXF6HapDUhQfE4nQG9C1SGtA1YjP3icaJyRfU4RyE"
log-read-test = "J1zQwrBNBngz26jRPNWsUSZMHJwBwpkoDitXRV95LdK4"
ocr_2 = "cjg3oHmg9uuPsP8D6g29NWvhySJkdYdAo9D25PRbKXJ" # need to rename the idl to satisfy anchor.js...
store = "HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny"
22 changes: 19 additions & 3 deletions contracts/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/crates/arrayvec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "arrayvec"
version = "1.0.0"
version = "1.0.1"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
43 changes: 43 additions & 0 deletions contracts/crates/arrayvec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ macro_rules! arrayvec {
self.xs[offset..offset + len].copy_from_slice(&data);
self.len += len as $capacity_ty;
}

/// Removes the last element from the array and returns it.
/// Returns `None` if the array is empty.
pub fn pop(&mut self) -> Option<$ty> {
if self.len > 0 {
self.len -= 1;
Some(self.xs[self.len as usize])
} else {
None
}
}
}

impl std::ops::Deref for $name {
Expand Down Expand Up @@ -126,6 +137,38 @@ mod tests {
}
arrayvec!(ArrayVec, u8, u32);

#[test]
fn push_pop() {
let mut vec = ArrayVec::new();
assert!(vec.is_empty());
assert_eq!(vec.pop(), None);

vec.push(10);
assert_eq!(vec.len(), 1);
assert_eq!(vec.as_slice(), &[10]);

vec.push(20);
vec.push(30);
assert_eq!(vec.len(), 3);
assert_eq!(vec.as_slice(), &[10, 20, 30]);

// Popping elements
assert_eq!(vec.pop(), Some(30));
assert_eq!(vec.len(), 2);
assert_eq!(vec.as_slice(), &[10, 20]);

assert_eq!(vec.pop(), Some(20));
assert_eq!(vec.len(), 1);
assert_eq!(vec.as_slice(), &[10]);

assert_eq!(vec.pop(), Some(10));
assert_eq!(vec.len(), 0);
assert!(vec.is_empty());

// Popping from empty vec
assert_eq!(vec.pop(), None);
}

#[test]
fn remove() {
let mut vec = ArrayVec::new();
Expand Down
25 changes: 25 additions & 0 deletions contracts/crates/chainlink-solana-data-streams/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "chainlink_solana_data_streams"
description = "Chainlink Data Streams Uility for Solana. Can be used on-chain/off-chain to get `verify` transaction instructions."
version = "1.0.0"
edition = "2018"
license = "MIT"

[lib]
crate-type = ["cdylib", "lib"]
name = "chainlink_solana_data_streams"

[features]
default = []

[dependencies]
borsh = "0.10.3"

[target.'cfg(target_os = "solana")'.dependencies]
solana-program = "1.17"

[target.'cfg(not(target_os = "solana"))'.dependencies]
solana-sdk = "1.17"

[dev-dependencies]
solana-sdk = "1.17"
21 changes: 21 additions & 0 deletions contracts/crates/chainlink-solana-data-streams/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 SmartContract ChainLink, Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
3 changes: 3 additions & 0 deletions contracts/crates/chainlink-solana-data-streams/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# chainlink-solana-data-streams

This tool is provided under an MIT license and is for convenience and illustration purposes only.
Loading

0 comments on commit 84de493

Please sign in to comment.