Skip to content

Commit

Permalink
Merge branch 'arith-dev' into chore/solidity-testing-framework
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierBBB authored Sep 30, 2024
2 parents f55bcf6 + 65d1fe5 commit 48c7e3f
Show file tree
Hide file tree
Showing 238 changed files with 5,638 additions and 3,505 deletions.
93 changes: 70 additions & 23 deletions .github/workflows/gradle-ethereum-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: reference tests
on:
schedule:
- cron: "0 23 * * 1-5"
workflow_dispatch:

env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
Expand Down Expand Up @@ -30,38 +31,84 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1

# The asset URL for the latest release can be found with:
# curl -L -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer YOUR_GH_API_TOKEN" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# https://api.github.com/repos/ConsenSys/corset/releases/latest
# | jq '.assets[] | select(.name|endswith("x86_64-unknown-linux-musl.tar.gz")) | .url'
- name: Install Corset
run: RUSTFLAGS=-Awarnings cargo install --git ssh://git@github.com/ConsenSys/corset --tag v9.7.13 --locked --force
# run: |
# curl -L \
# -H "Accept: application/octet-stream" \
# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# -o corset.tar.gz \
# https://api.github.com/repos/Consensys/corset/releases/assets/151396061
# tar xzf corset.tar.gz
# mv corset $HOME
# echo $HOME >> $GITHUB_PATH

- name: Generate block chain reference tests
run: ./gradlew :reference-tests:generateBlockchainReferenceTests -Dorg.gradle.parallel=true -Dorg.gradle.caching=true

- name: Generate zkevm_for_reference_tests.bin
run: cd ./linea-constraints; make zkevm_for_reference_tests.bin -B; cd ..

- name: Generate General State Reference Tests
run: ./gradlew generateGeneralStateReferenceTests -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
env:
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: fields,expand,expand,expand

- name: Run General State Reference Tests
run: ./gradlew referenceGeneralStateTests
env:
REFERENCE_TESTS_PARALLELISM: 10
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: fields,expand,expand,expand

- name: generate zkevm.bin
- name: Upload test report
if: always()
uses: actions/upload-artifact@v3
with:
name: ethereum-tests-report
path: reference-tests/build/reports/tests/**/*


ethereum-tests-go-corset:
runs-on: ubuntu-latest-128
steps:
- uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: |
${{ secrets.CONSTRAINTS_SSH_KEY }}
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Install Corset
run: RUSTFLAGS=-Awarnings cargo install --git ssh://git@github.com/ConsenSys/corset --tag v9.7.13 --locked --force

- name: Generate zkevm_for_reference_tests.bin
run: cd ./linea-constraints; make zkevm_for_reference_tests.bin -B; cd ..

- name: Run general reference tests
run: ./gradlew referenceGeneralStateTests -x spotlessCheck
- name: Install Go
uses: actions/setup-go@v4

- name: Install Go Corset
run: go install github.com/consensys/go-corset/cmd/go-corset@latest

- name: Generate General State Reference Tests
run: ./gradlew generateGeneralStateReferenceTests -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
env:
JAVA_OPTS: -Dorg.gradle.daemon=false
ZKEVM_BIN: zkevm_for_reference_tests.bin
CORSET_FLAGS: fields,expand,expand,expand

- name: Run General State Reference Tests
run: GOMEMLIMIT=196GiB ./gradlew referenceGeneralStateTests
env:
REFERENCE_TESTS_PARALLELISM: 10
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: disable
GOCORSET_FLAGS: -wd --ansi-escapes=false --report --air

- name: Upload test report
if: always()
uses: actions/upload-artifact@v3
with:
name: ethereum-tests-go-corset-report
path: reference-tests/build/reports/tests/**/*
2 changes: 1 addition & 1 deletion .github/workflows/gradle-nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v3
with:
name: unit-test-report
name: nightly-tests-report
path: build/reports/tests/**/*

go-corset-tests:
Expand Down
40 changes: 17 additions & 23 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,12 @@ jobs:
name: distributions
path: arithmetization/build/libs

spotless:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 21
- name: spotless
- name: Run spotless
run: ./gradlew --no-daemon --parallel clean spotlessCheck


tests:
needs: [ build, spotless ]
runs-on: ubuntu-latest-128
needs: [ build ]
runs-on: ubuntu-latest-32
steps:
- name: Setup upterm session
if: ${{ inputs.tests-with-ssh }}
Expand All @@ -77,7 +66,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
submodules: false

- name: Get Submodules
run: git submodule update --init --recursive linea-constraints

- name: Set up JDK 21
uses: actions/setup-java@v3
Expand Down Expand Up @@ -114,12 +106,11 @@ jobs:
CORSET_FLAGS: fields,expand,expand,expand

- name: Run Replay tests
run: ./gradlew :arithmetization:replayTests --stacktrace
run: ./gradlew :arithmetization:fastReplayTests --stacktrace
env:
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: fields,expand,expand,expand
REPLAY_TESTS_PARALLELISM: 4

REPLAY_TESTS_PARALLELISM: 2

- name: Upload test report
if: always()
Expand All @@ -129,9 +120,9 @@ jobs:
path: arithmetization/build/reports/tests/**/*

go-corset-tests:
needs: [ build, spotless ]
runs-on: ubuntu-latest-128
continue-on-error: true
needs: [ build ]
runs-on: ubuntu-latest-32
continue-on-error: true
steps:
- name: Setup upterm session
if: ${{ inputs.tests-with-ssh }}
Expand All @@ -144,7 +135,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
submodules: false

- name: Get Submodules
run: git submodule update --init --recursive linea-constraints

- name: Set up JDK 21
uses: actions/setup-java@v3
Expand Down Expand Up @@ -173,7 +167,7 @@ jobs:
GOCORSET_FLAGS: -wd --ansi-escapes=false --report --air

- name: Run replay tests
run: GOMEMLIMIT=196GiB ./gradlew :arithmetization:replayTests
run: GOMEMLIMIT=196GiB ./gradlew :arithmetization:fastReplayTests
env:
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: disable
Expand Down
65 changes: 24 additions & 41 deletions .github/workflows/reference-blockchain-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ on:
- cron: 0 21 * * 1-5
workflow_dispatch:
inputs:
failed_tests_file_name:
description: File name for filtering failed tests based on previous runs
required: false
type: string
failed_tests_file_path:
description: File path for filtering failed tests based on previous runs
required: false
type: string
failed_module:
description: Specific module to filter from failed tests
required: false
Expand All @@ -21,82 +13,73 @@ on:
description: Specific module constrain pair to filter from failed tests
required: false
type: string
commit:
description: Commit to download artifact from
required: false
type: string

jobs:
get-branch-name:
runs-on: ubuntu-latest
steps:
- name: Get branch name
run: |
echo "Branch: ${github.event.ref}"
BRANCH_NAME=${github.event.ref##*/}
echo "Branch name: $BRANCH_NAME"
outputs:
branch-name: $BRANCH_NAME

ethereum-tests:
runs-on: ubuntu-latest-128
steps:
- uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: |
${{ secrets.CONSTRAINTS_SSH_KEY }}
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: get-branch-name
id: extract_branch
run: |
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1

# The asset URL for the latest release can be found with:
# curl -L -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer YOUR_GH_API_TOKEN" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# https://api.github.com/repos/ConsenSys/corset/releases/latest
# | jq '.assets[] | select(.name|endswith("x86_64-unknown-linux-musl.tar.gz")) | .url'

- name: Install Corset
run: RUSTFLAGS=-Awarnings cargo install --git ssh://git@github.com/ConsenSys/corset --tag v9.7.13 --locked --force
# run: |
# curl -L \
# -H "Accept: application/octet-stream" \
# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# -o corset.tar.gz \
# https://api.github.com/repos/Consensys/corset/releases/assets/151396061
# tar xzf corset.tar.gz
# mv corset $HOME
# echo $HOME >> $GITHUB_PATH

- name: Generate block chain reference tests
run: ./gradlew :reference-tests:generateBlockchainReferenceTests -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
env:
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: fields,expand,expand,expand

- name: generate zkevm.bin
run: cd ./linea-constraints; make zkevm_for_reference_tests.bin -B; cd ..

- name: Download artifact
uses: dawidd6/action-download-artifact@v6
if: ${{ inputs.failed_module != '' }}
with:
name: failedBlockchainReferenceTests.json
path: ${{ github.workspace }}/tmp/${{ steps.extract_branch.outputs.branch }}/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
commit: ${{ inputs.commit || '' }}
if_no_artifact_found: ignore
- name: Run reference blockchain tests
run: ./gradlew referenceBlockchainTests -x spotlessCheck
timeout-minutes: 180
continue-on-error: true
env:
REFERENCE_TESTS_PARALLELISM: 20
JAVA_OPTS: -Dorg.gradle.daemon=false
ZKEVM_BIN: zkevm_for_reference_tests.bin
CORSET_FLAGS: fields,expand,expand,expand
FAILED_TESTS_FILE_NAME: ${{ inputs.failed_tests_file_name || '' }}
FAILED_TEST_JSON_DIRECTORY: ${{ ../tmp/${{ inputs.branch-name }}/ || '' }}
FAILED_TEST_JSON_DIRECTORY: ${{ github.workspace }}/tmp/${{ steps.extract_branch.outputs.branch }}/
FAILED_MODULE: ${{ inputs.failed_module || '' }}
FAILED_CONSTRAINT: ${{ inputs.failed_constraint || '' }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: my-artifact
path: ../tmp/${{ inputs.branch-name }}/${{ inputs.failed_tests_file_name }}
name: failedBlockchainReferenceTests.json
path: ${{ github.workspace }}/tmp/${{ steps.extract_branch.outputs.branch }}/
Loading

0 comments on commit 48c7e3f

Please sign in to comment.