Skip to content

Commit a0f89b2

Browse files
Merge pull request #400 from clearmatics/develop
v0.8 - Drachma
2 parents 8247fc3 + 9b193b4 commit a0f89b2

136 files changed

Lines changed: 2668 additions & 1642 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/dev-docs.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: zeth-ci-dev-docs
2+
3+
on:
4+
push:
5+
branches: [ develop ]
6+
7+
jobs:
8+
build-grpc:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Cache grpc
13+
uses: actions/cache@v2
14+
with:
15+
key: grpc-1.31.x-${{ runner.os }}
16+
path: depends/grpc
17+
- name: Build grpc
18+
run: if ! [ -d depends/grpc ] ; then scripts/install-grpc /usr v1.31.x ; fi
19+
20+
build-documentation:
21+
runs-on: ubuntu-20.04
22+
needs: build-grpc
23+
steps:
24+
- name: Checkout repository and install submodules
25+
uses: actions/checkout@v2
26+
with:
27+
submodules: recursive
28+
- name: Cache grpc
29+
uses: actions/cache@v2
30+
with:
31+
key: grpc-1.31.x-${{ runner.os }}
32+
path: depends/grpc
33+
- name: Install dependencies
34+
run: |
35+
sudo apt update -y
36+
source scripts/build_utils.sh
37+
init_platform
38+
cpp_build_setup
39+
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
40+
sudo apt install -y doxygen graphviz
41+
- name: Generatate documentation
42+
run: |
43+
mkdir -p build
44+
pushd build
45+
cmake -DGEN_DOC=ON ..
46+
make build_docs
47+
popd
48+
- name: GH Pages Deployment
49+
uses: peaceiris/actions-gh-pages@v3
50+
with:
51+
github_token: ${{ secrets.GITHUB_TOKEN }}
52+
publish_dir: ./build/docs/html/
53+
enable_jekyll: false
54+
allow_empty_commit: false
55+
force_orphan: true
56+
publish_branch: doxy-gh-pages

.github/workflows/onpullrequest-build-ubuntu.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
key: grpc-1.31.x-${{ runner.os }}
2323
path: depends/grpc
2424
- name: Build grpc
25-
run: if ! [ -d depends/grpc ] ; then scripts/install_grpc /usr v1.31.x depends/grpc ; fi
25+
run: if ! [ -d depends/grpc ] ; then scripts/install-grpc /usr v1.31.x ; fi
2626

2727
# Extract the commits of submodules for use by cache steps
2828
onpr-submodules:
@@ -45,7 +45,7 @@ jobs:
4545
matrix:
4646
curve: [ BLS12_377, ALT_BN128 ]
4747
steps:
48-
- uses: actions/checkout@v1
48+
- uses: actions/checkout@v2
4949
with:
5050
submodules: recursive
5151
- uses: actions/setup-node@v1
@@ -77,7 +77,7 @@ jobs:
7777
key: prover-tests-npm-${{ hashFiles('**/package-lock.json') }}-${{ runner.os }}
7878
- name: Install dependencies
7979
run: |
80-
scripts/install_grpc /usr v1.31.x depends/grpc
80+
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
8181
sudo apt install -y ccache
8282
- name: Execute
8383
run: CI_CONFIG=Release CI_CURVE=${{ matrix.curve }} CI_PROVER_TESTS=1 scripts/ci build
@@ -90,7 +90,7 @@ jobs:
9090
matrix:
9191
curve: [ BLS12_377, ALT_BN128 ]
9292
steps:
93-
- uses: actions/checkout@v1
93+
- uses: actions/checkout@v2
9494
with:
9595
submodules: recursive
9696
- uses: actions/setup-node@v1
@@ -124,7 +124,7 @@ jobs:
124124
key: integration-tests-npm-${{ hashFiles('**/package-lock.json') }}-${{ runner.os }}
125125
- name: Install dependencies
126126
run: |
127-
scripts/install_grpc /usr v1.31.x depends/grpc
127+
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
128128
sudo apt install -y ccache
129129
- name: Execute
130130
run: CI_CONFIG=Release CI_CURVE=${{ matrix.curve }} CI_FULL_TESTS=1 CI_INTEGRATION_TESTS=1 scripts/ci build

.github/workflows/onpush-build-ubuntu.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
key: grpc-1.31.x-${{ runner.os }}
2323
path: depends/grpc
2424
- name: Build grpc
25-
run: if ! [ -d depends/grpc ] ; then scripts/install_grpc /usr v1.31.x depends/grpc ; fi
25+
run: if ! [ -d depends/grpc ] ; then scripts/install-grpc /usr v1.31.x ; fi
2626

2727
build-linux:
2828
runs-on: ubuntu-20.04
@@ -46,7 +46,7 @@ jobs:
4646
key: build-linux-pip-${{ hashFiles('**/setup.py') }}-${{ runner.os }}
4747
- name: Install dependencies
4848
run: |
49-
scripts/install_grpc /usr v1.31.x depends/grpc
49+
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
5050
sudo apt install -y ccache
5151
- name: Execute
5252
run: CI_CHECK_FORMAT=1 CI_MPC_TESTS=1 CI_CONFIG=${{ matrix.config }} scripts/ci build
@@ -65,7 +65,7 @@ jobs:
6565
path: depends/grpc
6666
- name: Install dependencies
6767
run: |
68-
scripts/install_grpc /usr v1.31.x depends/grpc
68+
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
6969
sudo apt install -y ccache
7070
- name: Execute
7171
run: CI_CONFIG=Release CI_ZKSNARK=PGHR13 scripts/ci build
@@ -74,7 +74,7 @@ jobs:
7474
runs-on: ubuntu-20.04
7575
needs: build-grpc
7676
steps:
77-
- uses: actions/checkout@v1
77+
- uses: actions/checkout@v2
7878
with:
7979
submodules: recursive
8080
- name: Cache grpc
@@ -84,7 +84,7 @@ jobs:
8484
path: depends/grpc
8585
- name: Install dependencies
8686
run: |
87-
scripts/install_grpc /usr v1.31.x depends/grpc
87+
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
8888
sudo apt install -y ccache
8989
- name: Execute
9090
run: CI_CONFIG=Release CI_CURVE=BLS12_377 scripts/ci build

.github/workflows/onpush-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
check-client:
3636
runs-on: ubuntu-20.04
3737
steps:
38-
- uses: actions/checkout@v1
38+
- uses: actions/checkout@v2
3939
with:
4040
submodules: recursive
4141
- name: Cache pip
@@ -49,7 +49,7 @@ jobs:
4949
check-cpp-linux:
5050
runs-on: ubuntu-20.04
5151
steps:
52-
- uses: actions/checkout@v1
52+
- uses: actions/checkout@v2
5353
with:
5454
submodules: recursive
5555
- name: Execute

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.15)
1+
cmake_minimum_required(VERSION 3.13)
22

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

1717
# Versionning of the project
1818
set(ZETH_VERSION_MAJOR 0)
19-
set(ZETH_VERSION_MINOR 7)
19+
set(ZETH_VERSION_MINOR 8)
2020

2121
set(CMAKE_CXX_STANDARD 11)
2222
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -311,11 +311,12 @@ endif()
311311

312312
# Add all local subdirecetories
313313
add_subdirectory(libzeth)
314+
add_subdirectory(libtool)
314315

315316
# If zeth is being used as a dependency, skip the tools build
316317
if ("${IS_ZETH_PARENT}")
317318
add_subdirectory(prover_server)
318-
add_subdirectory(verifier)
319+
add_subdirectory(zeth_tool)
319320
# For now the MPC for Groth16 only is tailored to the alt_bn128 pairing group
320321
if((${ZETH_SNARK} STREQUAL "GROTH16") AND (${MPC}))
321322
add_subdirectory(mpc_tools)

CODING_STANDARDS.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,31 @@ New code should follow these rules, and old code should be changed over time to
88
- Each file should have a well-defined purpose and be concerned with a single narrow concept.
99
- Add unit tests for new code. As far as possible, one test per source file or logical group of files.
1010
- Names should be as clear and concise as possible, avoiding opaque abbreviations.
11+
- 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.
12+
```
13+
// GOOD:
14+
// The test below reads "If age is above 18"
15+
// (the test is on the value of `age` here, so it appears first)
16+
if (age >= 18) {
17+
drive();
18+
}
19+
```
20+
instead of:
21+
```
22+
// BAD:
23+
// The test below reads "If 18 is below age"
24+
// (the test is on the value `age` yet it appears last, which doesn't read naturally)
25+
if (18 <= age) {
26+
drive();
27+
}
28+
```
29+
- Executables (bash scripts, CLIs etc.) and their flags are named using `kebab-case` (e.g. `foo-bar --baz`).
30+
31+
## Bash
32+
33+
Only executable bash scripts must be set to be executable (e.g. via `chmod +x <file>`).
34+
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.
35+
Use the `env` functionality by default in shebangs except if the context suggests otherwise (e.g. `#!/usr/bin/env bash` instead of `#!/bin/bash`).
1136

1237
## Python
1338

Dockerfile-mpc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LABEL org.opencontainers.image.source https://github.com/clearmatics/zeth
3737
COPY --from=stage1 /usr/local/bin/ /usr/local/bin
3838
# Move the mpc python code
3939
COPY --from=stage1 /home/zeth/mpc/ /home/zeth-mpc
40-
COPY --from=stage1 /home/zeth/scripts/docker/entrypoint-mpc.sh /home/zeth-mpc/entrypoint.sh
40+
COPY --from=stage1 /home/zeth/scripts/docker/entrypoint-mpc /home/zeth-mpc/entrypoint
4141
RUN apk --update --no-cache add \
4242
bash \
4343
# Install necessary shared libs to run the rust binaries
@@ -60,5 +60,5 @@ RUN apk del \
6060

6161
WORKDIR /home/zeth-mpc
6262

63-
ENTRYPOINT ["./entrypoint.sh"]
63+
ENTRYPOINT ["./entrypoint"]
6464
CMD ["/bin/bash"]

Dockerfile-prover

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ COPY . ${ZETH_PATH}
1010
RUN cd ${ZETH_PATH} \
1111
&& git submodule update --init --recursive
1212

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

2020
##
2121

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

2626
RUN apk add --no-cache bash
27-
## Move `prover_server` from previous image and put it in the PATH
28-
COPY --from=stage1 /home/zeth/build/prover_server/prover_server /usr/local/bin
27+
## Move `prover-server` from previous image and put it in the PATH
28+
COPY --from=stage1 /home/zeth/build/prover_server/prover-server /usr/local/bin
2929
CMD ["/bin/bash"]

Doxyfile.in

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
3232
# title of most generated pages and in a few other places.
3333
# The default value is: My Project.
3434

35-
PROJECT_NAME = "Zeth - Clearmatics Technologies LTD"
35+
PROJECT_NAME = "Zeth - Zerocash on Ethereum"
3636

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

47-
PROJECT_BRIEF = "Zerocash on Ethereum"
47+
PROJECT_BRIEF = "Reference implementation of the Zeth protocol by Clearmatics"
4848

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

61-
OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/doc_doxygen/
61+
OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/docs/
6262

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

783-
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/libzeth/ \
784-
@CMAKE_CURRENT_SOURCE_DIR@/mpc_tools/ \
785-
@CMAKE_CURRENT_SOURCE_DIR@/prover_server
783+
INPUT = @CMAKE_SOURCE_DIR@
786784

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

846-
EXCLUDE_PATTERNS =
844+
EXCLUDE_PATTERNS = */env/* \
845+
*/node_modules/* \
846+
*/tests/* \
847+
*/depends/* \
848+
*/build/*
847849

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

939-
USE_MDFILE_AS_MAINPAGE =
941+
INPUT += @CMAKE_SOURCE_DIR@/README_doxygen.md
942+
FILE_PATTERNS += *.md
943+
USE_MDFILE_AS_MAINPAGE = @CMAKE_SOURCE_DIR@/README_doxygen.md
940944

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

1198-
HTML_TIMESTAMP = NO
1202+
HTML_TIMESTAMP = YES
11991203

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

2288-
CALL_GRAPH = NO
2292+
CALL_GRAPH = YES
22892293

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

2300-
CALLER_GRAPH = NO
2304+
CALLER_GRAPH = YES
23012305

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

0 commit comments

Comments
 (0)