Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

147 keccak round bbf #148

Open
wants to merge 142 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
f259711
keccak_round in bbf
Valeh2012 Nov 8, 2024
0529a08
formatting
Valeh2012 Nov 8, 2024
3aba0bd
keccak dynamic not finished
Valeh2012 Nov 28, 2024
ff63d01
keccak round no last_round
Valeh2012 Dec 10, 2024
0e68527
keccak dynamic incomplete
Valeh2012 Dec 17, 2024
b36b88e
allow workflow for merge queue
AndreyMlashkin Nov 11, 2024
b3ba60d
reduce prover memory usage
oclaw Nov 7, 2024
7fc7852
partial proof: restore commitment scheme
oclaw Nov 12, 2024
21d40a3
fix compile warnings
oclaw Nov 12, 2024
24d7d83
fix redundant parallel-crypto3 test build
oclaw Nov 12, 2024
0296f3e
Add a class for lookup input constraints.
martun Nov 5, 2024
887768a
add sanitizers for crypto3
AndreyMlashkin Sep 16, 2024
3b0fd6d
remove testing of nightly from regular build; restore normal pull req…
AndreyMlashkin Nov 25, 2024
51fa1a7
fix test parsing issue
AndreyMlashkin Nov 25, 2024
dbc493c
add parallel-crypto3 to derivation named all
AndreyMlashkin Nov 25, 2024
6d21a87
correct review notes
AndreyMlashkin Nov 26, 2024
cc69605
use BOOST_CHECK_EQUAL
AndreyMlashkin Nov 26, 2024
fbdc0be
correct review notes
AndreyMlashkin Nov 26, 2024
9d17b09
implement benchmarks derivation
AndreyMlashkin Nov 26, 2024
8f44892
fix error, when CMAKE_BUILD_TYPE is not defined
AndreyMlashkin Nov 26, 2024
a337f5e
fixed error CData section too big
AndreyMlashkin Nov 26, 2024
ace44f7
review notes
AndreyMlashkin Nov 27, 2024
ada7589
Fix creation of FRI params.
martun Nov 27, 2024
d8b958b
reenable zk/lpc test
AndreyMlashkin Nov 27, 2024
6c9e7fd
fix error around CMAKE_BUILD_TYPE
AndreyMlashkin Nov 28, 2024
9209fd6
rm block ciphers
vo-nil Nov 27, 2024
2e3fc90
Renamed guards and added checks agains non-parallel crypto3
vo-nil Oct 10, 2024
ba1f5e2
pragma once removed
vo-nil Oct 10, 2024
a3cf147
crypto3: merge branch 95_rw_in_bbf
akokoshn Dec 3, 2024
a190eb2
proof-producer: enable bbf circuits
akokoshn Dec 3, 2024
d3b32bc
proof-producer: fix clang warnings
oclaw Dec 3, 2024
75465b7
forbid warnings in proof-producer
AndreyMlashkin Dec 3, 2024
241ae34
fix proof-producer build warnings
oclaw Dec 3, 2024
ddb4685
support copy circuit
oclaw Nov 27, 2024
143dc07
implement develop derivation
AndreyMlashkin Nov 29, 2024
bfae218
make develop derivation based on proof-producer
AndreyMlashkin Dec 2, 2024
7f13b02
correct review notes
AndreyMlashkin Dec 3, 2024
417c1fb
fix rw trace deserialize
oclaw Dec 4, 2024
cdea5b6
fix warnings
oclaw Dec 4, 2024
083db78
Replace usage of array_list with standard_array_list #132
vo-nil Nov 1, 2024
1a1b89f
use newest evm-placeholder-verification
AndreyMlashkin Dec 4, 2024
d572747
proof-producer: add bytecode, rw, copy, zkevm tests
akokoshn Dec 2, 2024
95a5af6
Remove crypto3::zk from crypto3::common
akokoshn Dec 4, 2024
471c50d
proof-producer: avoid hardcode proof-producer includes
akokoshn Dec 5, 2024
41ee355
proof-producer: fix build tests output_artefacts
akokoshn Dec 5, 2024
85019e0
proof-producer: disable satisfiability_check in zkevm_bbf bytecide, r…
akokoshn Dec 5, 2024
faf27c2
Merge 95 with master
ETatuzova Dec 5, 2024
9f4ee25
Replaced asserts with exceptions so they are thrown at release #126
vo-nil Nov 1, 2024
9dff64d
init RLC challenge for copy circuit
oclaw Dec 5, 2024
d718f67
This leaves only essential hash algorithms:
vo-nil Dec 6, 2024
a3272c4
Removed unused files from parallel-crypto3
vo-nil Dec 9, 2024
9eae862
Removed kate plonk system
vo-nil Dec 9, 2024
32b2462
Split trace files
makxenov Dec 5, 2024
b110e17
precompile some headers
AndreyMlashkin Nov 29, 2024
848d8c5
use mold for faster linking
AndreyMlashkin Dec 4, 2024
dc98672
move benchmarks in parallel-crypto3
AndreyMlashkin Dec 6, 2024
4da44a0
optimize proof-producer precompiled headers
AndreyMlashkin Dec 6, 2024
bdfd09c
fix verify-proof ci job
AndreyMlashkin Dec 9, 2024
67c7203
fix warning
AndreyMlashkin Dec 10, 2024
578049d
Use C++20 everywhere
ioxid Nov 26, 2024
07f0ba0
transpiler/test: increase constexpr computation limit for gcc
ioxid Nov 29, 2024
d57b798
Multiprecision refactoring
ioxid Oct 11, 2024
d54888e
Reintroduce some asserts in import export
ioxid Nov 15, 2024
90e2550
placeholder refactor
ioxid Nov 25, 2024
ffe10f6
marshalling::multiprecision refactor
ioxid Nov 26, 2024
0b6a58e
Refactor big_int for algebra
ioxid Nov 25, 2024
ecee5bf
Fix literals kimchi, poseidon, polynomial_dfs and polynomial_dfs_view
ioxid Nov 27, 2024
fdb9ae3
multiprecision: update benchmarks
ioxid Dec 3, 2024
6f29d7b
Add base() calls
ioxid Nov 27, 2024
c7c1b8c
move old backend into subdirectory, move new backend into multiprecis…
ioxid Dec 6, 2024
4c2b804
move big_mod.hpp to multiprecision root
ioxid Dec 6, 2024
5a47ee8
rename _bigui to _big_uint
ioxid Dec 6, 2024
ba5613c
proof-generator: use zkevm_word_integral_type
ioxid Dec 6, 2024
5246d17
big_mod: pow: support negative exponent
ioxid Dec 9, 2024
87e4331
big_uint, big_mod: optimizations
ioxid Dec 9, 2024
2ec916d
big_uint: fix tests
ioxid Dec 10, 2024
8668c54
Clarify TODO in import_bits_generic
ioxid Dec 10, 2024
5f26931
proof-producer: rw & zkevm check fixes
oclaw Dec 6, 2024
df2d044
don't run benchmarks in regular build
AndreyMlashkin Dec 11, 2024
6491c13
reduce iteration count in a bench test
AndreyMlashkin Dec 11, 2024
2ca4491
remove cmake lines, that are overridden by nix configure
AndreyMlashkin Dec 11, 2024
9b85b0a
fix cmake warning
AndreyMlashkin Dec 11, 2024
fe910b6
A small bug related to creation of evaluation domains of size 1.
martun Dec 11, 2024
d9d8aa4
Fix row selector.
martun Dec 6, 2024
58ce68d
Removed pedersen
vo-nil Dec 11, 2024
3b8a505
make proof-producer binaries static
AndreyMlashkin Dec 11, 2024
d68d24f
RW with multiple transaction test added and one constraint fixed
ETatuzova Dec 11, 2024
b95e8fb
enable proof-producer multi-tx rw test
oclaw Dec 11, 2024
97b256d
enable multi-tx bytecode test
oclaw Dec 12, 2024
a7bfdf3
Changed namespace for marshalling core
vo-nil Dec 12, 2024
738162c
Remove zkevm-framework and evm-assigner
akokoshn Dec 13, 2024
97d5f88
make blueprint use precompiled headers
AndreyMlashkin Dec 12, 2024
e5bb6fa
increase cores limitation
AndreyMlashkin Dec 12, 2024
14a78d9
use the same precompiled header for all proof-producer binaries
AndreyMlashkin Dec 12, 2024
2827935
reintroduce Boost::log for generatorOutputArtifacts
AndreyMlashkin Dec 13, 2024
9411a63
proof-producer: enable zkevm circuit test
oclaw Dec 13, 2024
919f6ad
Removed custom adapter options from adapt_basic_field
vo-nil Dec 9, 2024
22ddc68
add proof-producer-debug-gcc check in CI
AndreyMlashkin Dec 13, 2024
523f297
hotfix
AndreyMlashkin Dec 13, 2024
0e223d5
add more descriptive title to CI jobs
AndreyMlashkin Dec 13, 2024
d856358
only build proof-producer executable and not run the tests
AndreyMlashkin Dec 13, 2024
04c4642
move proof-producer debug build to nightliy
AndreyMlashkin Dec 16, 2024
635a09a
correct code review notes
AndreyMlashkin Dec 16, 2024
7adba12
multiprecision: restructure directories
ioxid Dec 10, 2024
5b91f40
multiprecisoin: simplify intel_intrinsics.hpp
ioxid Dec 11, 2024
0f1150d
multiprecision: fix pow(..., INT_MIN)
ioxid Dec 11, 2024
ec0d5c2
multiprecision: rename exp to pow
ioxid Dec 11, 2024
17e026f
multiprecision: big_uint: add std::hash specialization
ioxid Dec 11, 2024
dba84e7
multiprecision: big_uint: refactor comparision operators
ioxid Dec 11, 2024
9f7ce88
multiprecision: big_mod: refactor comparision operators
ioxid Dec 11, 2024
2aaa739
multiprecision: big_uint: make used_limbs() and order() private
ioxid Dec 12, 2024
8cd7c64
multiprecision: big_uint: fix increment
ioxid Dec 12, 2024
184e807
multiprecision: fix spelling
ioxid Dec 12, 2024
3e01f5b
multiprecision: big_uint: refactor operators
ioxid Dec 12, 2024
b131657
multiprecision: test: enable some tests
ioxid Dec 13, 2024
3782edb
multiprecision: test: use generated data in tests
ioxid Dec 13, 2024
f527dda
multiprecision: big_uint: remove cpp_int_conversions.hpp and tests
ioxid Dec 14, 2024
a07f8ec
multiprecision: cleanup
ioxid Dec 14, 2024
4ad29f5
multiprecision: big_mod: refactor
ioxid Dec 15, 2024
5a779c5
multiprecision: big_uint: fix add
ioxid Dec 16, 2024
29cdd64
multiprecision: move all operators into class definitions
ioxid Dec 16, 2024
18359c7
Create a class gate optimizer which will be responsible for making op…
martun Nov 13, 2024
ee0d563
Adding a test
martun Dec 2, 2024
2f3c74b
Remove unnecessary comment.
martun Dec 3, 2024
fd2cd45
bn bbf poseidon
Nov 5, 2024
b76b4b5
poseidon bbf constraints update
Nov 28, 2024
5589a2e
Initial parameter processing
ayashunsky Oct 23, 2024
46571ae
More progress
ayashunsky Oct 25, 2024
3a6f19f
Interfaces reorganized
ayashunsky Nov 23, 2024
f12eae6
In transition to zk assignment table
ayashunsky Nov 26, 2024
5865b91
Now with satisfiability check
ayashunsky Nov 28, 2024
229e3fe
Circuit builder applied to poseidon
ayashunsky Nov 30, 2024
2dc977c
Incorporate gate_optimizer
ayashunsky Dec 3, 2024
bce293c
Really use gate optimizer
ayashunsky Dec 3, 2024
7d891fc
Now with lookup table placement and proofs
ayashunsky Dec 6, 2024
b81f1b2
Minor changes before rebase
ayashunsky Dec 11, 2024
9e27160
Fixing after rebase
ayashunsky Dec 13, 2024
d909670
Fixing bug in gate optimizer, did not change selector indexes.
martun Dec 13, 2024
bedee9e
Remove bbf_wrapper legacy
ayashunsky Dec 16, 2024
755d2e0
opcode_poc under circuit_builder
ayashunsky Dec 16, 2024
744495a
keccak_dynamic w circuit builder
Valeh2012 Dec 17, 2024
c98b10c
Updates to table packing alg in circuit builder
ayashunsky Dec 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/check-proof-producer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ jobs:
always() && !cancelled() &&
(needs.build-and-generate-proofs.result == 'success' || needs.build-and-generate-proofs.result == 'skipped') &&
(needs.prepare-targets.result == 'success' || needs.prepare-targets.result == 'skipped')
uses: NilFoundation/evm-placeholder-verification/.github/workflows/reusable-verify-proofs.yml@2a0ef5fc67e97be8e3c7b59338cf9eecd030c57d
uses: NilFoundation/evm-placeholder-verification/.github/workflows/reusable-verify-proofs.yml@a68465f641680eccc43ebdae02810eeab0537954
with:
artifact-name: ${{ needs.build-and-generate-proofs.outputs.artifact-name }}
evm-placeholder-verification-ref: 2a0ef5fc67e97be8e3c7b59338cf9eecd030c57d
evm-placeholder-verification-ref: a68465f641680eccc43ebdae02810eeab0537954
test-names: ${{ needs.prepare-targets.outputs.evm-targets }}
2 changes: 1 addition & 1 deletion .github/workflows/clang-linux-nix-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
nix build -L .?#checks.x86_64-linux.crypto3-clang
env:
NIX_CONFIG: |
cores = 4
cores = 16

- name: Run all checks
# This includes cached crypto3 check from previous step. We don't limit cores in this part
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/clang-sanitizers-linux-nix-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Test sanitizers on Linux with clang

on:
workflow_call:

jobs:
build-and-test:
name: "Build and test Linux with clang"
runs-on: [self-hosted, Linux, X64, aws_autoscaling]
continue-on-error: true
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
run: |
nix build -L .?#checks.x86_64-linux.all-clang-sanitize
mkdir results
cp result/test-logs/*_test.xml results/
env:
NIX_CONFIG: |
cores = 16

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
with:
check_name: "Sanitizers Test Results"
files: "results/*.xml"
comment_mode: ${{ github.event.pull_request.head.repo.fork && 'off' || 'always' }} # Don't create PR comment from fork runs
action_fail_on_inconclusive: true # fail, if no reports

23 changes: 23 additions & 0 deletions .github/workflows/gcc-debug-proof-producer-nix-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build and run on Linux Platforms

on:
workflow_call:

jobs:
build-and-run:
name: "Build proof-producer binary in debug mode"
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: Build and run proof-producer in debug mode
run: |
nix run .#multi-threaded -- --help
nix run .#single-threaded -- --help
6 changes: 1 addition & 5 deletions .github/workflows/gcc-linux-nix-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ jobs:
nix build -L .?#checks.x86_64-linux.crypto3-gcc
env:
NIX_CONFIG: |
cores = 4

cores = 16
- name: Run all checks
# This includes cached crypto3 check from previous step. We don't limit cores in this part
run: |
nix build -L .?#checks.x86_64-linux.all-gcc
mkdir results
cp result/test-logs/*_test.xml results/
env:
NIX_CONFIG: |
cores = 16

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Nightly Testing

on:
schedule:
- cron: '0 0 * * *'

jobs:
test-linux-sanitizers:
name: Linux placeholder testing and sanitize with clang
uses: ./.github/workflows/clang-sanitizers-linux-nix-check.yml
if: |
always() && !cancelled()
secrets: inherit

test-linux-proof-producer-debug-gcc:
name: Gcc debug proof-producer Linux testing
uses: ./.github/workflows/gcc-debug-proof-producer-nix-check.yml
if: |
always() && !cancelled()
secrets: inherit

post-telemetry:
name: Post test results in Open Telemetry format
runs-on: [self-hosted, Linux, X64, aws_autoscaling]
needs:
- test-linux-sanitizers
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Post logs to Sig Noz
run: |
ls -l -a
nix build -L .?#checks.x86_64-linux.all-clang-sanitize
cat ./result/test-logs/test_errors.txt
export UndefinedBehaviorSanitizer=$(grep UndefinedBehaviorSanitizer result/test-logs/test_errors.txt | wc -l)
export AddressSanitizer=$(grep AddressSanitizer result/test-logs/test_errors.txt | wc -l)
export LeakSanitizer=$(grep LeakSanitizer result/test-logs/test_errors.txt | wc -l)
export OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
python3 --version
sudo yum update -y
sudo yum install -y python3-pip
pip3 install -r requirements.txt
/home/ec2-user/.local/bin/opentelemetry-instrument \
--traces_exporter console,otlp \
--metrics_exporter console,otlp \
--logs_exporter console,otlp \
--service_name nightly-build \
python3 ./parse_tests.py

6 changes: 3 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: PR Testing

on:
pull_request:
merge_group:
push:
branches:
- master
Expand All @@ -16,14 +17,14 @@ concurrency:

jobs:
test-linux-gcc:
name: Linux placeholder testing with gcc
name: Gcc release full Linux testing
uses: ./.github/workflows/gcc-linux-nix-check.yml
if: |
always() && !cancelled()
secrets: inherit

test-linux-clang:
name: Linux placeholder testing with clang
name: Clang release full Linux testing
uses: ./.github/workflows/clang-linux-nix-check.yml
if: |
always() && !cancelled()
Expand All @@ -42,4 +43,3 @@ jobs:
if: |
always() && !cancelled()
secrets: inherit

15 changes: 6 additions & 9 deletions .github/workflows/verify-circuit-proof.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,27 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure
run: cd crypto3 && mkdir build && cd build && cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=TRUE -DBUILD_CRYPTO3_TESTS=TRUE -G Ninja
run: mkdir build && cd build && cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=TRUE -DBUILD_CRYPTO3_TESTS=TRUE -G Ninja
shell: nix develop .#crypto3-tests --command bash -e {0}
- name: Build
run: cd crypto3/build && ninja transpiler_evm_test
run: cd build && ninja transpiler_evm_test
shell: nix develop .#crypto3-tests --command bash -e {0}
- name: Execute
run: cd crypto3/build && ./libs/transpiler/test/transpiler_evm_test -- --save-proof-data
run: cd build && ./crypto3/libs/transpiler/test/transpiler_evm_test -- --save-proof-data
shell: nix develop .#crypto3-tests --command bash -e {0}
cd crypto3 && eval "$configurePhase"
nix develop -c ninja transpiler_evm_test
nix develop -c ./libs/transpiler/test/transpiler_evm_test -- --save-proof-data
- name: Publish Proofs
uses: actions/upload-artifact@v4
with:
name: proofs
path: crypto3/build/circuit*
path: build/circuit*
if-no-files-found: error

verify-proofs:
name: Verify proofs
needs:
- produce-proofs
if: needs.produce-proofs.result == 'success'
uses: NilFoundation/evm-placeholder-verification/.github/workflows/verify-proof.yml@e5a8dffd6b00d3c036c9b5c09c06b10515e4785c
uses: NilFoundation/evm-placeholder-verification/.github/workflows/verify-proof.yml@a68465f641680eccc43ebdae02810eeab0537954
with:
evm-placeholder-verification-ref: e5a8dffd6b00d3c036c9b5c09c06b10515e4785c
evm-placeholder-verification-ref: a68465f641680eccc43ebdae02810eeab0537954

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
.*.lb
*.csv

#protobuf generated files
*pb.h
*pb.cc

## Intermediate documents:
*.dvi
*.xdv
Expand Down Expand Up @@ -626,7 +630,6 @@ callgrind.*
/*.c
/*.cpp
/*.h
/*.py
/*.key
/*.pem
/*.der
Expand Down
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options (-fcolor-diagnostics)
endif ()

if(DEFINED CMAKE_BUILD_TYPE AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
if(DEFINED CMAKE_BUILD_TYPE)
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -ggdb")
set(BOOST_FORCEINLINE "OFF") # improves debugging traces
endif()
endif()

option(SANITIZE "Build sanitizers" FALSE)
Expand All @@ -19,12 +21,20 @@ if(${SANITIZE})
add_link_options(-fsanitize=undefined,address,leak)
endif()

# Add dummy target for the more efficient reusing of precompiled headers
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generated-dummy.cpp)
add_library(crypto3_precompiled_headers STATIC ${CMAKE_CURRENT_BINARY_DIR}/generated-dummy.cpp)
set_target_properties(crypto3_precompiled_headers PROPERTIES
LINKER_LANGUAGE CXX
CXX_STANDARD 20
CXX_STANDARD_REQUIRED TRUE
)

add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/crypto3")
if ((${PARALLEL_CRYPTO3_ENABLE}) OR (${PROOF_PRODUCER_ENABLE}) OR (${ZKEVM_FRAMEWORK_ENABLE}))
if ((${PARALLEL_CRYPTO3_ENABLE}) OR (${PROOF_PRODUCER_ENABLE}))
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/parallel-crypto3")
endif()
if ((${PROOF_PRODUCER_ENABLE}) OR (${ZKEVM_FRAMEWORK_ENABLE}))
if (${PROOF_PRODUCER_ENABLE})
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/proof-producer")
endif()
if (${DEBUG_TOOLS_ENABLE})
Expand Down
11 changes: 9 additions & 2 deletions crypto3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
boost,
gdb,
lldb,
mold,
cmake_modules,
enableDebugging,
enableDebug ? false,
runTests ? false,
sanitize ? false,
benchmarkTests ? false,
}:
let
inherit (lib) optional;
Expand All @@ -32,19 +34,24 @@ in stdenv.mkDerivation {
cmakeFlags =
[
(if runTests then "-DBUILD_CRYPTO3_TESTS=TRUE" else "-DBUILD_CRYPTO3_TESTS=False")
(if enableDebug then "-DCMAKE_BUILD_TYPE=Debug" else "-DCMAKE_BUILD_TYPE=Release")
(if sanitize then "-DSANITIZE=ON" else "-DSANITIZE=OFF")
(if benchmarkTests then "-DBUILD_CRYPTO3_BENCH_TESTS=ON" else "-DBUILD_CRYPTO3_BENCH_TESTS=OFF")
"-G Ninja"
];

cmakeBuildType = if enableDebug then "Debug" else "Release";
doCheck = runTests; # tests are inside crypto3-tests derivation

checkPhase = ''
# JUNIT file without explicit file name is generated after the name of the master test suite inside `CMAKE_CURRENT_SOURCE_DIR`
export BOOST_TEST_LOGGER=JUNIT:HRF
cd crypto3 && ctest --verbose --output-on-failure -R && cd ..
cd crypto3
# remove || true after all tests are fixed under clang-sanitizers check:
ctest --verbose --output-on-failure -R > test_errors.txt || true
cd ..
mkdir -p ${placeholder "out"}/test-logs
find .. -type f -name '*_test.xml' -exec cp {} ${placeholder "out"}/test-logs \;
cp crypto3/test_errors.txt ${placeholder "out"}/test-logs \
'';

shellHook = ''
Expand Down
2 changes: 1 addition & 1 deletion crypto3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# http://www.boost.org/LICENSE_1_0.txt
#---------------------------------------------------------------------------#

cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.22 FATAL_ERROR)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

Expand Down
5 changes: 3 additions & 2 deletions crypto3/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ macro(define_benchmark benchmark)

set_target_properties(${full_name}
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD 20
CXX_STANDARD_REQUIRED TRUE)

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
Expand All @@ -49,6 +49,7 @@ macro(define_benchmark benchmark)
target_compile_options(${full_name} PRIVATE "-fconstexpr-ops-limit=4294967295")
endif()

target_precompile_headers(${full_name} REUSE_FROM crypto3_precompiled_headers)
endmacro()

set(BENCHMARK_NAMES
Expand All @@ -59,9 +60,9 @@ set(BENCHMARK_NAMES
"math/polynomial_dfs"

"multiprecision/modular_adaptor_fixed"
"multiprecision/big_int"

"zk/lpc"
"zk/pedersen"
)

foreach(BENCHMARK_NAME ${BENCHMARK_NAMES})
Expand Down
2 changes: 1 addition & 1 deletion crypto3/benchmarks/algebra/curves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void benchmark_curve_operations(std::string const& curve_name)
return A *= B;
});

if constexpr (has_template_g2_type<curve_type>::value) {
if constexpr (has_type_g2_type<curve_type>::value) {
using g2_type = typename curve_type::template g2_type<>;

using g2_field = typename g2_type::field_type;
Expand Down
Loading