-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f6c389
commit fc8c070
Showing
5 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Verify proofs by means of proof-producer | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build-and-test: | ||
name: "Verify proofs by means of proof-producer" | ||
runs-on: [self-hosted, Linux, X64, aws_autoscaling] | ||
steps: | ||
# https://github.com/actions/checkout/issues/1552 | ||
- name: Clean up after previous checkout | ||
run: chmod +w -R ${GITHUB_WORKSPACE}; rm -rf ${GITHUB_WORKSPACE}/*; | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run checks for proofs-verification | ||
run: | | ||
nix build -L .?#checks.x86_64-linux.verify-proofs | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
boost, | ||
gdb, | ||
lldb, | ||
mold, | ||
cmake_modules, | ||
enableDebugging, | ||
enableDebug ? false, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ lib, | ||
stdenv, | ||
ninja, | ||
pkg-config, | ||
cmake, | ||
boost, | ||
gdb, | ||
lldb, | ||
mold, | ||
protobuf, | ||
glibc, | ||
cmake_modules, | ||
enableDebugging, | ||
enableDebug ? false, | ||
staticBuild ? false, | ||
sanitize ? false, | ||
crypto3_tests ? false, | ||
proof-producer | ||
}: | ||
let | ||
inherit (lib) optional; | ||
in stdenv.mkDerivation rec { | ||
name = "Proof verifier test"; | ||
pname = "proof-verifier-test"; | ||
|
||
src = lib.sourceByRegex ./. [ "^crypto3(/.*)?$" "CMakeLists.txt" ]; | ||
hardeningDisable = [ "fortify" ]; | ||
|
||
nativeBuildInputs = [ cmake ninja pkg-config ] ++ | ||
(lib.optional (!stdenv.isDarwin) gdb) ++ | ||
(lib.optional (stdenv.isDarwin) lldb); | ||
|
||
# enableDebugging will keep debug symbols in boost | ||
propagatedBuildInputs = [ (if enableDebug then (enableDebugging boost) else boost) ]; | ||
|
||
buildInputs = [cmake_modules protobuf] ++ | ||
( lib.optional (staticBuild) glibc.static ); | ||
|
||
cmakeFlags = | ||
[ | ||
"-DBUILD_CRYPTO3_TESTS=TRUE" | ||
(if sanitize then "-DSANITIZE=ON" else "-DSANITIZE=OFF") | ||
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" # to allow VSCode navigation/completion/etc | ||
"-G Ninja" | ||
]; | ||
|
||
buildPhase = '' | ||
ninja blueprint_zkevm_bbf_hardhat_test | ||
./crypto3/libs/blueprint/test/blueprint_zkevm_bbf_hardhat_test -- --print | ||
''; | ||
|
||
cmakeBuildType = if enableDebug then "Debug" else "Release"; | ||
doCheck = true; | ||
|
||
test_names = [ | ||
"zkevm_bbf_hardhat_keccak_copy" | ||
"zkevm_bbf_hardhat_minimal_math_zkevm" | ||
"zkevm_bbf_hardhat_minimal_math_rw" | ||
"zkevm_bbf_hardhat_minimal_math_bytecode" | ||
|
||
"zkevm_bbf_hardhat_calldatacopy_copy" | ||
"zkevm_bbf_hardhat_exp_copy" | ||
"zkevm_bbf_hardhat_exp_rw" | ||
"zkevm_bbf_hardhat_minimal_math_copy" | ||
"zkevm_bbf_hardhat_modular_operations_copy" | ||
]; | ||
|
||
checkPhase = '' | ||
for test_name in ${lib.concatMapStringsSep " " lib.escapeShellArg test_names}; do | ||
set -x | ||
echo "Running ''${test_name}" | ||
${proof-producer}/bin/proof-producer-multi-threaded -l trace \ | ||
--stage "all" \ | ||
--circuit "''${test_name}_circuit.crct" \ | ||
--assignment-table="''${test_name}_table.tbl" -q 20 | ||
done | ||
''; | ||
|
||
dontInstall = true; | ||
installPhase = "true"; | ||
|
||
shellHook = '' | ||
PS1="\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ " | ||
echo "Welcome to verify-proofs environment!" | ||
''; | ||
} |