Skip to content

Commit

Permalink
Add assigner executable
Browse files Browse the repository at this point in the history
  • Loading branch information
akokoshn committed Apr 3, 2024
1 parent 77c8c13 commit f698a5d
Show file tree
Hide file tree
Showing 11 changed files with 563 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "assigner"]
path = libs/assigner
url = https://github.com/NilFoundation/evm1-assigner
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
cmake_minimum_required(VERSION 3.27)

project(zkEVM-framework)

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})

option(BUILD_DOCS "Build documentation" FALSE)
option(ENABLE_TESTS "Enable tests" FALSE)
option(ENABLE_ASSIGNER "Enable assigner executable" FALSE)

add_subdirectory(libs)
add_subdirectory(bin)

if(BUILD_DOCS)
find_package(Doxygen REQUIRED)
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Framework for test verification of state of claster based on EVM
* intx: GMP (intx dependency) [Homepage](https://gmplib.org/), intx [Repository](https://github.com/chfast/intx)
* SSZ++ [Repository](https://github.com/OffchainLabs/sszpp)

### EVM based assigner

* assigner [EVM based assigner](https://github.com/NilFoundation/evm-assigner)

## Nix environment

Instead of installing all dependencies manually,
Expand All @@ -28,6 +32,11 @@ you can activate [Nix](https://nixos.org/download#download-nix) environment with
```plain
nix develop
```
## Clone

```plain
git clone --recurse-submodules https://github.com/NilFoundation/zkEVM-framework.git
```

## Build

Expand All @@ -41,6 +50,24 @@ Or with Nix:
```bash
nix build
```
## Assigner executable

### Build dependency

```bash
cd libs/assigner
cmake -G "Ninja" -B build .
cmake --build build
cmake --install build
cd ../..
```

### Build executable

```bash
cmake -G "Ninja" -B build -DENABLE_ASSIGNER=TRUE .
cmake --build build
```

## Test

Expand Down
6 changes: 6 additions & 0 deletions bin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if(NOT Boost_FOUND)
find_package(Boost COMPONENTS REQUIRED filesystem log log_setup program_options thread system)
endif()
if (ENABLE_ASSIGNER)
add_subdirectory(assigner)
endif()
20 changes: 20 additions & 0 deletions bin/assigner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SSZ++ requires C++23
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED True)

set(TARGET_NAME assigner)
set(SOURCES
src/main.cpp)

add_executable(${TARGET_NAME} ${SOURCES})

set(ASSIGNER_INCLUDES /var/empty/local/include)
set(ASSIGNER_LIBS /var/empty/local/lib)
target_include_directories(${TARGET_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../libs/data_types/include>
$<$<BOOL:${Boost_FOUND}>:${Boost_INCLUDE_DIRS}>
${ASSIGNER_INCLUDES})

target_link_directories(${TARGET_NAME} PRIVATE ${ASSIGNER_LIBS})
target_link_libraries(${TARGET_NAME} PRIVATE evmone zkEVMDataTypes ${Boost_LIBRARIES})
Loading

0 comments on commit f698a5d

Please sign in to comment.