Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/solana-ccm-checker' into fe…
Browse files Browse the repository at this point in the history
…at/solana-call-length

* origin/feat/solana-ccm-checker: (27 commits)
  Minor changes
  chore: dont run upgrade
  chore: split message and cfParameters
  chore: remove logging
  chore: set minimum to 10 bytes
  chore: add logs
  feat: solana add two more nonces (#5089)
  chore: run upgrade test
  chore: update Solana programs to 0.6 and update initialization (#5078)
  chore: rename DerivedAta to PdaAndBump (#5074)
  fix: revert storage version
  chore: fix test and actually push encoding change
  chore: update bytes limits and use same encoding as solana SDK
  chore: fix bouncer bug
  fix: 3-node localnet in CI 🥽 (#5085)
  feat: exclude validators with negative rep from auction (#5062)
  Revert "chore: re-enable rust cache in CI 🦀💰 (#5072)" (#5077)
  chore: fix imports (#5075)
  chore: bump `main` to `1.6.0` 👆 (#5081)
  chore: re-enable rust cache in CI 🦀💰 (#5072)
  ...

# Conflicts:
#	state-chain/chains/src/ccm_checker.rs
#	state-chain/chains/src/sol/instruction_builder.rs
  • Loading branch information
syan095 committed Aug 1, 2024
2 parents 23b0c11 + 3e93fc9 commit f162f00
Show file tree
Hide file tree
Showing 74 changed files with 1,628 additions and 441 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
CF_ETH_CONTRACT_ABI_ROOT = { value = "contract-interfaces/eth-contract-abis", relative = true }
CF_ETH_CONTRACT_ABI_TAG = "v1.1.2"
CF_SOL_PROGRAM_IDL_ROOT = { value = "contract-interfaces/sol-program-idls", relative = true }
CF_SOL_PROGRAM_IDL_TAG = "v0.5.0"
CF_SOL_PROGRAM_IDL_TAG = "v0.6.0"
CF_ARB_CONTRACT_ABI_ROOT = { value = "contract-interfaces/arb-contract-abis", relative = true }
CF_TEST_CONFIG_ROOT = { value = "engine/config/testing", relative = true }

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/_20_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ jobs:
./target/${{ inputs.binary-subdir }}/libchainflip_engine_v*.so
./target/${{ inputs.binary-subdir }}/engine-runner
- name: Upload runtime artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/_40_post_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ on:
ngrok:
type: boolean
default: false
node-count:
type: number
default: 1

env:
FORCE_COLOR: 1
SOLANA_VERSION: v1.18.8
SOLANA_VERSION: v1.18.17
NODE_COUNT: "${{ inputs.node-count }}-node"

permissions:
packages: read
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/_60_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,23 @@ jobs:
name: chainflip-backend-bin
path: assets/bin

- name: Download Mac M2 binaries 📥
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: chainflip-backend-bin-mac-m2
path: /tmp/assets/m2

- name: Remove non production binaries 🗑
run: |
rm -f assets/bin/chainflip-engine-databases
rm -f assets/bin/chainflip-ingress-egress-tracker
rm -f assets/bin/generate-genesis-keys
- name: Move .dylib files 📂
run: |
mkdir -p assets/m2
mv /tmp/assets/m2/libchainflip_engine_v*.dylib assets/m2/
- name: Download packages 📥
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/_61_upload_engine_shared_libs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
on:
workflow_call:

permissions:
id-token: write
contents: read
jobs:
upload:
runs-on: ubuntu-22.04
steps:
- name: Checkout 🛒
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Download Artifacts 📥
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: chainflip-backend-bin
path: chainflip-backend-bin

- name: Download M2 binaries 📥
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: chainflip-backend-bin-mac-m2
path: chainflip-backend-bin-mac-m2

- name: Set Version 🔦
id: version
shell: bash
run: |
chmod +x chainflip-backend-bin/chainflip-node
VERSION=$(./ci/scripts/extract_version.sh "$(./chainflip-backend-bin/chainflip-node --version)" full)
echo "Version: $VERSION"
echo "url_friendly_version=$(echo $VERSION | tr . _)" >> $GITHUB_OUTPUT
- name: Move shared library files 📂
run: |
mkdir -p /tmp/chainflip-engine-shared-libs/
mv chainflip-backend-bin/libchainflip_engine_v${{ steps.version.outputs.url_friendly_version }}.so /tmp/chainflip-engine-shared-libs/
mv chainflip-backend-bin-mac-m2/libchainflip_engine_v${{ steps.version.outputs.url_friendly_version }}.dylib /tmp/chainflip-engine-shared-libs/
- name: Configure AWS credentials using OIDC 🪪
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::962042992619:role/chainflip-github-bot

- name: Upload engine shared libraries S3 🚀
run: |
aws s3 cp /tmp/chainflip-engine-shared-libs/ s3://repo.chainflip.io/lib/${{ steps.version.outputs.url_friendly_version }}/ --recursive
5 changes: 5 additions & 0 deletions .github/workflows/ci-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
secrets: inherit
with:
profile: "release"
build-m2:
uses: ./.github/workflows/_21_build_m2.yml
secrets: inherit
with:
profile: "release"
# Used to test upgrades to this version from the latest release
build-try-runtime:
uses: ./.github/workflows/_20_build.yml
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-perseverance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ jobs:
uses: ./.github/workflows/_70_post_release.yml
with:
network: "perseverance"
upload-engine-shared-libs:
needs: [build, build-m2]
uses: ./.github/workflows/_61_upload_engine_shared_libs.yml
secrets: inherit
4 changes: 4 additions & 0 deletions .github/workflows/release-sisyphos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ jobs:
uses: ./.github/workflows/_70_post_release.yml
with:
network: "sisyphos"
upload-engine-shared-libs:
needs: [build, build-m2]
uses: ./.github/workflows/_61_upload_engine_shared_libs.yml
secrets: inherit
2 changes: 2 additions & 0 deletions .github/workflows/upgrade-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ jobs:
chmod +x ${{ env.BINARY_ROOT_PATH }}/engine-runner
echo "/usr/lib before copy of .so files"
ls -l /usr/lib
# TODO: Remove this once we have implemented fetching the shared libs in the engine-runner build script
curl https://repo.chainflip.io/lib/1_4_6/libchainflip_engine_v1_4_6.so -o /usr/lib/libchainflip_engine_v1_4_6.so
sudo cp ${{ env.BINARY_ROOT_PATH }}/libchainflip_engine_v*.so /usr/lib/
sudo cp ./upgrade-to-bins/libchainflip_engine_v*.so /usr/lib/
echo "/usr/lib after copy of .so files"
Expand Down
30 changes: 15 additions & 15 deletions 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 api/bin/chainflip-broker-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Chainflip team <https://github.com/chainflip-io>"]
name = "chainflip-broker-api"
version = "1.5.0"
version = "1.6.0"
edition = "2021"

[package.metadata.deb]
Expand Down
2 changes: 1 addition & 1 deletion api/bin/chainflip-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["Chainflip team <https://github.com/chainflip-io>"]
edition = '2021'
build = 'build.rs'
name = "chainflip-cli"
version = "1.5.0"
version = "1.6.0"

[lints]
workspace = true
Expand Down
2 changes: 1 addition & 1 deletion api/bin/chainflip-ingress-egress-tracker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chainflip-ingress-egress-tracker"
version = "1.5.0"
version = "1.6.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion api/bin/chainflip-lp-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Chainflip team <https://github.com/chainflip-io>"]
name = "chainflip-lp-api"
version = "1.5.0"
version = "1.6.0"
edition = "2021"

[package.metadata.deb]
Expand Down
2 changes: 1 addition & 1 deletion api/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chainflip-api"
version = "1.5.0"
version = "1.6.0"
edition = "2021"

[lints]
Expand Down
2 changes: 1 addition & 1 deletion bouncer/shared/contract_interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function loadContractCached(abiPath: string) {
};
}
const CF_ETH_CONTRACT_ABI_TAG = 'v1.1.2';
const CF_SOL_PROGRAM_IDL_TAG = 'v0.5.0';
const CF_SOL_PROGRAM_IDL_TAG = 'v0.6.0';
export const getErc20abi = loadContractCached(
'../contract-interfaces/eth-contract-abis/IERC20.json',
);
Expand Down
8 changes: 4 additions & 4 deletions bouncer/shared/gaslimit_ccm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ async function testGasLimitSwapToSolana(
transaction = await connection.getTransaction(confirmedSignaturesInfo[0].signature, {
commitment: 'confirmed',
});
console.log(`${tag} Transaction found: ${transaction}`);
if (transaction !== null) {
console.log(`${tag} Transaction found: ${transaction?.meta}`);
// This doesn't throw an error, for now it's fine to print it.
if (transaction?.meta?.err === null) {
throw new Error('Transaction should have reverted');
Expand Down Expand Up @@ -589,9 +589,9 @@ export async function testGasLimitCcmSwaps() {
testGasLimitSwapToEvm('SolUsdc', 'ArbEth', ' sufBudget', 10),
testGasLimitSwapToSolana('Usdc', 'Sol', ' sufBudget', 10),
testGasLimitSwapToSolana('Btc', 'Sol', ' sufBudget', 100),
testGasLimitSwapToSolana('Dot', 'Sol', ' sufBudget', 100),
testGasLimitSwapToSolana('ArbUsdc', 'SolUsdc', ' sufBudget', 100),
testGasLimitSwapToSolana('Eth', 'SolUsdc', ' sufBudget', 100),
testGasLimitSwapToSolana('Dot', 'Sol', ' sufBudget', 10),
testGasLimitSwapToSolana('ArbUsdc', 'SolUsdc', ' sufBudget', 10),
testGasLimitSwapToSolana('Eth', 'SolUsdc', ' sufBudget', 10),
];

// This amount of gasLimitBudget will be swapped into very little gasLimitBudget. Not into zero as that will cause a debug_assert to
Expand Down
Loading

0 comments on commit f162f00

Please sign in to comment.