diff --git a/Dockerfile-zecale b/Dockerfile-zecale index 9f197183..c480239a 100644 --- a/Dockerfile-zecale +++ b/Dockerfile-zecale @@ -1,5 +1,5 @@ # We use the same base image as zeth since we need the same dependencies -FROM clearmatics/zeth-base +FROM ghcr.io/clearmatics/zeth:latest-base # Copy the project in the docker container COPY . /home/zecale @@ -9,4 +9,3 @@ WORKDIR /home/zecale RUN git submodule update --init --recursive CMD ["/bin/bash"] - diff --git a/aggregator_server/aggregator_server.cpp b/aggregator_server/aggregator_server.cpp index 760b3f85..824eae6e 100644 --- a/aggregator_server/aggregator_server.cpp +++ b/aggregator_server/aggregator_server.cpp @@ -293,7 +293,7 @@ class aggregator_server final : public zecale_proto::Aggregator::Service std::array, batch_size> batch; const size_t num_entries = app_pool->get_next_batch(batch); - std::cout << "[DEBUG] Got batch of size" + std::cout << "[DEBUG] Got batch of size " << std::to_string(num_entries) << " from the pool\n"; if (num_entries == 0) { throw std::runtime_error("insufficient entries in pool"); diff --git a/client/README.md b/client/README.md index 884e32f3..d318b490 100644 --- a/client/README.md +++ b/client/README.md @@ -39,11 +39,9 @@ $ source env/bin/activate (env)$ make setup ``` -Then, Execute the following inside the `client` directory: +Then, execute the following inside the `client` directory: ```console $ cd $ZECALE/client -$ python -m venv env -$ source env/bin/activate (env)$ make setup ``` @@ -65,10 +63,15 @@ In order for Zecale to work, it is necessary for the blockchain to support BW6-761 arithmetic. As such, we assume below that the smart contracts are deployed on an Ethereum testnet that supports BW6-761 precompiled contracts. -To do so, please follow the instructions below to run a modified version +To do so, you can start a ganache-cli instance via docker by running: +```console +docker run -ti -p 8545:8545 ghcr.io/clearmatics/ganache-cli --hardfork istanbul --gasLimit 0x3FFFFFFFFFFFF --gasPrice 1 --defaultBalanceEther 90000000000 +``` + +Otherwise, please follow the instructions below to run a modified version of ganache-cli in a new terminal (see [Zeth](https://github.com/clearmatics/zeth/) for more information): ```console -cd ../depends/zeth/zeth_contracts +cd $ZECALE/depends/zeth/zeth_contracts npm install # make sure that node and npm have the right versions npm run testrpc ``` diff --git a/client/zecale/cli/utils.py b/client/zecale/cli/utils.py index 76908872..e6554316 100644 --- a/client/zecale/cli/utils.py +++ b/client/zecale/cli/utils.py @@ -29,7 +29,7 @@ def load_nested_transaction( def load_aggregated_transaction( zksnark: IZKSnarkProvider, agg_tx_file: str) -> AggregatedTransaction: """ - Load an aggreagted transction from a file + Load an aggregated transaction from a file """ with open(agg_tx_file, "r") as tx_f: return AggregatedTransaction.from_json_dict(zksnark, json.load(tx_f)) diff --git a/libzecale/circuits/aggregator_circuit.hpp b/libzecale/circuits/aggregator_circuit.hpp index 546c879b..5a63a7bb 100644 --- a/libzecale/circuits/aggregator_circuit.hpp +++ b/libzecale/circuits/aggregator_circuit.hpp @@ -115,6 +115,6 @@ class aggregator_circuit } // namespace libzecale -#include "aggregator_circuit.tcc" +#include "libzecale/circuits/aggregator_circuit.tcc" #endif // __ZECALE_CORE_AGGREGATOR_CIRCUIT_HPP__ diff --git a/libzecale/circuits/null_hash_gadget.tcc b/libzecale/circuits/null_hash_gadget.tcc index 376f15fa..7813a7b9 100644 --- a/libzecale/circuits/null_hash_gadget.tcc +++ b/libzecale/circuits/null_hash_gadget.tcc @@ -5,6 +5,8 @@ #ifndef __ZECALE_CIRCUIT_NULL_HASH_GADGET_TCC__ #define __ZECALE_CIRCUIT_NULL_HASH_GADGET_TCC__ +#include "libzecale/circuits/null_hash_gadget.hpp" + namespace libzecale { diff --git a/libzecale/circuits/pairing/mnt_pairing_params.hpp b/libzecale/circuits/pairing/mnt_pairing_params.hpp index 25b394c7..f7502e5d 100644 --- a/libzecale/circuits/pairing/mnt_pairing_params.hpp +++ b/libzecale/circuits/pairing/mnt_pairing_params.hpp @@ -5,8 +5,8 @@ #ifndef __ZECALE_CIRCUITS_PAIRING_MNT_PAIRING_PARAMS_HPP__ #define __ZECALE_CIRCUITS_PAIRING_MNT_PAIRING_PARAMS_HPP__ +#include "libzecale/circuits/pairing/mnt_weierstrass_quadruple_miller_loop.hpp" #include "libzecale/circuits/pairing/pairing_params.hpp" -#include "libzecale/circuits/pairing/weierstrass_miller_loop.hpp" #include #include diff --git a/libzecale/circuits/pairing/weierstrass_miller_loop.hpp b/libzecale/circuits/pairing/mnt_weierstrass_quadruple_miller_loop.hpp similarity index 93% rename from libzecale/circuits/pairing/weierstrass_miller_loop.hpp rename to libzecale/circuits/pairing/mnt_weierstrass_quadruple_miller_loop.hpp index 4dec83c8..ea89c9af 100644 --- a/libzecale/circuits/pairing/weierstrass_miller_loop.hpp +++ b/libzecale/circuits/pairing/mnt_weierstrass_quadruple_miller_loop.hpp @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: LGPL-3.0+ -#ifndef __ZECALE_CIRCUITS_PAIRING_WEIERSTRASS_MILLER_LOOP_HPP__ -#define __ZECALE_CIRCUITS_PAIRING_WEIERSTRASS_MILLER_LOOP_HPP__ +#ifndef __ZECALE_CIRCUITS_PAIRING_MNT_WEIERSTRASS_QUADRUPLE_MILLER_LOOP_HPP__ +#define __ZECALE_CIRCUITS_PAIRING_MNT_WEIERSTRASS_QUADRUPLE_MILLER_LOOP_HPP__ #include "libzecale/circuits/pairing/mnt_pairing_params.hpp" #include "libzecale/circuits/pairing/pairing_params.hpp" @@ -102,6 +102,6 @@ bool test_mnt_e_times_e_times_e_over_e_miller_loop( } // namespace libzecale -#include "libzecale/circuits/pairing/weierstrass_miller_loop.tcc" +#include "libzecale/circuits/pairing/mnt_weierstrass_quadruple_miller_loop.tcc" -#endif // __ZECALE_CIRCUITS_PAIRING_WEIERSTRASS_MILLER_LOOP_HPP__ +#endif // __ZECALE_CIRCUITS_PAIRING_MNT_WEIERSTRASS_QUADRUPLE_MILLER_LOOP_HPP__ diff --git a/libzecale/circuits/pairing/weierstrass_miller_loop.tcc b/libzecale/circuits/pairing/mnt_weierstrass_quadruple_miller_loop.tcc similarity index 98% rename from libzecale/circuits/pairing/weierstrass_miller_loop.tcc rename to libzecale/circuits/pairing/mnt_weierstrass_quadruple_miller_loop.tcc index 23b2853a..b99f50f5 100644 --- a/libzecale/circuits/pairing/weierstrass_miller_loop.tcc +++ b/libzecale/circuits/pairing/mnt_weierstrass_quadruple_miller_loop.tcc @@ -2,8 +2,10 @@ // // SPDX-License-Identifier: LGPL-3.0+ -#ifndef __ZECALE_CIRCUITS_PAIRING_WEIERSTRASS_MILLER_LOOP_TCC__ -#define __ZECALE_CIRCUITS_PAIRING_WEIERSTRASS_MILLER_LOOP_TCC__ +#ifndef __ZECALE_CIRCUITS_PAIRING_MNT_WEIERSTRASS_QUADRUPLE_MILLER_LOOP_TCC__ +#define __ZECALE_CIRCUITS_PAIRING_MNT_WEIERSTRASS_QUADRUPLE_MILLER_LOOP_TCC__ + +#include "libzecale/circuits/pairing/mnt_weierstrass_quadruple_miller_loop.hpp" #include #include @@ -500,4 +502,4 @@ bool test_mnt_e_times_e_times_e_over_e_miller_loop( } // namespace libzecale -#endif // __ZECALE_CIRCUITS_PAIRING_WEIERSTRASS_MILLER_LOOP_TCC__ \ No newline at end of file +#endif // __ZECALE_CIRCUITS_PAIRING_MNT_WEIERSTRASS_QUADRUPLE_MILLER_LOOP_TCC__ diff --git a/libzecale/circuits/pairing/pairing_checks.tcc b/libzecale/circuits/pairing/pairing_checks.tcc index e9e89b2e..0592f3e1 100644 --- a/libzecale/circuits/pairing/pairing_checks.tcc +++ b/libzecale/circuits/pairing/pairing_checks.tcc @@ -5,6 +5,8 @@ #ifndef __ZECALE_CIRCUITS_PAIRING_PAIRING_CHECKS_TCC__ #define __ZECALE_CIRCUITS_PAIRING_PAIRING_CHECKS_TCC__ +#include "libzecale/circuits/pairing/pairing_checks.hpp" + namespace libzecale { diff --git a/libzecale/core/application_pool.hpp b/libzecale/core/application_pool.hpp index b0f57e4c..8fe90595 100644 --- a/libzecale/core/application_pool.hpp +++ b/libzecale/core/application_pool.hpp @@ -65,6 +65,6 @@ class application_pool } // namespace libzecale -#include "application_pool.tcc" +#include "libzecale/core/application_pool.tcc" #endif // __ZECALE_CORE_APPLICATION_POOL_HPP__ diff --git a/libzecale/core/nested_transaction.hpp b/libzecale/core/nested_transaction.hpp index 0c6ea6e7..2826f828 100644 --- a/libzecale/core/nested_transaction.hpp +++ b/libzecale/core/nested_transaction.hpp @@ -52,6 +52,6 @@ template class nested_transaction } // namespace libzecale -#include "nested_transaction.tcc" +#include "libzecale/core/nested_transaction.tcc" #endif // __ZECALE_CORE_NESTED_TRANSACTION_HPP__ diff --git a/libzecale/core/nested_transaction.tcc b/libzecale/core/nested_transaction.tcc index c712ee44..2884c181 100644 --- a/libzecale/core/nested_transaction.tcc +++ b/libzecale/core/nested_transaction.tcc @@ -5,7 +5,7 @@ #ifndef __ZECALE_CORE_NESTED_TRANSACTION_TCC__ #define __ZECALE_CORE_NESTED_TRANSACTION_TCC__ -#include "nested_transaction.hpp" +#include "libzecale/core/nested_transaction.hpp" #include diff --git a/libzecale/serialization/proto_utils.hpp b/libzecale/serialization/proto_utils.hpp index 9f6f03bd..ffa87983 100644 --- a/libzecale/serialization/proto_utils.hpp +++ b/libzecale/serialization/proto_utils.hpp @@ -22,6 +22,6 @@ nested_transaction nested_transaction_from_pro } // namespace libzecale -#include "proto_utils.tcc" +#include "libzecale/serialization/proto_utils.tcc" #endif // __ZECALE_SERIALIZATION_PROTO_UTILS_HPP__ diff --git a/libzecale/zecale_constants.hpp b/libzecale/zecale_constants.hpp deleted file mode 100644 index 37b6a488..00000000 --- a/libzecale/zecale_constants.hpp +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2015-2021 Clearmatics Technologies Ltd -// -// SPDX-License-Identifier: LGPL-3.0+ - -#ifndef __ZECALE_ZECALE_CONSTANTS__ -#define __ZECALE_ZECALE_CONSTANTS__ - -#include - -// Constants that determines how many proofs are verified -// in the aggregator circuit -static const size_t ZECALE_BATCH_SIZE = 2; - -// Max depth of the Proofs pool/Zeth tx pool -static const size_t ZECALE_MAX_POOL_DEPTH = 10; - -#endif // __ZECALE_ZECALE_CONSTANTS__