Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

build: build a separate zkevm.bin for reference tests #1177

Merged
merged 9 commits into from
Sep 16, 2024
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
7 changes: 4 additions & 3 deletions .github/workflows/gradle-ethereum-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ jobs:
- 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 -DZKEVM_BIN_ORIGINAL_PATH="linea-constraints/zkevm.bin"
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: fields,expand,expand,expand

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

- name: Run general reference tests
run: ./gradlew referenceGeneralStateTests
run: ./gradlew referenceGeneralStateTests -x spotlessCheck
env:
JAVA_OPTS: -Dorg.gradle.daemon=false
ZKEVM_BIN: zkevm_for_reference_tests.bin
CORSET_FLAGS: fields,expand,expand,expand

7 changes: 4 additions & 3 deletions .github/workflows/reference-blockchain-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,17 @@ jobs:
- 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 -DZKEVM_BIN_ORIGINAL_PATH="linea-constraints/zkevm.bin"
JAVA_OPTS: -Dorg.gradle.daemon=false
CORSET_FLAGS: fields,expand,expand,expand

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

- name: Run reference blockchain tests
run: ./gradlew referenceBlockchainTests
run: ./gradlew referenceBlockchainTests -x spotlessCheck
env:
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 }}/ || '' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public class CorsetValidator {
public record Result(boolean isValid, File traceFile, String corsetOutput) {}

/** */
private static final String ZK_EVM_RELATIVE_PATH = "/linea-constraints/zkevm.bin";
private static final String ZK_EVM_RELATIVE_PATH = "/linea-constraints/";

private static final String ZK_EVM_BIN = "zkevm.bin";

/** Specifies the default zkEVM.bin file to use (including its path). */
private String defaultZkEvm = null;
Expand Down Expand Up @@ -120,18 +122,22 @@ private void initDefaultZkEvm() {
throw new RuntimeException(e);
}

final String zkEvmBinInCurrentDir = currentDir + ZK_EVM_RELATIVE_PATH;
final String zkEvmBinInCurrentDir = currentDir + ZK_EVM_RELATIVE_PATH + binName();
if (new File(zkEvmBinInCurrentDir).exists()) {
defaultZkEvm = zkEvmBinInCurrentDir;
return;
}

final String zkEvmBinInDirAbove = currentDir + "/.." + ZK_EVM_RELATIVE_PATH;
final String zkEvmBinInDirAbove = currentDir + "/.." + ZK_EVM_RELATIVE_PATH + binName();
if (new File(zkEvmBinInDirAbove).exists()) {
defaultZkEvm = zkEvmBinInDirAbove;
return;
}

log.warn("Could not find default path for zkevm.bin");
log.warn("Could not find default path for {}", binName());
}

private String binName() {
return System.getenv("ZKEVM_BIN") != null ? System.getenv("ZKEVM_BIN") : ZK_EVM_BIN;
}
}
2 changes: 1 addition & 1 deletion linea-constraints
Submodule linea-constraints updated 33 files
+2 −6 Makefile
+1 −7 exp/constraints.lisp
+12 −12 gas/columns.lisp
+0 −7 hub/columns/consistency.lisp
+5 −0 hub/columns/shared.lisp
+2 −0 hub/columns/transaction.lisp
+4 −4 hub/constants.lisp
+186 −0 hub/constraints/consistency/account.lisp
+0 −81 hub/constraints/consistency/account/columns.lisp
+0 −167 hub/constraints/consistency/account/constraints.lisp
+119 −0 hub/constraints/consistency/context.lisp
+0 −71 hub/constraints/consistency/context/columns.lisp
+0 −51 hub/constraints/consistency/context/constraints.lisp
+70 −0 hub/constraints/consistency/execution_environment.lisp
+0 −40 hub/constraints/consistency/execution_environment/columns.lisp
+0 −34 hub/constraints/consistency/execution_environment/constraints.lisp
+80 −0 hub/constraints/consistency/stack.lisp
+0 −41 hub/constraints/consistency/stack/columns.lisp
+0 −47 hub/constraints/consistency/stack/constraints.lisp
+178 −0 hub/constraints/consistency/storage.lisp
+0 −63 hub/constraints/consistency/storage/columns.lisp
+0 −131 hub/constraints/consistency/storage/constraints.lisp
+3 −1 hub/constraints/generalities/gas.lisp
+21 −25 hub/constraints/generalities/refunds.lisp
+6 −6 hub/constraints/heartbeat/ABS_TX_NUM_and_BTC_NUM.lisp
+7 −5 hub/constraints/instruction-handling/halting/selfdestruct.lisp
+94 −99 hub/constraints/tx_finl/constraints.lisp
+111 −112 hub/constraints/tx_init/constraints.lisp
+2 −2 hub/lookups/hub_into_gas.lisp
+1 −2 hub/lookups/hub_into_stp.lisp
+1 −1 hub/lookups/hub_into_txn_data.lisp
+2 −19 mmu/constraints.lisp
+3 −0 shakiradata/constraints.lisp
6 changes: 6 additions & 0 deletions reference-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ tasks.register('referenceGeneralStateTests', Test) {

dependsOn generateGeneralStateReferenceTests

systemProperties["junit.jupiter.execution.timeout.default"] = "5 m" // 5 minutes
systemProperties["junit.jupiter.execution.parallel.enabled"] = true
systemProperties["junit.jupiter.execution.parallel.mode.default"] = "concurrent"
systemProperties["junit.jupiter.execution.parallel.mode.classes.default"] = "concurrent"
maxParallelForks = Runtime.getRuntime().availableProcessors()

boolean isCiServer = System.getenv().containsKey("CI")
minHeapSize = "4g"
maxHeapSize = isCiServer ? "32g" : "8g"
Expand Down
Loading