Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small cleanup and fixes #76

Merged
merged 9 commits into from
Feb 26, 2021
3 changes: 1 addition & 2 deletions Dockerfile-zecale
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,4 +9,3 @@ WORKDIR /home/zecale
RUN git submodule update --init --recursive

CMD ["/bin/bash"]

2 changes: 1 addition & 1 deletion aggregator_server/aggregator_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class aggregator_server final : public zecale_proto::Aggregator::Service
std::array<libzecale::nested_transaction<npp, nsnark>, 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");
Expand Down
13 changes: 8 additions & 5 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion client/zecale/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
2 changes: 1 addition & 1 deletion libzecale/circuits/aggregator_circuit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__
2 changes: 2 additions & 0 deletions libzecale/circuits/null_hash_gadget.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -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
{

Expand Down
2 changes: 1 addition & 1 deletion libzecale/circuits/pairing/mnt_pairing_params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <libff/algebra/curves/mnt/mnt4/mnt4_pp.hpp>
#include <libff/algebra/curves/mnt/mnt6/mnt6_pp.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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__
Original file line number Diff line number Diff line change
Expand Up @@ -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 <libff/algebra/scalar_multiplication/wnaf.hpp>
#include <libsnark/gadgetlib1/constraint_profiling.hpp>
Expand Down Expand Up @@ -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__
#endif // __ZECALE_CIRCUITS_PAIRING_MNT_WEIERSTRASS_QUADRUPLE_MILLER_LOOP_TCC__
2 changes: 2 additions & 0 deletions libzecale/circuits/pairing/pairing_checks.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -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
{

Expand Down
2 changes: 1 addition & 1 deletion libzecale/core/application_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__
2 changes: 1 addition & 1 deletion libzecale/core/nested_transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ template<typename nppT, typename nsnarkT> class nested_transaction

} // namespace libzecale

#include "nested_transaction.tcc"
#include "libzecale/core/nested_transaction.tcc"

#endif // __ZECALE_CORE_NESTED_TRANSACTION_HPP__
2 changes: 1 addition & 1 deletion libzecale/core/nested_transaction.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <libzeth/core/utils.hpp>

Expand Down
2 changes: 1 addition & 1 deletion libzecale/serialization/proto_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ nested_transaction<ppT, typename apiHandlerT::snark> nested_transaction_from_pro

} // namespace libzecale

#include "proto_utils.tcc"
#include "libzecale/serialization/proto_utils.tcc"

#endif // __ZECALE_SERIALIZATION_PROTO_UTILS_HPP__
17 changes: 0 additions & 17 deletions libzecale/zecale_constants.hpp

This file was deleted.