Skip to content

Commit

Permalink
Rename QueueEvent::StartWork (#6015)
Browse files Browse the repository at this point in the history
# Description

When we send `QueueEvent::StartWork`, we have already completed the
execution. This may be a leftover of a previous logic change. Currently,
the name is misleading, so it would be better to rename it to
`FinishWork`.


https://github.com/paritytech/polkadot-sdk/blob/c52675efdc05e181ddcec72d3bd425dc0a89d622/polkadot/node/core/pvf/src/execute/queue.rs#L632-L646


https://github.com/paritytech/polkadot-sdk/blob/c52675efdc05e181ddcec72d3bd425dc0a89d622/polkadot/node/core/pvf/src/execute/queue.rs#L361-L363

Fixes #5910

## Integration

Shouldn't affect downstream projects.

---------

Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
AndreiEres and actions-user authored Oct 11, 2024
1 parent c16ac92 commit e5ccc00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions polkadot/node/core/pvf/src/execute/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl Workers {

enum QueueEvent {
Spawn(IdleWorker, WorkerHandle, ExecuteJob),
StartWork(
FinishWork(
Worker,
Result<WorkerInterfaceResponse, WorkerInterfaceError>,
ArtifactId,
Expand Down Expand Up @@ -333,7 +333,7 @@ async fn handle_mux(queue: &mut Queue, event: QueueEvent) {
QueueEvent::Spawn(idle, handle, job) => {
handle_worker_spawned(queue, idle, handle, job);
},
QueueEvent::StartWork(worker, outcome, artifact_id, result_tx) => {
QueueEvent::FinishWork(worker, outcome, artifact_id, result_tx) => {
handle_job_finish(queue, worker, outcome, artifact_id, result_tx).await;
},
}
Expand Down Expand Up @@ -615,7 +615,7 @@ fn assign(queue: &mut Queue, worker: Worker, job: ExecuteJob) {
job.pov,
)
.await;
QueueEvent::StartWork(worker, result, job.artifact.id, job.result_tx)
QueueEvent::FinishWork(worker, result, job.artifact.id, job.result_tx)
}
.boxed(),
);
Expand Down
9 changes: 9 additions & 0 deletions prdoc/pr_6015.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: Rename QueueEvent::StartWork
doc:
- audience: Node Dev
description: |-
When we send `QueueEvent::StartWork`, we have already completed the execution. Therefore, `QueueEvent::FinishWork` is a better match.

crates:
- name: polkadot-node-core-pvf
bump: patch

0 comments on commit e5ccc00

Please sign in to comment.