Tags: zama-ai/fhevm
Tags
feat(coprocessor): add ability to revert to a previous state (#2122) * feat(coprocessor): add ability to revert to a previous state If a coprocessor is in a bad state, it can be useful to revert to a previous state and redo the computations and other operations with the hope that it reaches the correct state. Reversal can be initiated by providing a host chain ID and a block number to revert to. The reversal process expects that all coprocessor components are stopped before running it. In order to delete data by block number and chain ID, we have to add a DB migration to keep track of them for all relevant tables. For blocks before this migration, we won't be able to revert, but we assume this is acceptable, also given that there isn't much we can do. Reasoning for the way we implemented reversal is that we assumes we would be able to detect a state drift with a ciphertext granularity. Consequently, the first such drift that we observe means that no prior state was affected. That is why we delete all data for blocks including the offending one and the ones after it. Note that above assumes all ciphertext have been computed up to the offending block, but in reality, due to out-of-order processing, it might not be the case. That means some prior ciphertexts might also drift. Therefore, operators might choose to go a bit further back than the offending block to make it even more likely to capture the root cause of the drift. For now, we cannot revert across a key rotation boundary. The tfhe-worker always uses the latest key from the `keys` table. If a new key was activated after to_block_number, re-processed computations will use the new key instead of the original one, producing incorrect ciphertexts. This commit adds a test that checks the DB after the reversal script has run, an integration test for the host listener, and an E2E test. Finally, we add the `db-state-revert` docker image that can be used to run the reversal script in a containerized environment. * fix(coprocessor): do not delete dependence_chain entries in DB state revert script * chore(coprocessor): revert script inside the db-migration image
fix(host-contracts): upgrade FHEVMExecutor to v0.2.0 (#2144) * fix: reject scalar div/rem values that truncate to zero * fix: make executor hotfix upgrade-safe * test: cover scalar div rem truncation across widths * chore: bump executor minor version for hotfix upgrades * chore(host-contracts): refresh executor rust bindings
PreviousNext