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

Fixing issues in key-value database #548

Merged
merged 16 commits into from
Sep 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add zeros into KVCache
  • Loading branch information
rickb80 committed Sep 8, 2023
commit 591d22119637742f6a609eceed07b6398124fbdd
10 changes: 9 additions & 1 deletion src/hashdb64/database_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ zkresult Database64::readKV(const Goldilocks::Element (&root)[4], const Goldiloc
if( rkv == ZKR_DB_VERSION_NOT_FOUND_GLOBAL){
value = 0;
rout = rkv;
mpz_class zero(0);
dbKVACache.addKeyValueVersion(version, key, zero, false);
}else{
zkresult rtree = ZKR_UNSPECIFIED;
vector<KeyValue> keyValues(1);
Expand Down Expand Up @@ -1406,7 +1408,13 @@ zkresult Database64::writeRemoteKV(const uint64_t version, const Goldilocks::Ele
}
insertStr = insertStr + data;
}
}
} else{
if(version > 1){
//this must be reproduced into multiwrite
mpz_class zero(0);
dbKVACache.addKeyValueVersion(version-1, key, zero, false);
}
}
}
catch (const std::exception &e)
{
Expand Down