Skip to content

Commit

Permalink
zkevm-framework: enable partial proof in assigner
Browse files Browse the repository at this point in the history
  • Loading branch information
akokoshn committed Sep 19, 2024
1 parent 270e816 commit a428b4e
Show file tree
Hide file tree
Showing 8 changed files with 250 additions and 114 deletions.
8 changes: 8 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,24 @@
enableDebug = false;
crypto3 = crypto3;
evm-assigner = evm-assigner;
transpiler = transpiler;
proof-producer = proof-producer;
});
zkevm-framework-tests = (pkgs.callPackage ./zkevm-framework/zkevm-framework.nix {
runTests = true;
enableDebug = false;
crypto3 = crypto3;
evm-assigner = evm-assigner;
transpiler = transpiler;
proof-producer = proof-producer;
});
zkevm-framework-debug-tests = (pkgs.callPackage ./zkevm-framework/zkevm-framework.nix {
enableDebug = true;
runTests = true;
crypto3 = crypto3;
evm-assigner = evm-assigner;
transpiler = transpiler;
proof-producer = proof-producer;
});

transpiler = (pkgs.callPackage ./transpiler/transpiler.nix {
Expand Down Expand Up @@ -186,6 +192,8 @@
enableDebug = false;
crypto3 = packages.crypto3;
evm-assigner = evm-assigner-gcc;
transpiler = transpiler-gcc;
proof-producer = proof-producer-gcc;
});

transpiler-gcc = (pkgs.callPackage ./transpiler/transpiler.nix {
Expand Down
19 changes: 19 additions & 0 deletions proof-producer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,22 @@ set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/bin/proof-producer")

include(CPack)

# INSTALL

set(CONFIG_PATH ${CMAKE_INSTALL_LIBDIR}/cmake/proof-producer)
set(TARGET_NAMESPACE crypto3::)
install(EXPORT proof-producerTargets NAMESPACE ${TARGET_NAMESPACE} DESTINATION ${CONFIG_PATH})

include(CMakePackageConfigHelpers)
configure_package_config_file(
cmake/Config.cmake.in
proof-producer-config.cmake
INSTALL_DESTINATION ${CONFIG_PATH}
)

install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/proof-producer-config.cmake
DESTINATION ${CONFIG_PATH}
)
26 changes: 26 additions & 0 deletions proof-producer/bin/proof-producer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ function(setup_proof_generator_target)
src/main.cpp
)

add_library(${ARG_TARGET_NAME}-lib INTERFACE)

# Make sure to add these dependencies before the others, since for multi-threaded version dependency on
# actor-zk must come first.
if(ARG_ADDITIONAL_DEPENDENCIES)
foreach(lib IN LISTS ARG_ADDITIONAL_DEPENDENCIES)
target_link_libraries(${ARG_TARGET_NAME} ${lib})
target_link_libraries(${ARG_TARGET_NAME}-lib INTERFACE ${lib})
endforeach()
endif()

Expand All @@ -65,6 +68,11 @@ function(setup_proof_generator_target)
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_include_directories(${ARG_TARGET_NAME}-lib INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(${ARG_TARGET_NAME}
crypto3::all

Expand All @@ -75,14 +83,32 @@ function(setup_proof_generator_target)
Boost::program_options
Boost::thread
)

target_link_libraries(${ARG_TARGET_NAME}-lib INTERFACE
crypto3::all

crypto3::transpiler

Boost::filesystem
Boost::log
Boost::program_options
Boost::thread
)
endfunction()

# Declare single-threaded target
set(SINGLE_THREADED_TARGET "${CURRENT_PROJECT_NAME}-single-threaded")
setup_proof_generator_target(TARGET_NAME ${SINGLE_THREADED_TARGET})


# Declare multi-threaded target
set(MULTI_THREADED_TARGET "${CURRENT_PROJECT_NAME}-multi-threaded")
setup_proof_generator_target(TARGET_NAME ${MULTI_THREADED_TARGET} ADDITIONAL_DEPENDENCIES actor::zk)

install(TARGETS ${SINGLE_THREADED_TARGET} ${MULTI_THREADED_TARGET} RUNTIME DESTINATION bin)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# Install library
install(TARGETS ${SINGLE_THREADED_TARGET}-lib ${MULTI_THREADED_TARGET}-lib EXPORT proof-producerTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})
7 changes: 7 additions & 0 deletions proof-producer/cmake/Config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(crypto3 REQUIRED)
find_dependency(crypto3_transpiler)

include("${CMAKE_CURRENT_LIST_DIR}/proof-producerTargets.cmake")
3 changes: 3 additions & 0 deletions zkevm-framework/bin/assigner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ target_include_directories(${TARGET_NAME}
${CMAKE_CURRENT_SOURCE_DIR}/include
)

find_package(proof-producer REQUIRED)

target_link_libraries(${TARGET_NAME}
PRIVATE
zkEVMPreset
zkEVMAssignerRunner
zkEVMJsonHelpers
zkEVMOutputArtifacts
crypto3::proof-producer-single-threaded-lib
Boost::program_options
Boost::log
Boost::random
Expand Down
Loading

0 comments on commit a428b4e

Please sign in to comment.