Skip to content

Commit

Permalink
Split nargo verify and e2e tests into two different workflows (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
LogvinovLeon authored Feb 28, 2024
1 parent 5a4aba1 commit bef5e97
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 18 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Workflows

- [Circuits profiling](./circuits_profile.yml)
- Runs `nargo info` and stores the results into an artefact
- [Circuits tests](./circuits_test.yml)
- Runs `nargo test`
- [Circuits E2E tests](./circuits_e2e.yml)
- Runs `nargo prove` & `nargo verify`
- [Solidity tests](./contract_test.yml)
- Runs `forge test`
- [TypeScript E2E tests using solidity verifiers](./e2e_test.yml)
- Runs `yarn test:e2e`
57 changes: 57 additions & 0 deletions .github/workflows/circuits_e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Circuits E2E Tests

on: [push]

jobs:
test:
name: Circuits E2E Tests
runs-on: 32-core-ubuntu-runner
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/noirup@v0.1.3
with:
toolchain: 0.23.0

- name: Compile Circuit
run: nargo compile --workspace

- name: Start Oracle Server
working-directory: ethereum_history_api/oracles
run: |
yarn oracle-server &
ORACLE_SERVER_PID=$!
echo "ORACLE_SERVER_PID=$ORACLE_SERVER_PID" >> $GITHUB_ENV
- name: Generate Proof
run: |
nargo prove --package get_header --oracle-resolver=http://localhost:5555
nargo prove --package get_account --oracle-resolver=http://localhost:5555
- name: Veirfy Proof
run: |
nargo verify --package get_header
nargo verify --package get_account
- name: Stop Oracle Server
if: always()
run: kill $ORACLE_SERVER_PID
3 changes: 0 additions & 3 deletions .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ jobs:
nargo prove --package get_header --oracle-resolver=http://localhost:5555
nargo prove --package get_account --oracle-resolver=http://localhost:5555
- name: Veirfy Proof
run: nargo verify --package get_account

- name: Run nargo codegen-verifier
run: |
nargo codegen-verifier --package get_header
Expand Down
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
# noir-ethereum-history-api

_noir-ethereum-history-api_ is a [Noir](https://noir-lang.org) library for proving and verifying account balances and smart contracts storage slots on the Ethereum blockchain and other EVMs.
_noir-ethereum-history-api_ is a [Noir](https://noir-lang.org) library for proving and verifying account balances and smart contracts storage slots on the Ethereum blockchain and other EVMs.

As for now, it allows for proving and verifying last 256 blocks.

It is currently in a development stage.

### Repository structure

This monorepo consists of four sub-projects:
* [Circuits](ethereum_history_api/circuits/lib/) - Noir circuits to generate account and storage proofs for historical blocks data
* [Contracts](ethereum_history_api/contracts/) - related Solidity contracts with tests
* [Oracles](ethereum_history_api/oracles/) - TypeScript oracle server that provides data for circuits
* [Tests](ethereum_history_api/tests/) - e2e tests in TypeScript

## Prerequisites
- [Circuits](ethereum_history_api/circuits/lib/) - Noir circuits to generate account and storage proofs for historical blocks data
- [Contracts](ethereum_history_api/contracts/) - related Solidity contracts with tests
- [Oracles](ethereum_history_api/oracles/) - TypeScript oracle server that provides data for circuits
- [Tests](ethereum_history_api/tests/) - e2e tests in TypeScript

_nargo_ and _foundry_ must be installed in order to compile and test code in this repository.
## Prerequisites

* [nargo installation](https://noir-lang.org/docs/getting_started/installation/)
* [foundry installation](https://book.getfoundry.sh/getting-started/installation)
* [yarn](https://yarnpkg.com) >= 4.1.0
_nargo_ and _foundry_ must be installed in order to compile and test code in this repository.

- [nargo installation](https://noir-lang.org/docs/getting_started/installation/)
- [foundry installation](https://book.getfoundry.sh/getting-started/installation)
- [yarn](https://yarnpkg.com) >= 4.1.0

## Getting started

Expand All @@ -31,6 +32,7 @@ Run `yarn` to install dependencies.
### Running checks

To run all static checks (eslint, prettier, typecheck) type:

```sh
yarn check
```
Expand All @@ -43,13 +45,15 @@ To run checks individually use:

`yarn typecheck:all` - to run `typescript` checks on the whole repo


### Compilation & testing

Compilation and testing instructions for individual projects:
* [Circuits](ethereum_history_api/circuits/lib/README.md#compilation)
* [Contracts](ethereum_history_api/contracts/README.md#build)
* [Oracles](ethereum_history_api/oracles/README.md)
* [Tests](ethereum_history_api/tests/README.md)

- [Circuits](ethereum_history_api/circuits/lib/README.md#compilation)
- [Contracts](ethereum_history_api/contracts/README.md#build)
- [Oracles](ethereum_history_api/oracles/README.md)
- [Tests](ethereum_history_api/tests/README.md)

### CI workflows

We use Github actions to run tests on CI. For a detailed description of what does each workflow do consult [Workflow Docs](./.github/workflows/README.md)

0 comments on commit bef5e97

Please sign in to comment.