yuxiamit / LitmusDB

A Cryptographically Verifiable DBMS
GNU General Public License v3.0
3 stars 2 forks source link

Assertion `cs.is_satisfied(primary_input, auxiliary_input)' failed #2

Open melhindi opened 1 year ago

melhindi commented 1 year ago

Hi, when trying you to reproduce the results / run the code in the repo, I keep seeing the following error message:

Generating Proofs...
rundb_SDR_YCSB_NOWAIT: /root/pepper_deps/include/libsnark/reductions/r1cs_to_qap/r1cs_to_qap.tcc:216: libsnark::qap_witness<FieldT> libsnark::r1cs_to_qap_witness_map(const libsnark::r1cs_constraint_system<FieldT>&, libsnark::r1cs_primary_input<FieldT>&, libsnark::r1cs_auxiliary_input<FieldT>&, const FieldT&, const FieldT&, const FieldT&) [with FieldT = libff::Fp_model<4l, ((const libff::bigint<4l>&)(& libff::bn128_modulus_r))>; libsnark::r1cs_primary_input<FieldT> = std::vector<libff::Fp_model<4l, ((const libff::bigint<4l>&)(& libff::bn128_modulus_r))>, std::allocator<libff::Fp_model<4l, ((const libff::bigint<4l>&)(& libff::bn128_modulus_r))> > >; libsnark::r1cs_auxiliary_input<FieldT> = std::vector<libff::Fp_model<4l, ((const libff::bigint<4l>&)(& libff::bn128_modulus_r))>, std::allocator<libff::Fp_model<4l, ((const libff::bigint<4l>&)(& libff::bn128_modulus_r))> > >]: Assertion `cs.is_satisfied(primary_input, auxiliary_input)' failed.
Aborted (core dumped)

This happens for various configurations, e.g.: ./rundb_SDR_YCSB_NOWAIT -Gx40 -LR1 -Ln1 -Lr0 or ./rundb_SDR_YCSB_DETRESERVE -Gx40 -LR1 -Ln1 -Lr0

Interestingly, ./rundb_SDR_YCSB_DETRESERVE -Gx20 -LR1 -Ln1 -Lr0 works just fine.

I created a fork/PR with changes that were required to build the code on my machine using docker (https://github.com/melhindi/LitmusDB , PR #1 )

I would really appreciate your help.

yuxiamit commented 1 year ago

Hi,

This is the sanity check of libsnark. We have to disable it at the moment because our assumptions are sometimes violated (see README). You need to use the patched libsnark provided by us for now.

melhindi commented 1 year ago

Hi, thanks for the pointer. The patched libsnark works for me only when I disable the MULTICORE and PERFORMANCE flags (which are enabled in the patched version). I.e., this is the command that I use to configure the libsnark cmake project: cmake -DCMAKE_INSTALL_PREFIX=$DEPS_DIR -DMULTICORE=OFF -DPERFORMANCE=OFF -DWITH_PROCPS=OFF ..

The problem with the MULTICORE flag is that openmp is required as a dependency (libomp-dev) and the corresponding linker flag -fopenmp needs to be added in pequin/pepper/Makefile - when both is considered the enabling the MULTICORE flag works. However, I was not able to run the code with the PERFORMANCE flag (link-time optimizations for libsnark). I get errors like the following although libff is present in both the compile and linker path: undefined reference to libff::get_power_of_two(unsigned long) / libff::bn128_G1::zero(..)

Do you know how to fix this or is it OK to disable these flags when building libsnark? Thanks in advance for your help!

yuxiamit commented 1 year ago

Hi, I think we can disable these flags. But I roughly remembered that I turned on MULTICORE...