-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(conductor): make firm, soft readers subtasks (#1926)
## Summary Makes the firm and soft readers subtasks of the main exection loop. ## Background Making the celestia (firm) and astria (soft) readers subtasks of the executor loop is a more faithful representation of their dependencies: 1. the execution loop can run with either or both present. 2. but the readers cannot run without the execution loop present (the tasks do not run at the same level of privilege). 3. to fully initialize they the readers depend on data provided via the execution loop (rollup genesis info and commitment state). This patch then spins up the readers during initialization of the execution event loop, which allows removing a lot of complexity from the conductor codebase: 1. the readers need not explicitly wait for the state to be initialized but receive an already initialized state. 2. there is no need for a bespoke channel to dynamically set permits (this was needed for dynamic backpressure handling by setting the channel capacity after reading the celestia variance from the rollup): a standard mpsc channel can be instantiated and then passed to the (soft/sequencer) reader. executor::Initialized::run delegates to executor::Initialized::run_event_loop to separate the shutdown token from the other arms of the select macro - this way, an else => {} arm can be introduced that shuts down executor as a fallback ## Changes - make the firm (celestia) and soft (sequencer) readers subtasks of the executor task - remove the `JoinMap` from the `conductor::Inner` business logic as this is now tracked by the executor task - initialize the reader tasks only after the initial rollup node state is received - in the executor task, separate the test for shutdown token cancellation from its main event loop so that the `tokio::select!` macro's `else => {}` arm can be used as a fallback. - remove the bespoke `executor::channel` for dynamically setting channel capacity at runtime (no longer necessary; the channel is initialized later after we know its capacity) - simplify the `State` watch channel notifying the readers of the latest rollup state by removing the `StateIsInit` and `StateNotInit` markers (the readers now get a fully initialized watch channel). ## Testing These changes should be transparent and not noticeable. The blackbox tests still pass which implies that the (tested) conductor behavior works. ## Changelogs **NOTE**: Update before merge Ensure all relevant changelog files are updated as necessary. See [keepachangelog](https://keepachangelog.com/en/1.1.0/#how) for change categories. Replace this text with e.g. "Changelogs updated." or "No updates required." to acknowledge changelogs have been considered. ## Related Issues **NOTE**: Link the forma issue? Link any issues that are related, prefer full GitHub links. closes <!-- list any issues closed here -->
- Loading branch information
1 parent
141988f
commit 77d0217
Showing
14 changed files
with
481 additions
and
1,014 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.