Skip to content

orchestrator-driver: execute(VerifyFirmware) blocks on the verifier, so a slow or stuck verifier hangs the orchestrator - #751

Draft
rusty1968 wants to merge 1 commit into
OpenPRoT:mainfrom
rusty1968:driver-async-verifier
Draft

rusty1968 wants to merge 1 commit into
OpenPRoT:mainfrom
rusty1968:driver-async-verifier

Conversation

@rusty1968

Copy link
Copy Markdown
Collaborator

PlatformDriver::execute(VerifyFirmware) called the verifier inline and returned the outcome, so a slow verifier (a crypto service over IPC) blocked the whole dispatch, against the platform rule that replies return as events.

Fixes #736

PlatformDriver::execute(VerifyFirmware) called the verifier inline and
returned the verdict, so a slow verifier (a crypto service over IPC) blocked
the whole dispatch, against the platform rule that replies return as events.

The Verifier trait is now start, poll and cancel. One check is outstanding at
a time, so poll and cancel name no component. VerifyStatus is Pending,
Done(result) or TimedOut. The driver starts a check in execute and collects
the result from poll_verify(now_millis). A timeout is not a verification
result, so the driver reports it as VerificationFailed and the machine
recovers the component instead of locking.

A verifier that stops answering signals nothing, so Pending carries the
check's deadline, as the boot walks already do. The driver remembers it. poll
takes the current time so a verifier with no clock can end a late check.

PlatformDriver::poll is the one call a run loop makes: it polls the
verification and then the boot walks, and returns DriverPoll::Event for the
first event or DriverPoll::Idle with the earliest wake-up of the two. The loop
dispatches an event, calls poll again, and sleeps only on Idle. That order is
what keeps it from sleeping on a check it has not polled yet, since a new
check's deadline is learnt only from its first poll. poll_verify and
poll_boot_walks stay as the building blocks. DriverPoll and BootWalkPoll are
must_use, because dropping one loses an event the driver has already marked as
delivered.

The driver cancels any outstanding check when a new one starts or the image is
re-staged, so a stale answer is never recorded or emitted. It voids the
recorded SVN before the verifier is asked to start, so an earlier reading
cannot reach the irreversible floor commit even if the start fails. The old
synchronous Verifier and verify_firmware are removed.

No production Verifier exists yet; this is the seam it will implement. The
existing tests keep passing through a test-local adapter, and new tests cover
pending polls, timeout, fault, re-stage, restart, SVN voiding (including a
failed start), the machine waiting for a slow verdict, a timeout asking for
recovery, the deadline, and poll.

Fixes OpenPRoT#736

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@rusty1968 rusty1968 changed the title orchestrator-driver : orchestrator-driver: execute(VerifyFirmware) blocks on the verifier, so a slow or stuck verifier hangs the orchestrator Nov 19, 2026
@rusty1968

Copy link
Copy Markdown
Collaborator Author

adityagrewa

This branch has not been deployed

No deployments
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.

orchestrator-driver: execute(VerifyFirmware) blocks on the verifier, so a slow or stuck verifier hangs the orchestrator

1 participant