Skip to content

feat: fix CI workflows #41

feat: fix CI workflows

feat: fix CI workflows #41

Workflow file for this run

name: Circuits E2E Tests
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: Circuits E2E Tests
runs-on: ubuntu-latest
environment: CI
env:
ETHEREUM_JSON_RPC_API_URL: ${{ secrets.ETHEREUM_JSON_RPC_API_URL }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: "20.x"
- name: Enable Corepack and Install Yarn 4
run: |
corepack enable
yarn set version latest
- name: Install Dependencies
run: yarn install
- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 1.0.0-beta.17
- name: Install Barretenberg
run: |
curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/master/barretenberg/cpp/installation/install | bash
echo "$HOME/.bb" >> $GITHUB_PATH
- name: Compile Circuit
run: |
nargo compile --package get_header --deny-warnings
nargo compile --package get_account --deny-warnings
nargo compile --package get_storage --deny-warnings
nargo compile --package get_storage_recursive --deny-warnings
nargo compile --package get_receipt --deny-warnings
nargo compile --package get_transaction --deny-warnings
nargo compile --package get_log --deny-warnings
nargo compile --package is_dao_worthy --deny-warnings
nargo compile --package is_ape_owner --deny-warnings
# We cannot use the `--deny-warnings` option in `is_dao_worthy_recursive` because the `verify_proof` method generates warnings
# that are actually informational messages from the compiler and cannot be ignored.
nargo compile --package is_dao_worthy_recursive
- name: Start Oracle Server
working-directory: ethereum/oracles
run: |
yarn oracle-server &
ORACLE_SERVER_PID=$!
echo "ORACLE_SERVER_PID=$ORACLE_SERVER_PID" >> $GITHUB_ENV
- name: Generate Witnesses
run: |
nargo execute --package get_header --oracle-resolver=http://localhost:5555
nargo execute --package get_account --oracle-resolver=http://localhost:5555
nargo execute --package get_storage --oracle-resolver=http://localhost:5555
nargo execute --package get_receipt --oracle-resolver=http://localhost:5555
nargo execute --package get_transaction --oracle-resolver=http://localhost:5555
nargo execute --package get_log --oracle-resolver=http://localhost:5555
nargo execute --package is_dao_worthy --oracle-resolver=http://localhost:5555
nargo execute --package is_ape_owner --oracle-resolver=http://localhost:5555
- name: Generate Proofs
run: |
bb prove -b ./ethereum/circuits/get_header/target/get_header.json -w ./ethereum/circuits/get_header/target/get_header.gz -o ./ethereum/circuits/get_header/target/proof
bb prove -b ./ethereum/circuits/get_account/target/get_account.json -w ./ethereum/circuits/get_account/target/get_account.gz -o ./ethereum/circuits/get_account/target/proof
bb prove -b ./ethereum/circuits/get_storage/target/get_storage.json -w ./ethereum/circuits/get_storage/target/get_storage.gz -o ./ethereum/circuits/get_storage/target/proof
bb prove -b ./ethereum/circuits/get_receipt/target/get_receipt.json -w ./ethereum/circuits/get_receipt/target/get_receipt.gz -o ./ethereum/circuits/get_receipt/target/proof
bb prove -b ./ethereum/circuits/get_transaction/target/get_transaction.json -w ./ethereum/circuits/get_transaction/target/get_transaction.gz -o ./ethereum/circuits/get_transaction/target/proof
bb prove -b ./ethereum/circuits/get_log/target/get_log.json -w ./ethereum/circuits/get_log/target/get_log.gz -o ./ethereum/circuits/get_log/target/proof
bb prove -b ./vlayer/examples/circuits/is_dao_worthy/target/is_dao_worthy.json -w ./vlayer/examples/circuits/is_dao_worthy/target/is_dao_worthy.gz -o ./vlayer/examples/circuits/is_dao_worthy/target/proof
bb prove -b ./vlayer/examples/circuits/is_ape_owner/target/is_ape_owner.json -w ./vlayer/examples/circuits/is_ape_owner/target/is_ape_owner.gz -o ./vlayer/examples/circuits/is_ape_owner/target/proof
- name: Generate verification key for recursive proof
working-directory: ethereum/oracles
run: |
# Verification key generation uses the TypeScript bindings to generate the VK needed for recursive proofs.
yarn generate-get-storage-vk
- name: Generate Recursive Witness
run: |
export NARGO_FOREIGN_CALL_TIMEOUT=100000 # miliseconds
nargo execute --package is_dao_worthy_recursive --oracle-resolver=http://localhost:5555
- name: Generate Recursive Proof
run: |
bb prove -b ./vlayer/examples/circuits/is_dao_worthy_recursive/target/is_dao_worthy_recursive.json -w ./vlayer/examples/circuits/is_dao_worthy_recursive/target/is_dao_worthy_recursive.gz -o ./vlayer/examples/circuits/is_dao_worthy_recursive/target/proof
- name: Generate Verification Keys
run: |
bb write_vk -b ./ethereum/circuits/get_header/target/get_header.json -o ./ethereum/circuits/get_header/target/vk
bb write_vk -b ./ethereum/circuits/get_account/target/get_account.json -o ./ethereum/circuits/get_account/target/vk
bb write_vk -b ./ethereum/circuits/get_storage/target/get_storage.json -o ./ethereum/circuits/get_storage/target/vk
bb write_vk -b ./ethereum/circuits/get_receipt/target/get_receipt.json -o ./ethereum/circuits/get_receipt/target/vk
bb write_vk -b ./ethereum/circuits/get_transaction/target/get_transaction.json -o ./ethereum/circuits/get_transaction/target/vk
bb write_vk -b ./ethereum/circuits/get_log/target/get_log.json -o ./ethereum/circuits/get_log/target/vk
bb write_vk -b ./vlayer/examples/circuits/is_dao_worthy/target/is_dao_worthy.json -o ./vlayer/examples/circuits/is_dao_worthy/target/vk
bb write_vk -b ./vlayer/examples/circuits/is_ape_owner/target/is_ape_owner.json -o ./vlayer/examples/circuits/is_ape_owner/target/vk
- name: Verify Proofs
run: |
bb verify -k ./ethereum/circuits/get_header/target/vk -p ./ethereum/circuits/get_header/target/proof
bb verify -k ./ethereum/circuits/get_account/target/vk -p ./ethereum/circuits/get_account/target/proof
bb verify -k ./ethereum/circuits/get_storage/target/vk -p ./ethereum/circuits/get_storage/target/proof
bb verify -k ./ethereum/circuits/get_receipt/target/vk -p ./ethereum/circuits/get_receipt/target/proof
bb verify -k ./ethereum/circuits/get_transaction/target/vk -p ./ethereum/circuits/get_transaction/target/proof
bb verify -k ./ethereum/circuits/get_log/target/vk -p ./ethereum/circuits/get_log/target/proof
bb verify -k ./vlayer/examples/circuits/is_dao_worthy/target/vk -p ./vlayer/examples/circuits/is_dao_worthy/target/proof
bb verify -k ./vlayer/examples/circuits/is_ape_owner/target/vk -p ./vlayer/examples/circuits/is_ape_owner/target/proof
- name: Stop Oracle Server
if: always()
run: kill $ORACLE_SERVER_PID