Skip to content

Commit

Permalink
Resolved review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
HristoStaykov committed Mar 8, 2024
1 parent d23c925 commit 65fec7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions vendor/zkllvm-metacraft-circuits/docs/compute_shuffled_index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
Compute shuffled index documentation.
# Compute shuffled index documentation.

1. Implementation. The implementation code of the circuit is under "DendrETH/vendor/zkllvm-metacraft-circuits/src/circuits_impl/".
### *Implementation*
The implementation code of the circuit is under "DendrETH/vendor/zkllvm-metacraft-circuits/src/circuits_impl/".
This code is used in both the compilation as circuit and as executable.

2. Circuit build. In order to build as circuit, we need an entry point marked with the [[circuit]] directive. This is done through a wrapper
### *Circuit build*
In order to build as circuit, we need an entry point marked with the `[[circuit]]` directive. This is done through a wrapper
that uses the implementation code and resides in "DendrETH/vendor/zkllvm-metacraft-circuits/src/circuits". Since currently the Crypto3
library does not implement computation of sha256 on a byte buffer, we use a header only library for the sha256 computations, which has
negative performance consequences.

3. Executable build + tests. The implementation code of the circuit is compiled as executable and tested against the input data from
### *Executable build + tests*
The implementation code of the circuit is compiled as executable and tested against the input data from
https://github.com/ethereum/consensus-spec-tests.git. The tests reside in "DendrETH/vendor/zkllvm-metacraft-circuits/src/tests/compute_shuffled_index_test/".
For convenience, we have a script that performs all necessary steps to run the test -> "DendrETH/vendor/zkllvm-metacraft-circuits/scripts/compile_and_run_tests.sh".
It is required that docker is installed on the machine that will run the tests.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ add_dependencies(template compute_shuffled_index)
add_dependencies(template weigh_justification_and_finalization)

add_custom_command(TARGET compute_shuffled_index POST_BUILD
COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/compute_shuffled_index.json ${CMAKE_CURRENT_BINARY_DIR}
COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/compute_shuffled_index.json ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS compile_commands.json
VERBATIM ON
)

0 comments on commit 65fec7c

Please sign in to comment.