coprocessor/fhevm-engine/sns-worker/README.md
Upon receiving a notification, it mainly does the following steps:
(handle, compressed_ct) pairs from pbs_computations and ciphertexts tables.large_ct using the Switch-and-Squash algorithm.large_ct column in the ciphertexts table for the corresponding handle.large_ct.decrypt_128 - Decrypt each large_ct and print it as a plaintext (for testing purposes only).
Runs sns-executor. See also src/bin/utils/daemon_cli.rs
-- Example query to import sns_pk from fhevm-keys/sns_pk
-- Import the sns_pk into the Large Object storage
sns_pk_loid := lo_import('../fhevm-keys/sns_pk');
-- Update the keys table with the new Large Object OID
UPDATE keys
SET sns_pk = sns_pk_loid
WHERE key_id = ...; -- specify the appropriate key_id
# Run a single instance of the worker
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/coprocessor \
cargo run --release -- \
--pg-listen-channels "event_pbs_computations" "event_ciphertext_computed" \
--pg-notify-channel "event_pbs_computed" \
Notes:
host_chain_id is read directly from pbs_computations/ciphertext_digest rows.Postgres docker image# Run Postgres as image, execute migrations and populate the DB instance with keys from fhevm-keys
cargo test --release -- --nocapture
# Use COPROCESSOR_TEST_LOCALHOST_RESET to execute migrations once
COPROCESSOR_TEST_LOCALHOST_RESET=1 cargo test --release -- --nocapture
# Then, on every run
COPROCESSOR_TEST_LOCALHOST=1 cargo test --release