Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle errors from tfhe-rs (ethereum#135)
Overall strategy is: * we assume operations on well-formed ciphertexts don't fail * for operations we assume shouldn't fail, we use asserts * for operations that we assume can fail, we use return codes Essentially, allowing malformed ciphertexts from txns means these ops could fail at some point in the lifetime of a cihpertext and/or on ciphertexts that are produced from the original one: * deserialization or ciphertexts * decrypt * any FHE operation * serialization We assume the following ops don't fail if all inputs are well-formed: * deser of FHE keys * encryption We also assume that tfhe-rs failures are always deterministic. That allows us to not stop the node on such a failure and assume that all nodes have the same behaviour, leaving nodes in sync. Also, do not use Go finalizers anymore. Instead, ser/deser ciphertexts across the C/Go boundary. That avoids complications with finalizers and memory management. However, it has a performance overhead and we need to be extra careful that we free all C memory manually.
- Loading branch information