-
Notifications
You must be signed in to change notification settings - Fork 92
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(host,tasks): complete aggregation api #387
base: main
Are you sure you want to change the base?
Conversation
Write in-memory implementation Stub out sqlite implementation
if aggregation_request.proofs.is_empty() { | ||
return Err(anyhow::anyhow!("No proofs provided").into()); | ||
} |
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.
IMO, we don't have to check the proofs.
) | ||
)] | ||
#[debug_handler(state = ProverState)] | ||
/// Prune all aggregation tasks. |
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.
The Prone API is oriented to normal users?
I'm afraid that the Prune API is too dangerous as it poses significant risks. I propose categorizing such APIs under 'admin' for better control if we really need.
IMO, In practice, operations team members should and can perform these actions manually. So, is this API truly necessary?
let proof_type = ProofType::from_str( | ||
aggregation_request | ||
.proof_type | ||
.as_deref() | ||
.unwrap_or_default(), | ||
)?; | ||
inc_host_req_count(0); | ||
inc_guest_req_count(&proof_type, 0); |
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.
To maintain consistency with the 'cancel' API across versions 1 and 2, I recommend removing these two lines of code, as we don't record metrics for 'cancel' API (at least not for now, maybe we can add some metrics for 'cancel' API)
|
||
prover_state | ||
.task_channel | ||
.try_send(Message::CancelAggregate(aggregation_request.clone()))?; |
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.
The cancelling aggregation request may be non-existing. In order to prevent useless 'cancel' requests, we should check the status of the target aggregation request by get_aggregation_task_status()
before sending signal to task_channel
.
No description provided.