This repository was archived by the owner on Jan 16, 2026. It is now read-only.
feat(node/actor): abstract UnsafeHeadPublisher from EngineActor#3255
Open
Farukest wants to merge 1 commit intoop-rs:mainfrom
Open
feat(node/actor): abstract UnsafeHeadPublisher from EngineActor#3255Farukest wants to merge 1 commit intoop-rs:mainfrom
Farukest wants to merge 1 commit intoop-rs:mainfrom
Conversation
Introduce UnsafeHeadPublisher trait to decouple unsafe head publishing from EngineActor. This allows different publishing strategies to be injected into EngineProcessor. - Add UnsafeHeadPublisher trait with publish_if_modified method - Add WatchUnsafeHeadPublisher implementation using watch::Sender - Make EngineProcessor generic over UnsafeHeadPublisher - Add MockUnsafeHeadPublisher for testing Closes op-rs#3214
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
bce3f31 to
1014ad7
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
This PR abstracts the unsafe head publishing mechanism from
EngineActorby introducing anUnsafeHeadPublishertrait.Changes
UnsafeHeadPublishertrait: Defines apublish_if_modifiedmethod that publishes a new unsafe head only when it differs from the previous valueWatchUnsafeHeadPublisher: Concrete implementation usingtokio::sync::watch::SenderEngineProcessorgeneric overUnsafeHeadPublisher: Allows different publishing strategies to be injectedMockUnsafeHeadPublisher: For unit testing viamockallAs noted in #3214,
EngineActorwas directly creating and managing awatch::Senderfor publishing unsafe head updates, but it doesn't need to control how that publishing occurs. This refactor decouples the publishing mechanism, making the code cleaner and more versatile.Test plan
WatchUnsafeHeadPublisher(publish returns true/false correctly)cargo fmtcheck passescargo clippypasses for modified filesCloses #3214