Skip to content

Commit

Permalink
Merge branch 'arith-dev' into fix/parsing-constraint-failed
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianHuc authored Feb 7, 2025
2 parents eb7896e + 9c1f3c3 commit fa01edb
Show file tree
Hide file tree
Showing 51 changed files with 1,454 additions and 295 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-go-corset/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ runs:

- name: Install Go Corset
shell: bash
run: go install github.com/consensys/go-corset/cmd/go-corset@e5e0938
run: go install github.com/consensys/go-corset/cmd/go-corset@75a88c5
53 changes: 3 additions & 50 deletions .github/workflows/gradle-ethereum-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,9 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ethereum-tests:
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-xxl
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Test Environment
uses: ./.github/actions/setup-environment
with:
rust-corset: true

- 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 -Dblockchain=Ethereum referenceGeneralStateTests
env:
REFERENCE_TESTS_PARALLELISM: 10
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: fields,expand,expand,expand

- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: ethereum-tests-report
path: |
reference-tests/build/reports/tests/**/*
tmp/local/*
- name: Failure Notification
if: ${{ failure() || cancelled() }}
uses: slackapi/[email protected]
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger
payload: |
name: "Daily State Tests (Rust Corset)"
status: "${{ job.status }}"
ethereum-tests-go-corset:
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-xxl
steps:
- name: Checkout repository
Expand All @@ -72,21 +27,19 @@ jobs:
run: ./gradlew generateGeneralStateReferenceTests -Dorg.gradle.caching=true
env:
JAVA_OPTS: -Dorg.gradle.daemon=false
ZKEVM_BIN: "zkevm_for_reference_tests.go.bin"

- name: Run General State Reference Tests
run: GOMEMLIMIT=64GiB ./gradlew -Dblockchain=Ethereum referenceGeneralStateTests
env:
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: disable
GOCORSET_FLAGS: -vw --ansi-escapes=false --report --air
ZKEVM_BIN: "zkevm_for_reference_tests.go.bin"
GOCORSET_FLAGS: -vw -b1024 --ansi-escapes=false --report --air

- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: ethereum-tests-go-corset-report
name: ethereum-tests-report
path: |
reference-tests/build/reports/tests/**/*
tmp/local/*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gradle-nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
env:
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: disable
GOCORSET_FLAGS: -vw --ansi-escapes=false --report --hir
ZKEVM_BIN: "zkevm.go.bin"
GOCORSET_FLAGS: -vw --ansi-escapes=false --report --mir
ZKEVM_BIN: "zkevm.bin"
NIGHTLY_TESTS_PARALLELISM: 2

- name: Upload test report
Expand Down
70 changes: 5 additions & 65 deletions .github/workflows/gradle-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: ./.github/actions/setup-environment
with:
rust-corset: true

- name: Set up GCC
uses: egor-tensin/setup-gcc@v1

Expand All @@ -55,36 +55,7 @@ jobs:
# ==================================================================
# Unit Tests
# ==================================================================
corset-unit-tests:
needs: [ build ]
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-xxl
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: false

- name: Setup Test Environment
uses: ./.github/actions/setup-environment
with:
enable-ssh: ${{ inputs.tests-with-ssh }}
rust-corset: true

- name: Run unit tests
run: ./gradlew :arithmetization:test --stacktrace
env:
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: trace-span=3,fields,expand,expand,expand
UNIT_TESTS_PARALLELISM: 2

- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: corset-unit-test-report
path: arithmetization/build/reports/tests/**/*

go-corset-unit-tests:
unit-tests:
needs: [ build ]
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-xxl
continue-on-error: true
Expand All @@ -107,48 +78,18 @@ jobs:
CORSET_FLAGS: disable
GOCORSET_FLAGS: -b1024 -vw --ansi-escapes=false --report --air
UNIT_TESTS_PARALLELISM: 1
ZKEVM_BIN: "zkevm.go.bin"

- name: Upload test report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: go-corset-unit-tests-report
name: unit-tests-report
path: arithmetization/build/reports/tests/**/*

# ==================================================================
# Fast Replay Tests
# ==================================================================
corset-replay-tests:
needs: [ build ]
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-xxl
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: false

- name: Setup Environment
uses: ./.github/actions/setup-environment
with:
enable-ssh: ${{ inputs.tests-with-ssh }}
rust-corset: true

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

- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: replay-test-report
path: arithmetization/build/reports/tests/**/*

go-corset-replay-tests:
replay-tests:
needs: [ build ]
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-xxl
continue-on-error: true
Expand All @@ -170,11 +111,10 @@ jobs:
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: disable
GOCORSET_FLAGS: -b1024 -vw --ansi-escapes=false --report --air
ZKEVM_BIN: "zkevm.go.bin"

- name: Upload test report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: go-corset-replay-tests-report
name: replay-tests-report
path: arithmetization/build/reports/tests/**/*
7 changes: 3 additions & 4 deletions .github/workflows/gradle-weekly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-med
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
name: "Weekly (Go-Corset)"
status: "${{ job.status }}"
go-corset-tests:
weekly-tests:
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-xxl
continue-on-error: true
steps:
Expand All @@ -67,8 +67,7 @@ jobs:
env:
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: disable
GOCORSET_FLAGS: -vw --ansi-escapes=false --report --air
ZKEVM_BIN: "zkevm.go.bin"
GOCORSET_FLAGS: -vw -b1024 --ansi-escapes=false --report --air

- name: Failure Notification
if: ${{ failure() || cancelled() }}
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/reference-blockchain-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ jobs:
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: disable
GOCORSET_FLAGS: -b1024 -vw --ansi-escapes=false --report --air
ZKEVM_BIN: "zkevm_for_reference_tests.go.bin"
FAILED_TEST_JSON_DIRECTORY: ${{ github.workspace }}/tmp/${{ steps.extract_branch.outputs.branch }}/
FAILED_MODULE: ${{ inputs.failed_module || '' }}
FAILED_CONSTRAINT: ${{ inputs.failed_constraint || '' }}
Expand All @@ -92,6 +91,20 @@ jobs:
name: blockchain-refrence-tests-report
path: reference-tests/build/reports/tests/**/*

- name: Upload jacoco test coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: jacoco-reference-tests-coverage-report
path: reference-tests/build/reports/jacoco/jacocoReferenceBlockchainTestsReport/**/*

- name: Upload jacoco exec test
if: always()
uses: actions/upload-artifact@v4
with:
name: jacoco-reference-tests-exec-file
path: reference-tests/build/jacoco/referenceBlockchainTests.exec

- name: Extract Metrics
if: ${{ failure() || cancelled() }}
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ private void configGoCorset() {
private List<String> buildCommandLine(Path traceFile, String zkEvmBin) {
ArrayList<String> options = new ArrayList<>();
// Determine options to use (either default or override)
String flags = System.getenv().getOrDefault("GOCORSET_FLAGS", "-w --air");
String flags =
System.getenv().getOrDefault("GOCORSET_FLAGS", "-w --report --report-context 2 --hir ");
// Specify corset binary
options.add("go-corset");
// Specify corset "check" command.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public class RustCorsetValidator extends AbstractExecutable {
@Getter private boolean active = false;

public RustCorsetValidator() {
initCorset();
// initCorset();
configCorset();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,10 @@ public AccountSnapshot deepCopy() {
address, nonce, balance, isWarm, code, deploymentNumber, deploymentStatus);
}

public AccountSnapshot wipe(DeploymentInfo deploymentInfo) {
public void wipe(DeploymentInfo deploymentInfo) {
final boolean deploymentStatus = deploymentInfo.getDeploymentStatus(address);
checkArgument(!deploymentStatus);
return new AccountSnapshot(
address,
0,
Wei.of(0),
isWarm,
Bytecode.EMPTY,
deploymentInfo.deploymentNumber(address),
deploymentStatus);
this.nonce(0).balance(Wei.ZERO).code(Bytecode.EMPTY).setDeploymentInfo(deploymentInfo);
}

/**
Expand Down Expand Up @@ -234,24 +227,26 @@ public AccountSnapshot setWarmthTo(boolean newWarmth) {
return this;
}

/**
* Raises the nonce by 1. <b>WARNING:</b> this modifies the underlying {@link AccountSnapshot}. Be
* sure to work with a {@link AccountSnapshot#deepCopy} if necessary.
*
* @return {@code this} with nonce++
*/
public AccountSnapshot raiseNonceByOne() {
this.nonce(nonce + 1);
return this;
return this.nonce(nonce + 1);
}

public AccountSnapshot decrementNonceByOne() {
checkState(nonce > 0);
return this.nonce(nonce - 1);
}

public AccountSnapshot setDeploymentNumber(Hub hub) {
return this.setDeploymentNumber(hub.transients.conflation().deploymentInfo());
}

public AccountSnapshot setDeploymentNumber(DeploymentInfo deploymentInfo) {
this.deploymentNumber(deploymentInfo.deploymentNumber(address));
return this;
return this.deploymentNumber(deploymentInfo.deploymentNumber(address));
}

public AccountSnapshot decrementDeploymentNumberByOne() {
checkState(deploymentNumber > 0);
return this.deploymentNumber(deploymentNumber - 1);
}

public AccountSnapshot setDeploymentInfo(Hub hub) {
Expand Down
Loading

0 comments on commit fa01edb

Please sign in to comment.