clearmatics/zeth

Better expose prover_server (generic) util functions

AntoineRondelet opened this issue · 1 comments

Related to clearmatics/zecale#89 (comment)

Despite being mere wrappers around the libzeth functions, some functions in the prover_server (Zeth) and aggregator_server (Zecale) are duplicated across the projects (functions like load_keypair, write_keypair, write_constraint_system etc). Duplicated code is prone to inconsistencies (one version changed and not the others) which is not good. Also, with code: less is more. Less code is less code to maintain and always a good idea. Let's see how we could package these utils function on the prover server to better expose them and use them straight in other projects like Zecale. Maybe we could create a new namespace like libzeth::server that contains all these functions and we could use them straight in prover_server.cpp in Zeth and in aggregator_server.cpp in Zecale.

I was just addressing this as part of clearmatics/zecale#89 (comment). The main reason for these functions was to open the streams with the error-checking options (which is a couple of pretty annoying lines). This has now been wrapped in the libtool library (since I hit similar issues in the zeth tool code), so these functions are no longer required (and removing them results in less code).

See #418