Skip to content
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

feat: throttling, batching websocket requests #57

Merged
merged 8 commits into from
Nov 22, 2024

Conversation

dprats
Copy link
Collaborator

@dprats dprats commented Nov 22, 2024

Current State of the world

This is the progress object that is sent to the orchestrator,

let progress = ClientProgramProofRequest {
               steps_in_trace: total_steps as i32,
               steps_proven,
               step_to_start: start as i32,
               program_id: "fast-fib".to_string(),
               client_id_token: None,
               proof_duration_millis: progress_duration.as_millis() as i32,
               k,
               cli_prover_id: Some(prover_id.clone()),
           };

Currently, it is sent to the orchestrator at each step. If offline, it currently retries 5 times and gives up

This PR does the following:

Changes the logic so:

  • ClientProgramProofRequest is now sent every 3 minutes, and not every step
  • adds logic that checks if the websockets connection to orchestrator is lost. If lost, it tries 5 times. After the 5th time, it gives up and then tries again at the next interval (in 3 minutes).
  • Store proof_duration_millis and steps_proven in memory and update ClientProgramProofRequest with the new variables.
  • Batch the ClientProgramProofRequest objects being sent to the orchestrator
  • It assume it could take hours for connectivity to be back online

Diego Prats added 7 commits November 21, 2024 14:33

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
… time for intervals 3 minutes
@dprats dprats marked this pull request as ready for review November 22, 2024 00:14
Copy link

github-actions bot commented Nov 22, 2024

Visit the preview URL for this PR (updated for commit 51d97b8):

https://nexus-cli--pr57-dprats-cli-batching-lq2eqy64.web.app

(expires Fri, 29 Nov 2024 01:09:43 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 815ec4c632754f56eccfacfc0919559f5a85a0f1

@dprats dprats changed the title feat: feat: throttling, batching websocket requests Nov 22, 2024
clients/cli/src/prover.rs Show resolved Hide resolved
clients/cli/src/prover.rs Outdated Show resolved Hide resolved
clients/cli/src/prover.rs Outdated Show resolved Hide resolved
@dprats dprats merged commit aa1c0c6 into main Nov 22, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants