Skip to content

feat(coprocessor): add a non-blocking, distributed locking mechanism across multiple tfhe-workers#1506

Closed
goshawk-3 wants to merge 13 commits intomainfrom
georgi/tfhe-worker/dependence_chain_id
Closed

feat(coprocessor): add a non-blocking, distributed locking mechanism across multiple tfhe-workers#1506
goshawk-3 wants to merge 13 commits intomainfrom
georgi/tfhe-worker/dependence_chain_id

Conversation

@goshawk-3
Copy link
Copy Markdown
Contributor

@goshawk-3 goshawk-3 commented Dec 8, 2025

This adds a non-blocking, distributed locking mechanism that coordinates dependence-chain processing across tfhe-workers replicas.

A worker can acquire a lock of the next available dependence-chain entry for processing ordered by last_updated_at (FIFO queue-like approach).

Ownership expires after a timeout, enabling work-stealing by other workers for resilience.

New CLI params

  • --worker_id
  • --dcid_ttl_sec

@goshawk-3 goshawk-3 requested a review from a team as a code owner December 8, 2025 08:33
@cla-bot cla-bot Bot added the cla-signed label Dec 8, 2025
Comment thread coprocessor/fhevm-engine/tfhe-worker/src/dependence_chain.rs Outdated
Comment thread coprocessor/fhevm-engine/tfhe-worker/benches/utils.rs
@goshawk-3 goshawk-3 marked this pull request as draft December 9, 2025 15:01
@goshawk-3 goshawk-3 force-pushed the georgi/tfhe-worker/dependence_chain_id branch from 762c51d to 70e2cd6 Compare December 9, 2025 15:19
@goshawk-3 goshawk-3 changed the title (feat)coprocessor: add a non-blocking, distributed locking mechanism across multiple tfhe-workers feat(coprocessor): add a non-blocking, distributed locking mechanism across multiple tfhe-workers Dec 9, 2025
@goshawk-3 goshawk-3 force-pushed the georgi/tfhe-worker/dependence_chain_id branch from 70e2cd6 to 07b980f Compare December 10, 2025 03:48
Comment thread coprocessor/fhevm-engine/tfhe-worker/src/tfhe_worker.rs Outdated
Comment thread coprocessor/fhevm-engine/tfhe-worker/src/dependence_chain.rs Outdated
@mergify
Copy link
Copy Markdown

mergify Bot commented Dec 10, 2025

🧪 CI Insights

Here's what we observed from your CI run for b206f87.

🟢 All jobs passed!

But CI Insights is watching 👀

ORDER BY schedule_order
LIMIT $1
LIMIT $2
) as c_schedule_order
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say at some point we won't need the union here (probably not even need the schedule order anymore as that would be the role of the last_updated_at in a sense), but can keep for now. We'll have to refactor/simplify this handling, but we need to think of a way to deal with missing events wrt. dependence chain selection as well at some point. If there's "lots" of workers it's less of a problem as only some would be stuck

@goshawk-3 goshawk-3 force-pushed the georgi/tfhe-worker/dependence_chain_id branch from 4618e0d to b206f87 Compare December 11, 2025 13:29
@goshawk-3
Copy link
Copy Markdown
Contributor Author

Closed as duplicate #1550

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants