This PR implements the core precompile logic that handles the parallel FHE function calls.
Implement the parallel FHE calls:
When a decrypt/req/sealOutput precompile starts, first check if we already have the result cached already. If so - return it regardless of if we're in a gas estimation, static call or just regular execution.
Otherwise, if gas estimation - return the default value (didn't change).
If query/static_call - try to do a synchronous call (we're not changing the state here).
Otherwise, the Commit flag is on, which means we're trying to asynchronously evaluate the ct.
Fix a small type assertion bug in DecryptionResults.
Note that the caching behavior for sealOutput results is a bit different - it doesn't make sense to cache results per-ciphertext, since the result will change based on the input public key - that's why I also implemented the genSealedKey() function that creates a unique id for every (ciphertext,public key) pair request.
This PR implements the core precompile logic that handles the parallel FHE function calls.
decrypt/req/sealOutput
precompile starts, first check if we already have the result cached already. If so - return it regardless of if we're in a gas estimation, static call or just regular execution.Commit
flag is on, which means we're trying to asynchronously evaluate the ct.DecryptionResults
.genSealedKey()
function that creates a unique id for every(ciphertext,public key)
pair request.1588750400