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

Start using our Tendermint fork in eth-bridge-integration CI #593

Merged
merged 4 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
335 changes: 335 additions & 0 deletions .github/workflows/build-and-test-bridge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,335 @@
name: Build and Test Ethereum Bridge

on:
push:
branches:
- eth-bridge-integration
# Run in PRs with conflicts (https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request)
pull_request_target:
branches:
- eth-bridge-integration
types: [opened, synchronize, reopened]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
id-token: write
contents: read
packages: read

env:
GIT_LFS_SKIP_SMUDGE: 1


jobs:
build-wasm:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
container:
image: ghcr.io/anoma/namada:wasm-0.6.1
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
wasm_cache_version: ["v1"]

steps:
- name: Checkout repo
uses: actions/checkout@v3
if: ${{ github.event_name != 'pull_request_target' }}
- name: Checkout PR
uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request_target' }}
# From https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target:
# "This event runs in the context of the base of the pull request,
# rather than in the context of the merge commit, as the pull_request
# event does."
# We set the ref to the head commit of the PR instead.
# For this, we have to make sure that we're not running CI on untrusted
# code (more info in the link above), so the repo MUST be configured
# to disallow that.
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Duplicate checksums file
run: cp wasm/checksums.json wasm/original-checksums.json
- name: Build WASM
run: |
make build-wasm-scripts
- name: Upload wasm artifacts
uses: actions/upload-artifact@v3
with:
name: wasm-${{ github.sha }}
path: |
wasm/tx_*.wasm
wasm/vp_*.wasm
wasm/checksums.json
- name: Test Wasm
run: make test-wasm
- name: Check wasm up-to-date
run: cmp -- wasm/checksums.json wasm/original-checksums.json
- name: Print diff
if: failure()
run: diff -y -W 150 wasm/checksums.json wasm/original-checksums.json --suppress-common-lines

update-wasm:
runs-on: ${{ matrix.os }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.build-wasm.result == 'success' }}
timeout-minutes: 30
needs: [build-wasm]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master
aws-region: eu-west-1
- name: Download wasm artifacts
uses: actions/download-artifact@v3
with:
name: wasm-${{ github.sha }}
path: ./wasm
- name: Update WASM
run: aws s3 sync wasm s3://$BUCKET_NAME --acl public-read --exclude "*" --include "*.wasm" --exclude "*/*" --region $AWS_REGION
env:
BUCKET_NAME: namada-wasm-master
AWS_REGION: eu-west-1

anoma-eth:
runs-on: ${{ matrix.os }}
timeout-minutes: 80
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2022-05-20]
make:
- name: ABCI
suffix: ''
cache_key: anoma
cache_version: v1
wait_for: anoma-release-eth (ubuntu-latest, ABCI Release build, anoma-e2e-release, v1)
tendermint_artifact: tendermint-unreleased-ad825dcadbd4b98c3f91ce5a711e4fb36a69c377

env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 100G
SCCACHE_BUCKET: namada-sccache-master

steps:
- name: Checkout repo
uses: actions/checkout@v3
if: ${{ github.event_name != 'pull_request_target' }}
- name: Checkout PR
uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request_target' }}
# See comment in build-and-test.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master
aws-region: eu-west-1
- name: Install sccache (ubuntu-latest)
if: matrix.os == 'ubuntu-latest'
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.3.0
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
chmod +x $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install sccache (macos-latest)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install sccache
- name: Setup rust toolchain
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36
with:
profile: default
override: true
- name: Setup rust nightly
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36
with:
toolchain: ${{ matrix.nightly_version }}
profile: default
- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-
- name: Start sccache server
run: sccache --start-server
- name: Build
run: make build${{ matrix.make.suffix }}
- name: Build test
run: make build-test${{ matrix.make.suffix }}
- name: Download wasm artifacts
uses: actions/download-artifact@v3
with:
name: wasm-${{ github.sha }}
path: ./wasm
- name: Run unit test
run: make test-unit${{ matrix.make.suffix }}
- name: Wait for release binaries
uses: lewagon/wait-on-check-action@master
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
check-name: ${{ matrix.make.wait_for }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
allowed-conclusions: success
- name: Download tendermint binaries
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: build-tendermint.yml
workflow_conclusion: success
name: ${{ matrix.make.tendermint_artifact }}
path: /usr/local/bin
- name: Download anoma binaries
uses: actions/download-artifact@v3
with:
name: binaries${{ matrix.make.suffix }}-${{ github.sha }}
path: ./target/release/
- name: Change permissions
run: |
chmod +x target/release/namada
chmod +x target/release/namadaw
chmod +x target/release/namadan
chmod +x target/release/namadac
chmod +x /usr/local/bin/tendermint
- name: Download masp parameters
run: |
mkdir /home/runner/work/masp
curl -o /home/runner/work/masp/masp-spend.params -sLO https://github.com/anoma/masp/blob/ef0ef75e81696ff4428db775c654fbec1b39c21f/masp-spend.params?raw=true
curl -o /home/runner/work/masp/masp-output.params -sLO https://github.com/anoma/masp/blob/ef0ef75e81696ff4428db775c654fbec1b39c21f/masp-output.params?raw=true
curl -o /home/runner/work/masp/masp-convert.params -sLO https://github.com/anoma/masp/blob/ef0ef75e81696ff4428db775c654fbec1b39c21f/masp-convert.params?raw=true
- name: Run e2e test
run: make test-e2e${{ matrix.make.suffix }}
env:
ANOMA_TENDERMINT_WEBSOCKET_TIMEOUT: 20
ANOMA_E2E_USE_PREBUILT_BINARIES: "true"
ANOMA_E2E_KEEP_TEMP: "true"
ENV_VAR_TM_STDOUT: "false"
ANOMA_LOG_COLOR: "false"
ANOMA_MASP_PARAMS_DIR: "/home/runner/work/masp"
ANOMA_LOG: "info"
- name: Upload e2e logs
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: logs-e2e${{ matrix.make.suffix }}-${{ github.sha }}
path: |
/tmp/.*/logs/
/tmp/.*/e2e-test.*/setup/validator-*/.anoma/logs/*.log
retention-days: 5
- name: Print sccache stats
if: always()
run: sccache --show-stats
- name: Stop sccache server
if: always()
run: sccache --stop-server || true

anoma-release-eth:
runs-on: ${{ matrix.os }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
make:
- name: ABCI Release build
suffix: ''
cache_key: anoma-e2e-release
cache_version: "v1"

env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 100G
SCCACHE_BUCKET: namada-sccache-master

steps:
- name: Checkout repo
uses: actions/checkout@v3
if: ${{ github.event_name != 'pull_request_target' }}
- name: Checkout PR
uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request_target' }}
# See comment in build-and-test.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master
aws-region: eu-west-1
- name: Install sccache (ubuntu-latest)
if: matrix.os == 'ubuntu-latest'
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.3.0
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
chmod +x $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install sccache (macos-latest)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install sccache
- name: Setup rust toolchain
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36
with:
profile: default
override: true
- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-
- name: Start sccache server
run: sccache --start-server
- name: Build
run: make build-release${{ matrix.make.suffix }}
- name: Upload target binaries
uses: actions/upload-artifact@v3
with:
name: binaries${{ matrix.make.suffix }}-${{ github.sha }}
path: |
target/release/namada
target/release/namadac
target/release/namadaw
target/release/namadan
- name: Print sccache stats
if: always()
run: sccache --show-stats
- name: Stop sccache server
if: always()
run: sccache --stop-server || true
4 changes: 4 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ on:
push:
branches:
- main
- "!eth-bridge-integration"
# Run in PRs with conflicts (https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request)
pull_request_target:
branches:
- main
- "!eth-bridge-integration"
types: [opened, synchronize, reopened]
workflow_dispatch:

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-tendermint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
- name: tendermint-unreleased
repository: heliaxdev/tendermint
tendermint_version: 559fb33ff9b27503ce7ac1c7d8589fe1d8b3e900
- name: tendermint-unreleased
repository: heliaxdev/tendermint
tendermint_version: ad825dcadbd4b98c3f91ce5a711e4fb36a69c377

steps:
- name: Build ${{ matrix.make.name }}
Expand Down
28 changes: 14 additions & 14 deletions wasm/checksums.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"tx_bridge_pool.wasm": "tx_bridge_pool.e21563260c03cfdab1f195878f49bf93722027ad26fcd097cfebbc5c4d279082.wasm",
"tx_from_intent.wasm": "tx_from_intent.9782c72ce9a90592848ef693e82d1fac7b719e8581df2f354592468c3e0fba0f.wasm",
"tx_ibc.wasm": "tx_ibc.da0a29ab7bdb98f03c658bb6f26c80a07ee437ce85c53e418c00abf0ea32db34.wasm",
"tx_init_account.wasm": "tx_init_account.c473c703b40b5c8e7c4ea6d2809d1d2c3f37edc85efd9945e0e7fd10b6183a39.wasm",
"tx_init_nft.wasm": "tx_init_nft.d3155d8776ea32c12353fb72f312a52ed9e2845eded0d9c2ed1b8c7adf6c10b6.wasm",
"tx_init_proposal.wasm": "tx_init_proposal.a61ad9ab854bccf074f2498fdcaf03e26e15c9dfce884c8415d49ddd394c55cc.wasm",
"tx_init_validator.wasm": "tx_init_validator.477a5da8ca1586078eae79f8188698c558f1278439610066595ef712c55d9ce7.wasm",
"tx_mint_nft.wasm": "tx_mint_nft.08cc5a08c593bd8a67186e39c5d09fff04d262c7234bc314f365bd86fc0e54ed.wasm",
"tx_transfer.wasm": "tx_transfer.6f5954270608aac965a90778f168626c7b4757b78fc15dd2be408ce0ece8e423.wasm",
"tx_unbond.wasm": "tx_unbond.2299b16187c424f6dec074c03d76568c8723b7c47c4621c031a624a926c24df3.wasm",
"tx_from_intent.wasm": "tx_from_intent.fc96b58e4a49608e5a449b519f0470e387ed81995d615a617fdefad0d1985e9e.wasm",
"tx_ibc.wasm": "tx_ibc.1e14034884781c89e441ee545db1a1918914f84159dee4a9c631214aa1f99598.wasm",
"tx_init_account.wasm": "tx_init_account.1cc5bdc6a2f12497a8aad73472021d1e83d2f2a70889f43bcb732ea476cb76fc.wasm",
"tx_init_nft.wasm": "tx_init_nft.fde5d70cfd8921867a9f72be02fe865212a030779de0aba471713e53b820f0e3.wasm",
"tx_init_proposal.wasm": "tx_init_proposal.bdbd8a9fdfc68b566795c9302844b5ac6a428f06071bc482c34dffaf3f323c16.wasm",
"tx_init_validator.wasm": "tx_init_validator.3e86adf8a6292275591d998249a3d803f6dce37f4fea920e88e2e806ba2983a6.wasm",
"tx_mint_nft.wasm": "tx_mint_nft.12705b20b935d36113c28ed49fbced9c01b81aca98e9dd5cf071cf85eae2a298.wasm",
"tx_transfer.wasm": "tx_transfer.7b969d9e5405cb4eeb23bc61b6df3b7cd47931686ec22e5325272699f2ad5542.wasm",
"tx_unbond.wasm": "tx_unbond.04721b263f0149b17788f50c1d9264b3625a06ac93fd779f3e58a9aa1afdf824.wasm",
"tx_update_vp.wasm": "tx_update_vp.f21d0233f9629193cea49c9c3742c2cac6764b09dd0adc7360d1f649543f2c39.wasm",
"tx_vote_proposal.wasm": "tx_vote_proposal.401adac389df5c0143fe44ecd87eb3bf2e374d1ef8d1a13217ef3369c48a2a1a.wasm",
"tx_withdraw.wasm": "tx_withdraw.5913f833ad93fd363ba12fdc7f95431044aa5d19eb13d77f337464f95d8aaf62.wasm",
"vp_nft.wasm": "vp_nft.2f58ad62ceb603e25ee0f175b1c12c8499bc15e5bc04e5ea279d1fdfb8392159.wasm",
"vp_testnet_faucet.wasm": "vp_testnet_faucet.aa9631f5c9dc4d3a1158956b7561a4f953ee5fc7bea4d3d0b0bd6f14cc04879a.wasm",
"tx_vote_proposal.wasm": "tx_vote_proposal.c5943428368cd06b4ceaa0f69eec3316f2e33051054d451bab40ee87379cabd0.wasm",
"tx_withdraw.wasm": "tx_withdraw.26529ab26c7e4fbd331a243d318fc2803fe8be16e4f17cda8f24844a9278ea81.wasm",
"vp_nft.wasm": "vp_nft.040e15d71e03b105738962903f08a4bf7c08de21d210b87590c18c5275022491.wasm",
"vp_testnet_faucet.wasm": "vp_testnet_faucet.ab8a3988cb4613b26a64dbeaea3ba8fbc3af55aeeecda12b945cf60a85de4bb3.wasm",
"vp_token.wasm": "vp_token.b517a4a2be9375eab53b885e23a212cfec0dd1f30381168e879f3b67fc6fd199.wasm",
"vp_user.wasm": "vp_user.e412597092c8ec5859b52a08861081e4e321b743efbbda5783eb432a3ff9a2a4.wasm"
"vp_user.wasm": "vp_user.bf7af5c1db9a1bd536ae7ff782ceabb148b8e860a4af55bb8ebaa8fcc128ccd9.wasm"
}