From 716bbd61e988c3fde95a2cd9a7ea045c80ce4873 Mon Sep 17 00:00:00 2001 From: fractasy Date: Tue, 19 Sep 2023 15:35:45 +0000 Subject: [PATCH 1/3] Fix hashdb64_workflow_test() not to readTree() virtual state roots --- src/hashdb64/state_manager_64.cpp | 1 - test/service/hashdb/hashdb64_workflow_test.cpp | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hashdb64/state_manager_64.cpp b/src/hashdb64/state_manager_64.cpp index 276f64d96..a5fd0ea74 100644 --- a/src/hashdb64/state_manager_64.cpp +++ b/src/hashdb64/state_manager_64.cpp @@ -910,7 +910,6 @@ zkresult StateManager64::consolidateState(const string &_virtualStateRoot, const return zkr; } - void StateManager64::print(bool bDbContent) { uint64_t totalDbWrites[PERSISTENCE_SIZE] = {0, 0, 0}; diff --git a/test/service/hashdb/hashdb64_workflow_test.cpp b/test/service/hashdb/hashdb64_workflow_test.cpp index 37182c60c..5fec1bea0 100644 --- a/test/service/hashdb/hashdb64_workflow_test.cpp +++ b/test/service/hashdb/hashdb64_workflow_test.cpp @@ -83,7 +83,7 @@ uint64_t HashDB64WorkflowTest (const Config& config) zkassertpermanent(zkr==ZKR_SUCCESS); zklog.info("PURGE zkr=" + zkresult2string(zkr) + " root=" + fea2string(fr, root) + " flushId=" + to_string(flushId) + " storedFlushId=" + to_string(storedFlushId)); - // Consolidate state root every 5 batches + // Consolidate state root every 5 batches, at batches 4, 9, 14, 19... Goldilocks::Element batchNewStateRoot[4]; if (((batch+1) % 5) == 0) { @@ -113,10 +113,10 @@ uint64_t HashDB64WorkflowTest (const Config& config) zklog.info("FLUSHED"); // Call ReadTree with the old state root to get the hashes of the initial values of all read or written keys - vector oldHashValues; + /*vector oldHashValues; zkr = pHashDB->readTree(batchOldStateRoot, keyValues, oldHashValues); zkassertpermanent(zkr==ZKR_SUCCESS); - zklog.info("READ TREE batchOldStateRoot=" + fea2string(fr, batchOldStateRoot) + " keyValues.size=" + to_string(keyValues.size()) + " hashValues.size=" + to_string(oldHashValues.size())); + zklog.info("READ TREE batchOldStateRoot=" + fea2string(fr, batchOldStateRoot) + " keyValues.size=" + to_string(keyValues.size()) + " hashValues.size=" + to_string(oldHashValues.size()));*/ // Call ReadTree with the new state root to get the hashes of the initial values of all read or written keys vector hashValues; From f80e77190a2e47fab439c434098eb32cc5c53c39 Mon Sep 17 00:00:00 2001 From: fractasy Date: Wed, 20 Sep 2023 11:00:08 +0000 Subject: [PATCH 2/3] Merge SMT64 get() and set() into StateManager64 --- src/hashdb64/leaf_node.cpp | 1 - src/hashdb64/smt_64.cpp | 90 ------------------------------- src/hashdb64/smt_64.hpp | 35 ------------ src/hashdb64/state_manager_64.cpp | 77 ++++++++++++++++++++++++++ src/hashdb64/state_manager_64.hpp | 6 +++ src/service/hashdb/hashdb.cpp | 6 +-- src/service/hashdb/hashdb.hpp | 2 - test/hashdb/smt_64_test.cpp | 1 - 8 files changed, 86 insertions(+), 132 deletions(-) delete mode 100644 src/hashdb64/smt_64.cpp delete mode 100644 src/hashdb64/smt_64.hpp diff --git a/src/hashdb64/leaf_node.cpp b/src/hashdb64/leaf_node.cpp index 3e03827a8..f4bff6d59 100644 --- a/src/hashdb64/leaf_node.cpp +++ b/src/hashdb64/leaf_node.cpp @@ -2,7 +2,6 @@ #include "scalar.hpp" #include "poseidon_goldilocks.hpp" #include "goldilocks_base_field.hpp" -#include "smt_64.hpp" #include "key_utils.hpp" void LeafNode::calculateHash (Goldilocks &fr, PoseidonGoldilocks &poseidon, vector *hashValues) diff --git a/src/hashdb64/smt_64.cpp b/src/hashdb64/smt_64.cpp deleted file mode 100644 index 6f6ed082f..000000000 --- a/src/hashdb64/smt_64.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#include "smt_64.hpp" -#include "scalar.hpp" -#include "utils.hpp" -#include "zkresult.hpp" -#include "zkmax.hpp" -#include "zklog.hpp" -#include -#include "state_manager_64.hpp" -#include "key_utils.hpp" -#include "tree_chunk.hpp" - -//#define SMT64_PRINT_TREE_CHUNKS - - -zkresult Smt64::set (const string &batchUUID, uint64_t tx, Database64 &db, const Goldilocks::Element (&oldRoot)[4], const Goldilocks::Element (&key)[4], const mpz_class &value, const Persistence persistence, SmtSetResult &result, DatabaseMap *dbReadLog) -{ -#ifdef LOG_SMT - zklog.info("Smt64::set() called with oldRoot=" + fea2string(fr,oldRoot) + " key=" + fea2string(fr,key) + " value=" + value.get_str(16) + " persistent=" + to_string(persistent)); -#endif - - zkresult zkr; - - bool bUseStateManager = db.config.stateManager && (batchUUID.size() > 0); - - if (bUseStateManager) - { - // Set the old state root - string oldRootString; - oldRootString = fea2string(fr, oldRoot); - stateManager64.setOldStateRoot(batchUUID, tx, oldRootString, persistence); - - // Write the key-value pair - string hashString = NormalizeToNFormat(fea2string(fr, key), 64); - zkr = stateManager64.write(batchUUID, tx, hashString, value, persistence); - if (zkr != ZKR_SUCCESS) - { - zklog.error("Smt64::set() failed calling stateManager.write() key=" + hashString + " result=" + to_string(zkr) + "=" + zkresult2string(zkr)); - } - - // Get a new state root - Goldilocks::Element newRoot[4]; // TODO: Get a new state root - string newRootString; - stateManager64.getVirtualStateRoot(newRoot, newRootString); - - // Set the new sttae root - stateManager64.setNewStateRoot(batchUUID, tx, newRootString, persistence); - - result.newRoot[0] = newRoot[0]; - result.newRoot[1] = newRoot[1]; - result.newRoot[2] = newRoot[2]; - result.newRoot[3] = newRoot[3]; - } - else - { - // TODO: implementation - } - - return ZKR_SUCCESS; -} - -zkresult Smt64::get (const string &batchUUID, Database64 &db, const Goldilocks::Element (&root)[4], const Goldilocks::Element (&key)[4], SmtGetResult &result, DatabaseMap *dbReadLog) -{ -#ifdef LOG_SMT - zklog.info("Smt64::get() called with root=" + fea2string(fr,root) + " and key=" + fea2string(fr,key)); -#endif - - bool bUseStateManager = db.config.stateManager && (batchUUID.size() > 0); - - // Read the content of db for entry r: siblings[level] = db.read(r) - string keyString = fea2string(fr, key); - mpz_class value; - zkresult zkr = ZKR_UNSPECIFIED; - if (bUseStateManager) - { - zkr = stateManager64.read(batchUUID, keyString, value, dbReadLog); - } - if (zkr != ZKR_SUCCESS) - { - zkr = db.readKV(root, key, value, dbReadLog); - } - if (zkr != ZKR_SUCCESS) - { - zklog.error("Smt64::get() db.read error: " + to_string(zkr) + " (" + zkresult2string(zkr) + ") root:" + fea2string(fr, root)); - return zkr; - } - - result.value = value; - - return ZKR_SUCCESS; -} \ No newline at end of file diff --git a/src/hashdb64/smt_64.hpp b/src/hashdb64/smt_64.hpp deleted file mode 100644 index 5ca65aa44..000000000 --- a/src/hashdb64/smt_64.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef SMT_64_HPP -#define SMT_64_HPP - -#include -#include -#include - -#include "poseidon_goldilocks.hpp" -#include "goldilocks_base_field.hpp" -#include "compare_fe.hpp" -#include "database_64.hpp" -#include "database_map.hpp" -#include "zkresult.hpp" -#include "persistence.hpp" -#include "smt_set_result.hpp" -#include "smt_get_result.hpp" -#include "tree_chunk.hpp" -#include "key_value.hpp" - -using namespace std; - -// SMT class -class Smt64 -{ -private: - Goldilocks &fr; - PoseidonGoldilocks poseidon; -public: - Smt64(Goldilocks &fr) : fr(fr) {}; - - zkresult set(const string &batchUUID, uint64_t tx, Database64 &db, const Goldilocks::Element (&oldRoot)[4], const Goldilocks::Element (&key)[4], const mpz_class &value, const Persistence persistence, SmtSetResult &result, DatabaseMap *dbReadLog = NULL); - zkresult get(const string &batchUUID, Database64 &db, const Goldilocks::Element (&root)[4], const Goldilocks::Element (&key)[4], SmtGetResult &result, DatabaseMap *dbReadLog = NULL); -}; - -#endif \ No newline at end of file diff --git a/src/hashdb64/state_manager_64.cpp b/src/hashdb64/state_manager_64.cpp index a5fd0ea74..1b8c5129b 100644 --- a/src/hashdb64/state_manager_64.cpp +++ b/src/hashdb64/state_manager_64.cpp @@ -994,4 +994,81 @@ bool StateManager64::isVirtualStateRoot(const string &stateRoot) Goldilocks::Element root[4]; string2fea(fr, stateRoot, root); return fr.isZero(root[1]) && fr.isZero(root[2]) && fr.isZero(root[3]); +} + +zkresult StateManager64::set (const string &batchUUID, uint64_t tx, Database64 &db, const Goldilocks::Element (&oldRoot)[4], const Goldilocks::Element (&key)[4], const mpz_class &value, const Persistence persistence, SmtSetResult &result, DatabaseMap *dbReadLog) +{ +#ifdef LOG_STATE_MANAGER + zklog.info("StateManager64::set() called with oldRoot=" + fea2string(fr,oldRoot) + " key=" + fea2string(fr,key) + " value=" + value.get_str(16) + " persistent=" + to_string(persistent)); +#endif + + zkresult zkr; + + bool bUseStateManager = db.config.stateManager && (batchUUID.size() > 0); + + if (bUseStateManager) + { + // Set the old state root + string oldRootString; + oldRootString = fea2string(fr, oldRoot); + stateManager64.setOldStateRoot(batchUUID, tx, oldRootString, persistence); + + // Write the key-value pair + string hashString = NormalizeToNFormat(fea2string(fr, key), 64); + zkr = stateManager64.write(batchUUID, tx, hashString, value, persistence); + if (zkr != ZKR_SUCCESS) + { + zklog.error("StateManager64::set() failed calling stateManager.write() key=" + hashString + " result=" + to_string(zkr) + "=" + zkresult2string(zkr)); + } + + // Get a new state root + Goldilocks::Element newRoot[4]; // TODO: Get a new state root + string newRootString; + stateManager64.getVirtualStateRoot(newRoot, newRootString); + + // Set the new sttae root + stateManager64.setNewStateRoot(batchUUID, tx, newRootString, persistence); + + result.newRoot[0] = newRoot[0]; + result.newRoot[1] = newRoot[1]; + result.newRoot[2] = newRoot[2]; + result.newRoot[3] = newRoot[3]; + } + else + { + // TODO: implementation + } + + return ZKR_SUCCESS; +} + +zkresult StateManager64::get (const string &batchUUID, Database64 &db, const Goldilocks::Element (&root)[4], const Goldilocks::Element (&key)[4], SmtGetResult &result, DatabaseMap *dbReadLog) +{ +#ifdef LOG_STATE_MANAGER + zklog.info("StateManager64::get() called with root=" + fea2string(fr,root) + " and key=" + fea2string(fr,key)); +#endif + + bool bUseStateManager = db.config.stateManager && (batchUUID.size() > 0); + + // Read the content of db for entry r: siblings[level] = db.read(r) + string keyString = fea2string(fr, key); + mpz_class value; + zkresult zkr = ZKR_UNSPECIFIED; + if (bUseStateManager) + { + zkr = stateManager64.read(batchUUID, keyString, value, dbReadLog); + } + if (zkr != ZKR_SUCCESS) + { + zkr = db.readKV(root, key, value, dbReadLog); + } + if (zkr != ZKR_SUCCESS) + { + zklog.error("StateManager64::get() db.read error: " + to_string(zkr) + " (" + zkresult2string(zkr) + ") root:" + fea2string(fr, root)); + return zkr; + } + + result.value = value; + + return ZKR_SUCCESS; } \ No newline at end of file diff --git a/src/hashdb64/state_manager_64.hpp b/src/hashdb64/state_manager_64.hpp index 07780d478..0e699c963 100644 --- a/src/hashdb64/state_manager_64.hpp +++ b/src/hashdb64/state_manager_64.hpp @@ -11,6 +11,8 @@ #include "database_64.hpp" #include "utils/time_metric.hpp" #include "poseidon_goldilocks.hpp" +#include "smt_get_result.hpp" +#include "smt_set_result.hpp" using namespace std; @@ -110,6 +112,10 @@ class StateManager64 // Lock/Unlock void Lock(void) { pthread_mutex_lock(&mutex); }; void Unlock(void) { pthread_mutex_unlock(&mutex); }; + + zkresult set(const string &batchUUID, uint64_t tx, Database64 &db, const Goldilocks::Element (&oldRoot)[4], const Goldilocks::Element (&key)[4], const mpz_class &value, const Persistence persistence, SmtSetResult &result, DatabaseMap *dbReadLog = NULL); + zkresult get(const string &batchUUID, Database64 &db, const Goldilocks::Element (&root)[4], const Goldilocks::Element (&key)[4], SmtGetResult &result, DatabaseMap *dbReadLog = NULL); + }; extern StateManager64 stateManager64; diff --git a/src/service/hashdb/hashdb.cpp b/src/service/hashdb/hashdb.cpp index fbb15ad99..ec50b2edb 100644 --- a/src/service/hashdb/hashdb.cpp +++ b/src/service/hashdb/hashdb.cpp @@ -11,7 +11,7 @@ #include "state_manager_64.hpp" #include "tree_64.hpp" -HashDB::HashDB(Goldilocks &fr, const Config &config) : fr(fr), config(config), db(fr, config), db64(fr, config), smt(fr), smt64(fr) +HashDB::HashDB(Goldilocks &fr, const Config &config) : fr(fr), config(config), db(fr, config), db64(fr, config), smt(fr) { if (config.hashDB64) { @@ -48,7 +48,7 @@ zkresult HashDB::set (const string &batchUUID, uint64_t tx, const Goldilocks::El if (config.hashDB64) { - zkr = smt64.set(batchUUID, tx, db64, oldRoot, key, value, persistence, *r, dbReadLog); + zkr = stateManager64.set(batchUUID, tx, db64, oldRoot, key, value, persistence, *r, dbReadLog); } else { @@ -83,7 +83,7 @@ zkresult HashDB::get (const string &batchUUID, const Goldilocks::Element (&root) if (config.hashDB64) { - zkr = smt64.get(batchUUID, db64, root, key, *r, dbReadLog); + zkr = stateManager64.get(batchUUID, db64, root, key, *r, dbReadLog); } else { diff --git a/src/service/hashdb/hashdb.hpp b/src/service/hashdb/hashdb.hpp index ffb1eda70..213c44107 100644 --- a/src/service/hashdb/hashdb.hpp +++ b/src/service/hashdb/hashdb.hpp @@ -6,7 +6,6 @@ #include "database_64.hpp" #include "config.hpp" #include "smt.hpp" -#include "smt_64.hpp" #include "hashdb_interface.hpp" #include "zkresult.hpp" #include "utils/time_metric.hpp" @@ -21,7 +20,6 @@ class HashDB : public HashDBInterface Database64 db64; private: Smt smt; - Smt64 smt64; #ifdef HASHDB_LOCK recursive_mutex mlock; diff --git a/test/hashdb/smt_64_test.cpp b/test/hashdb/smt_64_test.cpp index debaebd0b..03d087262 100644 --- a/test/hashdb/smt_64_test.cpp +++ b/test/hashdb/smt_64_test.cpp @@ -1,5 +1,4 @@ #include "smt_64_test.hpp" -#include "smt_64.hpp" #include "smt.hpp" #include "hashdb_singleton.hpp" #include "unistd.h" From baf3ab079fb3eedda5ab9aae4a9507a2187518f1 Mon Sep 17 00:00:00 2001 From: fractasy Date: Wed, 20 Sep 2023 11:22:42 +0000 Subject: [PATCH 3/3] Create Config::check() and call it from main() --- src/config/config.cpp | 156 ++++++++++++++++++++++++++++++++++++++++++ src/config/config.hpp | 1 + src/main.cpp | 149 +--------------------------------------- 3 files changed, 160 insertions(+), 146 deletions(-) diff --git a/src/config/config.cpp b/src/config/config.cpp index 6832f3342..1c678ec61 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -502,6 +502,162 @@ void Config::print(void) zklog.info(" fullTracerTraceReserveSize=" + to_string(fullTracerTraceReserveSize)); zklog.info(" ECRecoverPrecalc=" + to_string(ECRecoverPrecalc)); zklog.info(" ECRecoverPrecalcNThreads=" + to_string(ECRecoverPrecalcNThreads)); +} +bool Config::check (void) +{ + // Check required files presence + bool bError = false; + if (!fileExists(rom)) + { + zklog.error("Required file config.rom=" + rom + " does not exist"); + bError = true; + } + if (generateProof()) + { + if (!fileExists(zkevmConstPols)) + { + zklog.error("required file config.zkevmConstPols=" + zkevmConstPols + " does not exist"); + bError = true; + } + if (!fileExists(c12aConstPols)) + { + zklog.error("required file config.c12aConstPols=" + c12aConstPols + " does not exist"); + bError = true; + } + if (!fileExists(recursive1ConstPols)) + { + zklog.error("required file config.recursive1ConstPols=" + recursive1ConstPols + " does not exist"); + bError = true; + } + if (!fileExists(recursive2ConstPols)) + { + zklog.error("required file config.recursive2ConstPols=" + recursive2ConstPols + " does not exist"); + bError = true; + } + if (!fileExists(recursivefConstPols)) + { + zklog.error("required file config.recursivefConstPols=" + recursivefConstPols + " does not exist"); + bError = true; + } + + if (!fileExists(zkevmConstantsTree)) + { + zklog.error("required file config.zkevmConstantsTree=" + zkevmConstantsTree + " does not exist"); + bError = true; + } + if (!fileExists(c12aConstantsTree)) + { + zklog.error("required file config.c12aConstantsTree=" + c12aConstantsTree + " does not exist"); + bError = true; + } + if (!fileExists(recursive1ConstantsTree)) + { + zklog.error("required file config.recursive1ConstantsTree=" + recursive1ConstantsTree + " does not exist"); + bError = true; + } + if (!fileExists(recursive2ConstantsTree)) + { + zklog.error("required file config.recursive2ConstantsTree=" + recursive2ConstantsTree + " does not exist"); + bError = true; + } + if (!fileExists(recursivefConstantsTree)) + { + zklog.error("required file config.recursivefConstantsTree=" + recursivefConstantsTree + " does not exist"); + bError = true; + } + if (!fileExists(zkevmVerifier)) + { + zklog.error("required file config.zkevmVerifier=" + zkevmVerifier + " does not exist"); + bError = true; + } + if (!fileExists(recursive1Verifier)) + { + zklog.error("required file config.recursive1Verifier=" + recursive1Verifier + " does not exist"); + bError = true; + } + if (!fileExists(recursive2Verifier)) + { + zklog.error("required file config.recursive2Verifier=" + recursive2Verifier + " does not exist"); + bError = true; + } + if (!fileExists(recursive2Verkey)) + { + zklog.error("required file config.recursive2Verkey=" + recursive2Verkey + " does not exist"); + bError = true; + } + if (!fileExists(finalVerifier)) + { + zklog.error("required file config.finalVerifier=" + finalVerifier + " does not exist"); + bError = true; + } + if (!fileExists(recursivefVerifier)) + { + zklog.error("required file config.recursivefVerifier=" + recursivefVerifier + " does not exist"); + bError = true; + } + if (!fileExists(finalStarkZkey)) + { + zklog.error("required file config.finalStarkZkey=" + finalStarkZkey + " does not exist"); + bError = true; + } + if (!fileExists(storageRomFile)) + { + zklog.error("required file config.storageRomFile=" + storageRomFile + " does not exist"); + bError = true; + } + if (!fileExists(zkevmStarkInfo)) + { + zklog.error("required file config.zkevmStarkInfo=" + zkevmStarkInfo + " does not exist"); + bError = true; + } + if (!fileExists(c12aStarkInfo)) + { + zklog.error("required file config.c12aStarkInfo=" + c12aStarkInfo + " does not exist"); + bError = true; + } + if (!fileExists(recursive1StarkInfo)) + { + zklog.error("required file config.recursive1StarkInfo=" + recursive1StarkInfo + " does not exist"); + bError = true; + } + if (!fileExists(recursive2StarkInfo)) + { + zklog.error("required file config.recursive2StarkInfo=" + recursive2StarkInfo + " does not exist"); + bError = true; + } + if (!fileExists(recursivefStarkInfo)) + { + zklog.error("required file config.recursivefStarkInfo=" + recursivefStarkInfo + " does not exist"); + bError = true; + } + if (!fileExists(c12aExec)) + { + zklog.error("required file config.c12aExec=" + c12aExec + " does not exist"); + bError = true; + } + if (!fileExists(recursive1Exec)) + { + zklog.error("required file config.recursive1Exec=" + recursive1Exec + " does not exist"); + bError = true; + } + if (!fileExists(recursive2Exec)) + { + zklog.error("required file config.recursive2Exec=" + recursive2Exec + " does not exist"); + bError = true; + } + if (!fileExists(recursivefExec)) + { + zklog.error("required file config.recursivefExec=" + recursivefExec + " does not exist"); + bError = true; + } + } + + if (hashDB64 && !stateManager) + { + zklog.error("hashDB64=true but stateManager=false"); + bError = true; + } + return bError; } \ No newline at end of file diff --git a/src/config/config.hpp b/src/config/config.hpp index e4660e6ae..8555645b6 100644 --- a/src/config/config.hpp +++ b/src/config/config.hpp @@ -184,6 +184,7 @@ class Config void load(json &config); bool generateProof(void) const { return runFileGenBatchProof || runFileGenAggregatedProof || runFileGenFinalProof || runAggregatorClient; } void print(void); + bool check(void); // Checks that the loaded configuration is correct; returns true if there is at least one error }; #endif \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 3f2646756..a182783f9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -339,154 +339,11 @@ int main(int argc, char **argv) TimerStart(WHOLE_PROCESS); - // Check required files presence - bool bError = false; - if (!fileExists(config.rom)) + if (config.check()) { - zklog.error("Required file config.rom=" + config.rom + " does not exist"); - bError = true; - } - if (config.generateProof()) - { - if (!fileExists(config.zkevmConstPols)) - { - zklog.error("required file config.zkevmConstPols=" + config.zkevmConstPols + " does not exist"); - bError = true; - } - if (!fileExists(config.c12aConstPols)) - { - zklog.error("required file config.c12aConstPols=" + config.c12aConstPols + " does not exist"); - bError = true; - } - if (!fileExists(config.recursive1ConstPols)) - { - zklog.error("required file config.recursive1ConstPols=" + config.recursive1ConstPols + " does not exist"); - bError = true; - } - if (!fileExists(config.recursive2ConstPols)) - { - zklog.error("required file config.recursive2ConstPols=" + config.recursive2ConstPols + " does not exist"); - bError = true; - } - if (!fileExists(config.recursivefConstPols)) - { - zklog.error("required file config.recursivefConstPols=" + config.recursivefConstPols + " does not exist"); - bError = true; - } - - if (!fileExists(config.zkevmConstantsTree)) - { - zklog.error("required file config.zkevmConstantsTree=" + config.zkevmConstantsTree + " does not exist"); - bError = true; - } - if (!fileExists(config.c12aConstantsTree)) - { - zklog.error("required file config.c12aConstantsTree=" + config.c12aConstantsTree + " does not exist"); - bError = true; - } - if (!fileExists(config.recursive1ConstantsTree)) - { - zklog.error("required file config.recursive1ConstantsTree=" + config.recursive1ConstantsTree + " does not exist"); - bError = true; - } - if (!fileExists(config.recursive2ConstantsTree)) - { - zklog.error("required file config.recursive2ConstantsTree=" + config.recursive2ConstantsTree + " does not exist"); - bError = true; - } - if (!fileExists(config.recursivefConstantsTree)) - { - zklog.error("required file config.recursivefConstantsTree=" + config.recursivefConstantsTree + " does not exist"); - bError = true; - } - if (!fileExists(config.zkevmVerifier)) - { - zklog.error("required file config.zkevmVerifier=" + config.zkevmVerifier + " does not exist"); - bError = true; - } - if (!fileExists(config.recursive1Verifier)) - { - zklog.error("required file config.recursive1Verifier=" + config.recursive1Verifier + " does not exist"); - bError = true; - } - if (!fileExists(config.recursive2Verifier)) - { - zklog.error("required file config.recursive2Verifier=" + config.recursive2Verifier + " does not exist"); - bError = true; - } - if (!fileExists(config.recursive2Verkey)) - { - zklog.error("required file config.recursive2Verkey=" + config.recursive2Verkey + " does not exist"); - bError = true; - } - if (!fileExists(config.finalVerifier)) - { - zklog.error("required file config.finalVerifier=" + config.finalVerifier + " does not exist"); - bError = true; - } - if (!fileExists(config.recursivefVerifier)) - { - zklog.error("required file config.recursivefVerifier=" + config.recursivefVerifier + " does not exist"); - bError = true; - } - if (!fileExists(config.finalStarkZkey)) - { - zklog.error("required file config.finalStarkZkey=" + config.finalStarkZkey + " does not exist"); - bError = true; - } - if (!fileExists(config.storageRomFile)) - { - zklog.error("required file config.storageRomFile=" + config.storageRomFile + " does not exist"); - bError = true; - } - if (!fileExists(config.zkevmStarkInfo)) - { - zklog.error("required file config.zkevmStarkInfo=" + config.zkevmStarkInfo + " does not exist"); - bError = true; - } - if (!fileExists(config.c12aStarkInfo)) - { - zklog.error("required file config.c12aStarkInfo=" + config.c12aStarkInfo + " does not exist"); - bError = true; - } - if (!fileExists(config.recursive1StarkInfo)) - { - zklog.error("required file config.recursive1StarkInfo=" + config.recursive1StarkInfo + " does not exist"); - bError = true; - } - if (!fileExists(config.recursive2StarkInfo)) - { - zklog.error("required file config.recursive2StarkInfo=" + config.recursive2StarkInfo + " does not exist"); - bError = true; - } - if (!fileExists(config.recursivefStarkInfo)) - { - zklog.error("required file config.recursivefStarkInfo=" + config.recursivefStarkInfo + " does not exist"); - bError = true; - } - if (!fileExists(config.c12aExec)) - { - zklog.error("required file config.c12aExec=" + config.c12aExec + " does not exist"); - bError = true; - } - if (!fileExists(config.recursive1Exec)) - { - zklog.error("required file config.recursive1Exec=" + config.recursive1Exec + " does not exist"); - bError = true; - } - if (!fileExists(config.recursive2Exec)) - { - zklog.error("required file config.recursive2Exec=" + config.recursive2Exec + " does not exist"); - bError = true; - } - if (!fileExists(config.recursivefExec)) - { - zklog.error("required file config.recursivefExec=" + config.recursivefExec + " does not exist"); - bError = true; - } - } - if (bError) + zklog.error("main() failed calling config.check()"); exitProcess(); + } // Create one instance of the Goldilocks finite field instance Goldilocks fr;