Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update multisig-prover with latest rkyv crate API updates #33

Merged
merged 36 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7e878bb
chore: use different rust caches for each ci check (#518)
cgorenflo Jul 16, 2024
938c5cf
chore: force cosmwasm-check install for build wasm release check (#519)
cgorenflo Jul 16, 2024
ed0327d
fix(multisig-prover): drop checksum check for destination chain (#513)
haiyizxx Jul 16, 2024
5152aec
chore: release ampd 0.6.0 [skip ci]
Jul 16, 2024
9c7990b
feat(gateway): add permission control to gateway (#508)
cgorenflo Jul 16, 2024
681af1f
refactor(minor-integration-tests): use rewards query for contract wra…
maancham Jul 16, 2024
e4220a6
feat(minor-voting-verifier): query poll by id (#505)
haiyizxx Jul 16, 2024
7a53c19
feat(rewards): add permission control to rewards contract (#517)
cgorenflo Jul 16, 2024
7393fa4
chore: give github workflows more fitting names (#520)
cgorenflo Jul 17, 2024
d896952
chore(infra): log crates.toml to figure out issues with caching and u…
talalashraf Jul 17, 2024
f8a7fe7
chore: release router 0.4.0 [skip ci]
Jul 17, 2024
c1e80ca
chore: update compatibility matrix (#521)
cjcobb23 Jul 17, 2024
600f247
feat(ampd): integrate ampd queued broadcaster with the axelar batch r…
fish-sammy Jul 18, 2024
596b214
feat(minor-ampd): make handle sleep and max_attempts parameters confi…
maancham Jul 18, 2024
a7f3b99
revert: chore: force cosmwasm-check install for build wasm release ch…
talalashraf Jul 19, 2024
deab56a
chore(fmt): enforce unique import sorting in PR checks (#524)
cgorenflo Jul 19, 2024
ac966f1
docs: add bullet points to all chapters of SUMMARY.md (#529)
maancham Jul 22, 2024
546b5e1
feat(multisig-prover): add permission control to multisig-prover (#526)
cgorenflo Jul 22, 2024
638454c
feat: return structured errors from contracts (#527)
cgorenflo Jul 22, 2024
7a7f9bf
feat(minor): add legacy (uppercase) chain name support (#523)
cgorenflo Jul 23, 2024
8ee688f
feat(nexus-gateway): add permission control to nexus-gateway (#530)
cgorenflo Jul 23, 2024
c5e8bef
refactor: remove unnecessary allow dead_code flags (#531)
maancham Jul 23, 2024
b4cf22f
feat(minor-voting-verifier): add permission control to the voting-ver…
cgorenflo Jul 24, 2024
b93c3db
feat(service-registry): add permission control to the service-registr…
cgorenflo Jul 24, 2024
febb75b
revert(ampd): revert "integrate ampd queued broadcaster with the axel…
fish-sammy Jul 24, 2024
e4ef307
refactor(minor): make the main flow msgs consistent (#539)
cgorenflo Jul 24, 2024
216f153
refactor(minor): remove "get" from function names (#537)
cgorenflo Jul 24, 2024
7e27cb7
ci: use cosmwasm-check v1.3.x for consistency with wasmvm version (#534)
milapsheth Jul 24, 2024
3359fc3
ci(ampd): build ampd in gh actions (#533)
milapsheth Jul 24, 2024
852e68b
fix(minor-router): unambiguous message hash computation (#542)
milapsheth Jul 25, 2024
0ac9bde
feat(ampd): retry fetching block height (#543)
cjcobb23 Jul 25, 2024
562aff5
ci(amplifier): add r2 support for releases (#541)
maancham Jul 25, 2024
770a488
refactor(minor): rename id field in CrosschainId to message_id (#538)
cgorenflo Jul 26, 2024
8624493
feat: add interchain token service encoding/decoding api (#482)
milapsheth Jul 27, 2024
6e80906
feat: update multisig-prover with latest rkyv crate API updates
eloylp Jul 29, 2024
1a1f072
Merge with upstream
eloylp Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 83 additions & 10 deletions .github/workflows/basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache build artifacts
uses: useblacksmith/rust-cache@v3
uses: useblacksmith/[email protected]
id: cache
with:
shared-key: "cache"
shared-key: "cache-tests"

- name: Log crates.toml
if: steps.cache.outputs.cache-hit == 'true'
run: cat /home/runner/.cargo/.crates.toml

- name: Run tests
uses: actions-rs/cargo@v1
Expand All @@ -54,12 +59,27 @@ jobs:
profile: minimal
toolchain: 1.78.0
target: wasm32-unknown-unknown
default: true
override: true

- name: Install cosmwasm-check compatible toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
target: wasm32-unknown-unknown
default: false
override: false

- name: Cache build artifacts
uses: useblacksmith/rust-cache@v3
id: cache
uses: useblacksmith/[email protected]
with:
shared-key: "cache"
shared-key: "cache-cosmwasm-compilation"

- name: Log crates.toml
if: steps.cache.outputs.cache-hit == 'true'
run: cat /home/runner/.cargo/.crates.toml

- name: Build wasm release
run: |
Expand All @@ -69,17 +89,24 @@ jobs:
(cd $C && cargo build --release --lib --target wasm32-unknown-unknown --locked)
done

- name: Build ITS release
working-directory: ./interchain-token-service
run: cargo build --release --target wasm32-unknown-unknown --locked

# cosmwasm-check v1.3.x is used to check for compatibility with wasmvm v1.3.x used by Axelar
# Older rust toolchain is required to install cosmwasm-check v1.3.x
- name: Install cosmwasm-check
uses: actions-rs/cargo@v1
with:
command: install
args: --version 1.5.5 --locked cosmwasm-check
toolchain: 1.75.0
args: --version 1.3.4 --locked cosmwasm-check

- name: Check wasm contracts
run: cosmwasm-check ./target/wasm32-unknown-unknown/release/*.wasm

lints:
name: Lints
ampd-compilation:
name: Ampd Release Compilation
runs-on: blacksmith-16vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
Expand All @@ -89,18 +116,56 @@ jobs:
with:
profile: minimal
toolchain: 1.78.0
target: wasm32-unknown-unknown
override: true

- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache build artifacts
id: cache
uses: useblacksmith/[email protected]
with:
shared-key: "cache-ampd-compilation"

- name: Log crates.toml
if: steps.cache.outputs.cache-hit == 'true'
run: cat /home/runner/.cargo/.crates.toml

- name: Build ampd
working-directory: ./ampd
run: cargo build --release --locked

lints:
name: Lints
runs-on: blacksmith-16vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
override: true
components: rustfmt, clippy

- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache build artifacts
uses: useblacksmith/rust-cache@v3
uses: useblacksmith/[email protected]
id: cache
with:
shared-key: "cache"
shared-key: "cache-lints"

- name: Log crates.toml
if: steps.cache.outputs.cache-hit == 'true'
run: cat /home/runner/.cargo/.crates.toml

- name: Install cargo-sort
uses: baptiste0928/cargo-install@v2
Expand All @@ -113,6 +178,14 @@ jobs:
command: fmt
args: --all -- --check

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.78.0
components: clippy
override: true

- name: Run cargo sort
uses: actions-rs/cargo@v1
with:
Expand Down
65 changes: 0 additions & 65 deletions .github/workflows/build-ampd-and-push-to-r2.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build-ampd-main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Amplifier - Build main branch
name: ampd (push to main) - Build and push image to ECR

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ampd-release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Amplifier - Build Release
name: ampd - Build and release binary and image

on:
workflow_dispatch:
Expand Down
153 changes: 153 additions & 0 deletions .github/workflows/build-contracts-and-push-to-r2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: Amplifier wasm contracts - Upload wasm binaries to Cloudflare R2 bucket

on:
push:
branches:
- main
tags:
- '*-v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
inputs:
branch:
description: Github branch to checkout for compilation
required: true
default: main
type: string


jobs:
compile-and-upload:
name: Compile contracts and push to R2
runs-on: ubuntu-22.04
permissions:
contents: write
packages: write
id-token: write
steps:
- name: Get tag
id: get-tag
run: |
echo "github_ref=$GITHUB_REF"
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "tag=${GITHUB_REF#refs/tags/}"
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "tag=" >> $GITHUB_OUTPUT
fi

- name: Check for release information from tag
id: check-release
run: |
tag="${{ steps.get-tag.outputs.tag }}"
is_release="false"

if [[ $tag =~ ^([a-zA-Z-]+)-v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
is_release="true"
crate_name="${BASH_REMATCH[1]}"
crate_version="${BASH_REMATCH[2]}"

echo "Is release: $is_release"
echo "Crate Name: $crate_name"
echo "Crate Version: $crate_version"

echo "is-release=$is_release" >> $GITHUB_OUTPUT
echo "crate-name=$crate_name" >> $GITHUB_OUTPUT
echo "crate-version=$crate_version" >> $GITHUB_OUTPUT
else
echo "Is release: $is_release"
echo "Not a release tag. Skipping crate name and version extraction."
echo "is-release=$is_release" >> $GITHUB_OUTPUT
fi


- name: Determine checkout ref
id: get-checkout-ref
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "ref=$GITHUB_REF" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" == "push" ]; then
echo "ref=main" >> $GITHUB_OUTPUT
else
echo "ref=${{ inputs.branch }}" >> $GITHUB_OUTPUT
fi


- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: "0"
path: axelar-amplifier
submodules: recursive
ref: ${{ steps.get-checkout-ref.outputs.ref }}


- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}


- name: Compile all amplifier contracts
id: compile-contracts
run: |
cd axelar-amplifier
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/optimizer:0.16.0

commit_hash=$(git rev-parse --short HEAD)
cd ..
mkdir -p ./artifacts/$commit_hash/
cp -R axelar-amplifier/artifacts/* ./artifacts/$commit_hash/
echo "wasm-directory=./artifacts" >> $GITHUB_OUTPUT


- name: Prepare and sign release artifacts
if: steps.check-release.outputs.is-release == 'true'
id: prepare-release
run: |
cd ${{ steps.compile-contracts.outputs.wasm-directory }}
crate_name="${{ steps.check-release.outputs.crate-name }}"
crate_version="${{ steps.check-release.outputs.crate-version }}"
wasm_file=$(find . -name "${crate_name//-/_}.wasm")
checksum_file=$(find . -name "checksums.txt")

if [ -z "$wasm_file" ]; then
echo "Error: Could not find .wasm file for $crate_name"
exit 1
fi

mkdir -p "../release-artifacts"
cp "$wasm_file" "../release-artifacts/${crate_name}.wasm"
cp "$checksum_file" "../release-artifacts/"

gpg --armor --detach-sign ../release-artifacts/${crate_name}.wasm
gpg --armor --detach-sign ../release-artifacts/checksums.txt

echo "release-artifacts-dir=./release-artifacts" >> $GITHUB_OUTPUT
echo "r2-destination-dir=./releases/amplifier/${crate_name}/${crate_version}" >> $GITHUB_OUTPUT


- uses: ryand56/r2-upload-action@latest
if: steps.check-release.outputs.is-release == 'true'
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CF }}
r2-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CF }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: ${{ steps.prepare-release.outputs.release-artifacts-dir }}
destination-dir: ${{ steps.prepare-release.outputs.r2-destination-dir }}


- uses: ryand56/r2-upload-action@latest
if: steps.check-release.outputs.is-release != 'true'
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CF }}
r2-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CF }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: ${{ steps.compile-contracts.outputs.wasm-directory }}
destination-dir: ./pre-releases/ampd/contracts/
9 changes: 7 additions & 2 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ jobs:
run: sudo apt-get install libclang-dev

- name: Cache build artifacts
uses: useblacksmith/rust-cache@v3
uses: useblacksmith/[email protected]
id: cache
with:
shared-key: "cache"
shared-key: "cache-codecov"

- name: Log crates.toml
if: steps.cache.outputs.cache-hit == 'true'
run: cat /home/runner/.cargo/.crates.toml

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
Expand Down
Loading
Loading