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

PVF: drop backing jobs if it is too late #5616

Open
wants to merge 22 commits into
base: AndreiEres/pvf-execution-priority
Choose a base branch
from

Conversation

AndreiEres
Copy link
Contributor

@AndreiEres AndreiEres commented Sep 6, 2024

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 makes sense to expect a result for a backing job execution within allowedAncestryLen * 6s. Since the execution time is not zero but within the range of 0..exec_timeout, we optimize the dropping by subtracting a time sufficient for job execution: allowedAncestryLen * 6s - min_exec_time. The min_exec_time should fall within 0..exec_timeout and represents the minimum observed execution time.

@AndreiEres AndreiEres added T0-node This PR/Issue is related to the topic “node”. I5-enhancement An additional feature request. T8-polkadot This PR/Issue is related to/affects the Polkadot network. labels Sep 6, 2024
@AndreiEres AndreiEres force-pushed the AndreiEres/issue5530 branch 2 times, most recently from 1ab3834 to ee8bd46 Compare September 6, 2024 14:40
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable 2/3
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7288338

@AndreiEres AndreiEres changed the title [WIP] PVF: drop backing jobs if it is too late PVF: drop backing jobs if it is too late Sep 17, 2024
@s0me0ne-unkn0wn
Copy link
Contributor

What if, during the waiting period, Babe misses a slot or two and block times elongate? Will we discard a viable candidate, then? And do we care?

@AndreiEres
Copy link
Contributor Author

What if, during the waiting period, Babe misses a slot or two and block times elongate? Will we discard a viable candidate, then? And do we care?

That's a good question.

Do you mean a situation where a candidate should have been dropped under normal circumstances, but due to a BABE failure, received a chance to be backed? I would say under normal circumstances we have enough time to execute the job. If we have delayed it for so long, it means we're overwhelmed. Dropping this lucky candidate will have more impact than not dropping them in my opinion.

polkadot/node/core/candidate-validation/src/lib.rs Outdated Show resolved Hide resolved
polkadot/node/core/candidate-validation/src/lib.rs Outdated Show resolved Hide resolved
polkadot/node/core/pvf/src/execute/queue.rs Outdated Show resolved Hide resolved
polkadot/node/core/pvf/src/execute/queue.rs Outdated Show resolved Hide resolved
@burdges
Copy link

burdges commented Oct 1, 2024

What if, during the waiting period, Babe misses a slot or two and block times elongate? Will we discard a viable candidate, then? And do we care?

We hopefully do not care much. In fact, we should explore back pressure in block production too, meaning a relay chain block producers drops some backing statements because they believe the network to be overloaded. A dispute or implicit escalation could be "paid for" by delaying like 30 candidates for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request. T0-node This PR/Issue is related to the topic “node”. T8-polkadot This PR/Issue is related to/affects the Polkadot network.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants