Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into wip/solana
Browse files Browse the repository at this point in the history
* origin/main:
  Arbitrum gas limit multiplier (#4781)
  fix: don't set code red on "agg-key set by gov-key" (#4813)
  fix: sign tx with correct key during rotation (#4794)
  chore: arbitrum witnesser permission (#4798)
  Solana (#4414)
  feat: try-runtime build step on dev ci (#4807)
  feat: optimistic build, streamlined ci-main (#4806)
  chore: log raw dispatch error (#4809)
  feat: allow for single binary CFE upgrades (#4634)
  fix: take fee on to usdc (#4801) (#4804)
  refactor: minor cleanup of retrier code and vault pallet (#4803)
  feat: cf_boost_pool_details rpc (#4780)

# Conflicts:
#	Cargo.lock
#	state-chain/chains/src/sol.rs
#	state-chain/chains/src/sol/program_instructions.rs
#	state-chain/chains/src/sol/sol_tx_building_blocks.rs
#	state-chain/chains/src/sol/token_instructions.rs
#	state-chain/runtime/src/safe_mode.rs
  • Loading branch information
syan095 committed May 1, 2024
2 parents 3876454 + 4c52b53 commit 3e06edf
Show file tree
Hide file tree
Showing 102 changed files with 1,976 additions and 809 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CF_ETH_CONTRACT_ABI_ROOT = { value = "contract-interfaces/eth-contract-abis", re
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.2.0"
CF_ARB_CONTRACT_ABI_ROOT = { value = "contract-interfaces/arb-contract-abis", relative = true }
CF_TEST_CONFIG_ROOT = { value = "engine/config/testing", relative = true }

# Note: If you just want to save typing command commands, you can install tab completions for most shells. Type
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_05_force_version_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: |
set -x
echo $(pwd)
RELEASE_VERSION=$(./latest-release-bins/chainflip-engine --version)
RELEASE_VERSION=$(./latest-release-bins/chainflip-node --version)
echo $RELEASE_VERSION
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/_20_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,27 @@ jobs:
run: |
cargo cf-build-${{ inputs.profile }} --locked
- name: Upload binary artifacts 📤
- name: ls directory
run: |
ls -la ./target/${{ inputs.binary-subdir }}
- name: Upload binary artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32

with:
name: ${{ inputs.upload-name }}
path: |
./target/${{ inputs.binary-subdir }}/chainflip-node
./target/${{ inputs.binary-subdir }}/chainflip-engine
./target/${{ inputs.binary-subdir }}/chainflip-cli
./target/${{ inputs.binary-subdir }}/generate-genesis-keys
./target/${{ inputs.binary-subdir }}/chainflip-broker-api
./target/${{ inputs.binary-subdir }}/chainflip-lp-api
./target/${{ inputs.binary-subdir }}/chainflip-ingress-egress-tracker
./target/${{ inputs.binary-subdir }}/libchainflip_engine_v*.so
./target/${{ inputs.binary-subdir }}/engine-runner
- name: Upload runtime artifacts 📤
- name: Upload runtime artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: chainflip-node-runtime-${{ inputs.profile }}
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/_25_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,32 @@ jobs:
name: chainflip-backend-bin
path: ./target/release

- name: Get date 📅
- name: Download latest release binaries
uses: dawidd6/action-download-artifact@v2
with:
workflow: release-berghain.yml
name: chainflip-backend-bin-ubuntu-22.04
github_token: ${{ secrets.CF_BACKEND_GITHUB_TOKEN }}
path: latest-release

# TODO: Once dylib is building on release 1.3, we can make this step real
- name: TMP, move dylib into the target/release. The dylib doesn't exist on release 1.3 yet.
run: |
mv old-engine-dylib/*.so target/release/
ls -la latest-release
# This is what we would do
# run: |
# mv latest-release/*.so target/release/

- name: Get date
id: get-date
run: |
echo "date=$(date +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT
- name: Build global packages 🌍
run: |
cargo deb -v --no-build --no-strip -p chainflip-node --deb-revision "${{ steps.get-date.outputs.date }}" --variant=${{ inputs.network }}
cargo deb -v --no-build --no-strip -p chainflip-engine --deb-revision "${{ steps.get-date.outputs.date }}" --variant=${{ inputs.network }}
cargo deb -v --no-build --no-strip -p engine-runner --deb-revision "${{ steps.get-date.outputs.date }}" --variant=${{ inputs.network }}
cargo deb -v --no-build --no-strip -p chainflip-cli --deb-revision "${{ steps.get-date.outputs.date }}"
cargo deb -v --no-build --no-strip -p chainflip-broker-api --deb-revision "${{ steps.get-date.outputs.date }}"
cargo deb -v --no-build --no-strip -p chainflip-lp-api --deb-revision "${{ steps.get-date.outputs.date }}"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/_30_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ jobs:
name: chainflip-backend-packages
path: packages

- name: Get commit SHA, distribution codename ⌨️
- name: ls packages
run: ls packages

- name: Get commit SHA, distribution codename
id: vars
run: |
echo "codename=$(lsb_release -c -s)" >> $GITHUB_OUTPUT
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/_40_post_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ jobs:
mkdir -p /tmp/chainflip/doc
mkdir -p /tmp/chainflip/dopey
touch /tmp/chainflip/debug.log
ls ${{ env.BINARY_ROOT_PATH }}
sudo cp ${{ env.BINARY_ROOT_PATH }}/libchainflip_engine_v*.so /usr/lib/
chmod +x ${{ env.BINARY_ROOT_PATH }}/chainflip-*
chmod +x ${{ env.BINARY_ROOT_PATH }}/engine-runner
touch ./localnet/.setup_complete
./localnet/manage.sh
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ jobs:
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
secrets: inherit
with:
profile: "try-runtime"
upload-name: "chainflip-backend-bin-try-runtime"
binary-subdir: release
docker:
needs: [build]
uses: ./.github/workflows/_24_docker.yml
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/ci-main-merge-queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ jobs:
test_features: runtime-benchmarks
secrets: inherit
build:
needs: [test]
uses: ./.github/workflows/_20_build.yml
secrets: inherit
with:
profile: "release"
# Used to test upgrades to this version from the latest release
build-try-runtime:
needs: [test]
uses: ./.github/workflows/_20_build.yml
secrets: inherit
with:
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,18 @@ jobs:
test_features: runtime-benchmarks
secrets: inherit
build:
needs: [test]
uses: ./.github/workflows/_20_build.yml
secrets: inherit
with:
profile: "release"
# Used to test upgrades to this version from the latest release
build-try-runtime:
needs: [test]
uses: ./.github/workflows/_20_build.yml
secrets: inherit
with:
profile: "try-runtime"
upload-name: "chainflip-backend-bin-try-runtime"
binary-subdir: release

docker:
needs: [build]
uses: ./.github/workflows/_24_docker.yml
Expand All @@ -47,21 +44,10 @@ jobs:
with:
network: "test"
secrets: inherit
post-check:
needs: [build]
uses: ./.github/workflows/_40_post_check.yml
secrets: inherit
publish:
needs: [package]
uses: ./.github/workflows/_30_publish.yml
with:
version: ci/${{ github.sha }}/
environment: "development"
secrets: inherit
upgrade-check:
needs: [build-try-runtime]
uses: ./.github/workflows/upgrade-test.yml
secrets: inherit
with:
upgrade-from-release: "sisyphos"
upgrade-to-workflow-name: "ci-main.yml"
3 changes: 2 additions & 1 deletion .github/workflows/upgrade-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
- name: Get version of the latest release ✍️
run: |
set -x
RELEASE_VERSION=$(./latest-release-bins/chainflip-engine --version)
RELEASE_VERSION=$(./latest-release-bins/chainflip-node --version)
echo $RELEASE_VERSION
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
Expand Down Expand Up @@ -191,6 +191,7 @@ jobs:
git checkout ${{ github.sha }}
git rev-parse HEAD
cd bouncer
mv ./../upgrade-to-bins/*.so ./../old-engine-dylib/
pnpm install
./commands/upgrade_network.ts prebuilt \
--runtime ./../main-runtime/state_chain_runtime.compact.compressed.wasm \
Expand Down
64 changes: 38 additions & 26 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ members = [
'state-chain/cfe-events',
'engine',
'engine/generate-genesis-keys',
'engine-runner-bin',
'engine-upgrade-utils',
'engine-proc-macros',
'utilities',
'state-chain/custom-rpc',
'state-chain/cf-session-benchmarking',
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,11 @@ These commands can be used to control which logs the engine outputs at runtime.
The `RUST_LOG` environment variable controls the initial filtering directives if specified at engine startup.

The syntax for specifying filtering directives is given here: <https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html>

## Testnet

To start a multi node testnet you can use the [chainflip-testnet-tools](https://github.com/chainflip-io/chainflip-testnet-tools). A multi-node testnet can be useful to test more complex test scenarios under more realistic conditions.

## Chainflip Engine Runner

This is the root binary that kicks off the Chainflip Engine. It is responsible for loading the shared libraries and running each of the shared libraries. See the [Chainflip Engine Runner README](./engine-runner-bin/README.md) for more information.
1 change: 0 additions & 1 deletion api/bin/chainflip-ingress-egress-tracker/src/witnessing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ pub(super) async fn start(
state_chain_observer::client::StateChainClient::connect_without_account(
scope,
&settings.state_chain_ws_endpoint,
false,
)
.await?
};
Expand Down
17 changes: 9 additions & 8 deletions api/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,20 @@ pub mod primitives {
};
}
pub use cf_chains::eth::Address as EthereumAddress;
pub use chainflip_engine::state_chain_observer::client::{
base_rpc_api::{BaseRpcApi, RawRpcApi},
chain_api::ChainApi,
extrinsic_api::signed::{SignedExtrinsicApi, UntilFinalized, WaitFor, WaitForResult},
storage_api::StorageApi,
BlockInfo,
pub use chainflip_engine::{
settings,
state_chain_observer::client::{
base_rpc_api::{BaseRpcApi, RawRpcApi},
chain_api::ChainApi,
extrinsic_api::signed::{SignedExtrinsicApi, UntilFinalized, WaitFor, WaitForResult},
storage_api::StorageApi,
BlockInfo,
},
};

pub mod lp;
pub mod queries;

pub use chainflip_engine::settings;
pub use chainflip_node::chain_spec::use_chainflip_account_id_encoding;

use chainflip_engine::state_chain_observer::client::{
Expand Down Expand Up @@ -122,7 +124,6 @@ impl StateChainApi {
AccountRole::Unregistered,
false,
false,
false,
None,
)
.await?;
Expand Down
1 change: 0 additions & 1 deletion api/lib/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ impl QueryApi {
AccountRole::Unregistered,
false,
false,
false,
None,
)
.await?;
Expand Down
Loading

0 comments on commit 3e06edf

Please sign in to comment.