-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: implement ciphertext cache preload upon restart #187
Conversation
5305268
to
4f29096
Compare
case FheNeg, FheNot: | ||
return true | ||
case FheAdd, FheBitAnd, FheBitOr, FheBitXor, FheDiv, FheEq, FheGe, FheGt, FheLe, FheLt, FheMax, FheMin, FheMul, FheNe, FheRem, FheRotl, FheRotr, FheShl, FheShr, FheSub, FheCast, FheRand, FheRandBounded, FheIfThenElse, TrivialEncrypt: | ||
return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for nitpicking - but might even drop the false branch and leave it to default :)
If we don't have ternary ops we might otherwise just implement binary as !unary, but that's not essential.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish it was more like rust, where we would have to list all the cases or its a compile time error, we might forget an operand 🤔
I guess when a node is catching up after being down for some time, it would be receiving blocks continuously, without having a block time between them. If we run computations as per normal, that would mess up the schedule as we'd be assuming block times and when the commit block comes in, it would actually be earlier than as if the node was executing normally. Wondering what the right approach is here, because if we execute the whole queue, we'd add more delay and we'd have to catch up more blocks instead of being "in sync" with consensus. Or maybe it doesn't matter and we just need to ensure that when catching up, we take into account block time is not there... It's an issue that I don't think we've thought about. Wdyt? |
This implements routine that upon blockchain restart inspects the in state blockchain queue of ciphertexts to be computed in the future block and synchronously computes the entire queue before processing blocks.
This is done because in initialization stage we have chance of doing the most efficient possible batch computation where executor would figure out all the dependencies possibly using previous block inputs in future blocks in one request.
@antoniupop @dartdart26 @goshawk-3