Skip to content

Commit

Permalink
Merge pull request #400 from clearmatics/develop
Browse files Browse the repository at this point in the history
v0.8 - Drachma
  • Loading branch information
AntoineRondelet authored Aug 26, 2021
2 parents 8247fc3 + 9b193b4 commit a0f89b2
Show file tree
Hide file tree
Showing 136 changed files with 2,668 additions and 1,642 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/dev-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: zeth-ci-dev-docs

on:
push:
branches: [ develop ]

jobs:
build-grpc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Cache grpc
uses: actions/cache@v2
with:
key: grpc-1.31.x-${{ runner.os }}
path: depends/grpc
- name: Build grpc
run: if ! [ -d depends/grpc ] ; then scripts/install-grpc /usr v1.31.x ; fi

build-documentation:
runs-on: ubuntu-20.04
needs: build-grpc
steps:
- name: Checkout repository and install submodules
uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache grpc
uses: actions/cache@v2
with:
key: grpc-1.31.x-${{ runner.os }}
path: depends/grpc
- name: Install dependencies
run: |
sudo apt update -y
source scripts/build_utils.sh
init_platform
cpp_build_setup
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
sudo apt install -y doxygen graphviz
- name: Generatate documentation
run: |
mkdir -p build
pushd build
cmake -DGEN_DOC=ON ..
make build_docs
popd
- name: GH Pages Deployment
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/docs/html/
enable_jekyll: false
allow_empty_commit: false
force_orphan: true
publish_branch: doxy-gh-pages
10 changes: 5 additions & 5 deletions .github/workflows/onpullrequest-build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
key: grpc-1.31.x-${{ runner.os }}
path: depends/grpc
- name: Build grpc
run: if ! [ -d depends/grpc ] ; then scripts/install_grpc /usr v1.31.x depends/grpc ; fi
run: if ! [ -d depends/grpc ] ; then scripts/install-grpc /usr v1.31.x ; fi

# Extract the commits of submodules for use by cache steps
onpr-submodules:
Expand All @@ -45,7 +45,7 @@ jobs:
matrix:
curve: [ BLS12_377, ALT_BN128 ]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-node@v1
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
key: prover-tests-npm-${{ hashFiles('**/package-lock.json') }}-${{ runner.os }}
- name: Install dependencies
run: |
scripts/install_grpc /usr v1.31.x depends/grpc
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
sudo apt install -y ccache
- name: Execute
run: CI_CONFIG=Release CI_CURVE=${{ matrix.curve }} CI_PROVER_TESTS=1 scripts/ci build
Expand All @@ -90,7 +90,7 @@ jobs:
matrix:
curve: [ BLS12_377, ALT_BN128 ]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-node@v1
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
key: integration-tests-npm-${{ hashFiles('**/package-lock.json') }}-${{ runner.os }}
- name: Install dependencies
run: |
scripts/install_grpc /usr v1.31.x depends/grpc
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
sudo apt install -y ccache
- name: Execute
run: CI_CONFIG=Release CI_CURVE=${{ matrix.curve }} CI_FULL_TESTS=1 CI_INTEGRATION_TESTS=1 scripts/ci build
10 changes: 5 additions & 5 deletions .github/workflows/onpush-build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
key: grpc-1.31.x-${{ runner.os }}
path: depends/grpc
- name: Build grpc
run: if ! [ -d depends/grpc ] ; then scripts/install_grpc /usr v1.31.x depends/grpc ; fi
run: if ! [ -d depends/grpc ] ; then scripts/install-grpc /usr v1.31.x ; fi

build-linux:
runs-on: ubuntu-20.04
Expand All @@ -46,7 +46,7 @@ jobs:
key: build-linux-pip-${{ hashFiles('**/setup.py') }}-${{ runner.os }}
- name: Install dependencies
run: |
scripts/install_grpc /usr v1.31.x depends/grpc
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
sudo apt install -y ccache
- name: Execute
run: CI_CHECK_FORMAT=1 CI_MPC_TESTS=1 CI_CONFIG=${{ matrix.config }} scripts/ci build
Expand All @@ -65,7 +65,7 @@ jobs:
path: depends/grpc
- name: Install dependencies
run: |
scripts/install_grpc /usr v1.31.x depends/grpc
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
sudo apt install -y ccache
- name: Execute
run: CI_CONFIG=Release CI_ZKSNARK=PGHR13 scripts/ci build
Expand All @@ -74,7 +74,7 @@ jobs:
runs-on: ubuntu-20.04
needs: build-grpc
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache grpc
Expand All @@ -84,7 +84,7 @@ jobs:
path: depends/grpc
- name: Install dependencies
run: |
scripts/install_grpc /usr v1.31.x depends/grpc
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
sudo apt install -y ccache
- name: Execute
run: CI_CONFIG=Release CI_CURVE=BLS12_377 scripts/ci build
4 changes: 2 additions & 2 deletions .github/workflows/onpush-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
check-client:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache pip
Expand All @@ -49,7 +49,7 @@ jobs:
check-cpp-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Execute
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.13)

# Change the compiler BEFORE the first `project()` command to avoid an infinite loop.
# See: https://public.kitware.com/pipermail/cmake/2009-November/033133.html
Expand All @@ -16,7 +16,7 @@ project(zeth CXX)

# Versionning of the project
set(ZETH_VERSION_MAJOR 0)
set(ZETH_VERSION_MINOR 7)
set(ZETH_VERSION_MINOR 8)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down Expand Up @@ -311,11 +311,12 @@ endif()

# Add all local subdirecetories
add_subdirectory(libzeth)
add_subdirectory(libtool)

# If zeth is being used as a dependency, skip the tools build
if ("${IS_ZETH_PARENT}")
add_subdirectory(prover_server)
add_subdirectory(verifier)
add_subdirectory(zeth_tool)
# For now the MPC for Groth16 only is tailored to the alt_bn128 pairing group
if((${ZETH_SNARK} STREQUAL "GROTH16") AND (${MPC}))
add_subdirectory(mpc_tools)
Expand Down
25 changes: 25 additions & 0 deletions CODING_STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@ New code should follow these rules, and old code should be changed over time to
- Each file should have a well-defined purpose and be concerned with a single narrow concept.
- Add unit tests for new code. As far as possible, one test per source file or logical group of files.
- Names should be as clear and concise as possible, avoiding opaque abbreviations.
- In conditions, the tested variable must appear on the left of the operator. This is to stay consistent with English, which writes/reads from left to right.
```
// GOOD:
// The test below reads "If age is above 18"
// (the test is on the value of `age` here, so it appears first)
if (age >= 18) {
drive();
}
```
instead of:
```
// BAD:
// The test below reads "If 18 is below age"
// (the test is on the value `age` yet it appears last, which doesn't read naturally)
if (18 <= age) {
drive();
}
```
- Executables (bash scripts, CLIs etc.) and their flags are named using `kebab-case` (e.g. `foo-bar --baz`).

## Bash

Only executable bash scripts must be set to be executable (e.g. via `chmod +x <file>`).
Executable bash scripts are named using `kebab-case` and do not have file extension (e.g. `my-bash-command` and **not** `my-bash-command.sh` or `my_bash_command`). Non-executable bash scripts are named in `snake_case` and have an `.sh` extension.
Use the `env` functionality by default in shebangs except if the context suggests otherwise (e.g. `#!/usr/bin/env bash` instead of `#!/bin/bash`).

## Python

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile-mpc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ LABEL org.opencontainers.image.source https://github.com/clearmatics/zeth
COPY --from=stage1 /usr/local/bin/ /usr/local/bin
# Move the mpc python code
COPY --from=stage1 /home/zeth/mpc/ /home/zeth-mpc
COPY --from=stage1 /home/zeth/scripts/docker/entrypoint-mpc.sh /home/zeth-mpc/entrypoint.sh
COPY --from=stage1 /home/zeth/scripts/docker/entrypoint-mpc /home/zeth-mpc/entrypoint
RUN apk --update --no-cache add \
bash \
# Install necessary shared libs to run the rust binaries
Expand All @@ -60,5 +60,5 @@ RUN apk del \

WORKDIR /home/zeth-mpc

ENTRYPOINT ["./entrypoint.sh"]
ENTRYPOINT ["./entrypoint"]
CMD ["/bin/bash"]
8 changes: 4 additions & 4 deletions Dockerfile-prover
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ COPY . ${ZETH_PATH}
RUN cd ${ZETH_PATH} \
&& git submodule update --init --recursive

# Build `prover_server`
# Build `prover-server`
RUN cd ${ZETH_PATH} \
&& mkdir build \
&& cd build \
&& cmake -DMPC=OFF -DSTATIC_BUILD=ON .. \
&& make -j"$($(nprocs)+1)" prover_server
&& make -j"$($(nprocs)+1)" prover-server

##

Expand All @@ -24,6 +24,6 @@ FROM alpine:3.12
LABEL org.opencontainers.image.source https://github.com/clearmatics/zeth

RUN apk add --no-cache bash
## Move `prover_server` from previous image and put it in the PATH
COPY --from=stage1 /home/zeth/build/prover_server/prover_server /usr/local/bin
## Move `prover-server` from previous image and put it in the PATH
COPY --from=stage1 /home/zeth/build/prover_server/prover-server /usr/local/bin
CMD ["/bin/bash"]
26 changes: 15 additions & 11 deletions Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "Zeth - Clearmatics Technologies LTD"
PROJECT_NAME = "Zeth - Zerocash on Ethereum"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand All @@ -44,7 +44,7 @@ PROJECT_NUMBER = @ZETH_VERSION_MAJOR@.@ZETH_VERSION_MINOR@
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF = "Zerocash on Ethereum"
PROJECT_BRIEF = "Reference implementation of the Zeth protocol by Clearmatics"

# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
Expand All @@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/doc_doxygen/
OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/docs/

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down Expand Up @@ -780,9 +780,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = @CMAKE_CURRENT_SOURCE_DIR@/libzeth/ \
@CMAKE_CURRENT_SOURCE_DIR@/mpc_tools/ \
@CMAKE_CURRENT_SOURCE_DIR@/prover_server
INPUT = @CMAKE_SOURCE_DIR@

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -843,7 +841,11 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*

EXCLUDE_PATTERNS =
EXCLUDE_PATTERNS = */env/* \
*/node_modules/* \
*/tests/* \
*/depends/* \
*/build/*

# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
Expand Down Expand Up @@ -936,7 +938,9 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.

USE_MDFILE_AS_MAINPAGE =
INPUT += @CMAKE_SOURCE_DIR@/README_doxygen.md
FILE_PATTERNS += *.md
USE_MDFILE_AS_MAINPAGE = @CMAKE_SOURCE_DIR@/README_doxygen.md

#---------------------------------------------------------------------------
# Configuration options related to source browsing
Expand Down Expand Up @@ -1195,7 +1199,7 @@ HTML_COLORSTYLE_GAMMA = 80
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.

HTML_TIMESTAMP = NO
HTML_TIMESTAMP = YES

# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
Expand Down Expand Up @@ -2285,7 +2289,7 @@ INCLUDED_BY_GRAPH = YES
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.

CALL_GRAPH = NO
CALL_GRAPH = YES

# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
# dependency graph for every global function or class method.
Expand All @@ -2297,7 +2301,7 @@ CALL_GRAPH = NO
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.

CALLER_GRAPH = NO
CALLER_GRAPH = YES

# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
# hierarchy of all classes instead of a textual one.
Expand Down
Loading

0 comments on commit a0f89b2

Please sign in to comment.