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

Set limit to the PoT verification #3153

Open
NingLin-P opened this issue Oct 21, 2024 · 0 comments
Open

Set limit to the PoT verification #3153

NingLin-P opened this issue Oct 21, 2024 · 0 comments
Assignees
Labels
improvement it is already working, but can be better

Comments

@NingLin-P
Copy link
Member

Currently, when verifying PoT during block import and in the gossip worker, we are using rayon to maximize the parallelism and use as many cores as needed, which causes other workers to starve, especially causing Slow domain block execution.. log for the domain worker, setting a limit for the PoT verification and reserve some compute resource for other workers will be helpful.

checkpoints_verification_input
.into_par_iter()
.find_map_first(|(pot_input, checkpoints)| {
if full_pot_verification {
// Try to find invalid checkpoints
if !pot_verifier.verify_checkpoints(
pot_input.seed,
pot_input.slot_iterations,
&checkpoints,
) {
return Some(VerificationError::InvalidProofOfTime);
}

rayon::spawn({
let engine = Arc::clone(&self.engine);
let network = Arc::clone(&self.network);
let pot_verifier = self.pot_verifier.clone();
let from_gossip_sender = self.from_gossip_sender.clone();
let topic = self.topic;
move || {
Self::handle_potentially_matching_proofs(

cc @nazar-pc

@nazar-pc nazar-pc self-assigned this Oct 21, 2024
@nazar-pc nazar-pc added the improvement it is already working, but can be better label Oct 21, 2024
@nazar-pc nazar-pc added this to the Protocol UX Improvements milestone Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement it is already working, but can be better
Projects
Development

No branches or pull requests

2 participants