Repository navigation
Conversation
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>
Collaborator
Author
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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