-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat(coprocessor): add mechanism to release dependence chains when no progress #1696
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
base: release/0.10.x
Are you sure you want to change the base?
Conversation
🧪 CI InsightsHere's what we observed from your CI run for 32dc8d0. 🟢 All jobs passed!But CI Insights is watching 👀 |
5778aaa to
e951f11
Compare
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.
Pull request overview
This PR adds a mechanism to release dependence chain locks when no progress is being made during worker cycles. The implementation tracks progress across worker cycles and releases locks after a configurable number of cycles without progress, allowing other chains to be processed.
Key Changes
- Introduces a no-progress cycle counter that releases dependence chain locks when a threshold is reached
- Modifies the database schema to mark non-allowed computations as completed immediately upon insertion
- Updates the
release_current_lockAPI to optionally set thelast_updated_attimestamp for released chains
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
tfhe-worker/src/tfhe_worker.rs |
Adds no-progress tracking mechanism, modifies query_for_work to return earliest computation timestamp, updates upload_transaction_graph_results to return progress indicator |
tfhe-worker/src/dependence_chain.rs |
Extends release_current_lock to accept optional timestamp parameter for updating last_updated_at field |
tfhe-worker/src/daemon_cli.rs |
Adds CLI argument for configuring maximum no-progress cycles threshold |
tfhe-worker/src/tests/utils.rs |
Updates test configuration with new dcid_max_no_progress_cycles parameter |
host-listener/src/database/tfhe_event_propagate.rs |
Modifies computation insertion to mark non-allowed operations as completed immediately |
tfhe-worker/Cargo.toml |
Adds time crate dependency |
Cargo.lock |
Updates lock file with time dependency |
.sqlx/query-*.json |
Updates SQLx query metadata for modified database queries |
Files not reviewed (1)
- coprocessor/fhevm-engine/.sqlx/query-156dcfa2ae70e64be2eb8014928745a9c95e29d18a435f4d2e2fda2afd7952bf.json: Language not supported
Comments suppressed due to low confidence (1)
coprocessor/fhevm-engine/tfhe-worker/src/tfhe_worker.rs:686
- Inconsistent indentation: tabs are used here instead of spaces. The rest of the codebase uses spaces for indentation. This should be changed to use spaces to maintain consistency.
let (tenant_ids, (handles, (ciphertexts, (ciphertext_versions, ciphertext_types)))): (
Vec<_>,
(Vec<_>, (Vec<_>, (Vec<_>, Vec<_>))),
) = cts_to_insert.into_iter().unzip();
let _ = query!(
"
INSERT INTO ciphertexts(tenant_id, handle, ciphertext, ciphertext_version, ciphertext_type)
SELECT * FROM UNNEST($1::INTEGER[], $2::BYTEA[], $3::BYTEA[], $4::SMALLINT[], $5::SMALLINT[])
ON CONFLICT (tenant_id, handle, ciphertext_version) DO NOTHING
",
&tenant_ids, &handles, &ciphertexts, &ciphertext_versions, &ciphertext_types)
.execute(trx.as_mut())
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e951f11 to
9ad7851
Compare
…exity across block
9ad7851 to
c01c771
Compare
No description provided.