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(host,tasks): complete aggregation api #387

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

petarvujovic98
Copy link
Contributor

No description provided.

tasks/src/mem_db.rs Show resolved Hide resolved
Comment on lines +48 to +50
if aggregation_request.proofs.is_empty() {
return Err(anyhow::anyhow!("No proofs provided").into());
}
Copy link
Contributor

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.
Copy link
Contributor

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?

Comment on lines +39 to +46
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);
Copy link
Contributor

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()))?;
Copy link
Contributor

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.

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.

3 participants