PVF: drop backing jobs if it is too late#5616
Conversation
Co-authored-by: Andrei Sandu <[email protected]>
| if in_active_fork { | ||
| None | ||
| } else { | ||
| Some(index) | ||
| } |
There was a problem hiding this comment.
We could directly filter on the queue, so if in active fork we send ValidationError::ExecutionDeadline and return true otherwise false.
There was a problem hiding this comment.
I can't send the result inside the closure, that why I didn't use retain
There was a problem hiding this comment.
why not? the send function is not async and we ignore the result
alindima
left a comment
There was a problem hiding this comment.
Nice! Just a couple of suggestions
Fixes #5530 This PR introduces the removal of backing jobs that have been back pressured for longer than `allowedAncestryLen`, as these candidates are no longer viable. It is reasonable to expect a result for a backing job execution within `allowedAncestryLen` blocks. Therefore, we set the job TTL as a relay block number and synchronize the validation host by sending activated leaves. --------- Co-authored-by: Andrei Sandu <[email protected]> Co-authored-by: Branislav Kontur <[email protected]>
| /// The execution deadline of allowed_ancestry_len + 1 has been reached. Jobs like backing have | ||
| /// a limited time to execute. Once the deadline is reached, the current candidate cannot be | ||
| /// backed, regardless of its validity. | ||
| #[error("candidate validation: execution deadline has been reached.")] | ||
| ExecutionDeadline, |
There was a problem hiding this comment.
Nice PR! Would this have worked as an InternalValidationError? If there is back pressure, it's technically not a problem with the PVF itself, so you could have nodes abstain from voting instead of voting against. The only reason I'd be hesitant with that, is that if one node is experiencing back pressure, it's possible that the rest of the network is as well. If too many nodes abstain then IIRC it could cause a finality stall.
There was a problem hiding this comment.
OMG, that's one epic comeback!
There was a problem hiding this comment.
@mrcnski have we met before?
We have backing back pressure that should free workers to do approval job, so the effect is supposed to be opposite.
Fixes #5530
This PR introduces the removal of backing jobs that have been back pressured for longer than
allowedAncestryLen, as these candidates are no longer viable.It is reasonable to expect a result for a backing job execution within
allowedAncestryLenblocks. Therefore, we set the job TTL as a relay block number and synchronize the validation host by sending activated leaves.