refactor(translator): replace monolithic start loop with TranslatorRuntime typestate machine - #644
Open
nulllpc wants to merge 1 commit into
Open
Conversation
bit-aloo
reviewed
Jul 27, 2026
par1ram
suggested changes
Jul 27, 2026
par1ram
left a comment
There was a problem hiding this comment.
I found a blocking integration regression on the latest merge with main. cargo check -p translator_sv2 fails with two E0308 type mismatches in bootstrap_sv1_server and bootstrap_channel_manager, while the same command passes on the current base commit (44af69e55). The existing green checks are from July 23 and do not cover the refreshed merge. Please rebase and update the new Io channel types to the current Sv1Server/ChannelManager interfaces, then rerun CI.
Merged
nulllpc
force-pushed
the
npc/refactor-translator-start
branch
2 times, most recently
from
August 13, 2026 20:28
615e4a6 to
f1478d9
Compare
…ntime typestate machine Overhauls the Translator initialization sequence to align its API and behavior with JdcRuntime and PoolRuntime. - Typestate Machine: Replaces the monolithic startup logic with strict Init -> IoReady -> ChannelManagerReady -> Sv1ServerReady - > UpstreamReady -> Running state transitions. - Separation of Concerns: Constructs the Sv1Server, ChannelManager, and core IO channels during bootstrap, but explicitly activates their background execution loops later in start_services. - Error Propagation: Ensures all startup errors cascade cleanly via Result signatures instead of failing silently or relying on background cancellations, allowing mod.rs to gracefully tear down partially initialized state. - State Optimization: Reorders instantiation so ChannelManager is bootstrapped before the SV1 server, preventing unused state from being unnecessarily carried through early transitions.
nulllpc
force-pushed
the
npc/refactor-translator-start
branch
from
August 13, 2026 20:28
f1478d9 to
9ac56e0
Compare
Contributor
Author
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.
Refactors the monolithic
startfunction inside the Pool (miner-apps/translator) into a structured, typestate-based state machine (TranslatorRuntime) to manage bootstrap, component lifecycles, and graceful shutdown.This PR also properly handles errors instead of calling
unwraporexpectFixes #527