Skip to content

apollo_propeller: add RegisterHandler command and inbound unit SelectAll#13347

Merged
sirandreww-starkware merged 2 commits into
mainfrom
03-19-apollo_propeller_add_registerhandler_command_and_inbound_unit_selectall
Jun 11, 2026
Merged

apollo_propeller: add RegisterHandler command and inbound unit SelectAll#13347
sirandreww-starkware merged 2 commits into
mainfrom
03-19-apollo_propeller_add_registerhandler_command_and_inbound_unit_selectall

Conversation

@sirandreww-starkware

@sirandreww-starkware sirandreww-starkware commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Changes the engine’s async event loop to poll additional inbound streams, which can affect message ingestion ordering/backpressure and shutdown behavior if not wired correctly.

Overview
Adds a new engine command, EngineCommand::RegisterHandler, that lets the behaviour register a per-connection bounded Receiver<PropellerUnit> with the engine.

The engine now maintains a SelectAll of tagged inbound streams and extends its main tokio::select! loop to consume (PeerId, PropellerUnit) items from these receivers, routing them through the existing handle_unit path alongside the existing HandleHandlerOutput mechanism.

Written by Cursor Bugbot for commit 82c4842. This will update automatically on new commits. Configure here.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@guy-starkware guy-starkware left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guy-starkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ShahakShama and sirandreww-starkware).


crates/apollo_propeller/src/engine.rs line 32 at r1 (raw file):

/// A stream of `(PeerId, PropellerUnit)` from a single connection handler's bounded channel.
type InboundUnitStream = Pin<Box<dyn futures::Stream<Item = (PeerId, PropellerUnit)> + Send>>;

I thought each connection is to a specific PeerId. Wouldn't that just make each PeerId that comes out this stream the same peer id? Maybe we don't need to send it?

@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_inbound_channel_capacity_config_field branch from 168163d to c7ce5e5 Compare March 26, 2026 19:15
@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_registerhandler_command_and_inbound_unit_selectall branch from 961b456 to 6a9c03e Compare March 26, 2026 19:15
@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_inbound_channel_capacity_config_field branch from c7ce5e5 to 57e977b Compare March 29, 2026 10:51
@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_registerhandler_command_and_inbound_unit_selectall branch 2 times, most recently from 4750bb8 to d40cb43 Compare March 29, 2026 14:54
@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_inbound_channel_capacity_config_field branch 2 times, most recently from 5f1a101 to d992b45 Compare March 30, 2026 11:08
@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_registerhandler_command_and_inbound_unit_selectall branch from d40cb43 to 82c4842 Compare March 30, 2026 11:08
@sirandreww-starkware sirandreww-starkware changed the base branch from 03-19-apollo_propeller_add_inbound_channel_capacity_config_field to graphite-base/13347 April 30, 2026 06:59
@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_registerhandler_command_and_inbound_unit_selectall branch from 82c4842 to 804ca41 Compare April 30, 2026 09:42
@cursor

cursor Bot commented Apr 30, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches the engine’s core select loop and inbound unit delivery; behavior is localized but duplicate delivery is possible if both RegisterHandler and HandleHandlerOutput feed units for the same peer.

Overview
Adds a second inbound path for propeller units: connection handlers can hand the engine a bounded futures::channel::mpsc::Receiver<PropellerUnit> via new EngineCommand::RegisterHandler, instead of only delivering units through HandleHandlerOutput.

The engine keeps a SelectAll of per-connection streams tagged with (PeerId, PropellerUnit) and polls inbound_unit_receivers.next() in its main tokio::select! loop, feeding the same handle_unit as before. HandleHandlerOutput / send errors are unchanged in this diff.

Reviewed by Cursor Bugbot for commit 1c30253. Bugbot is set up for automated code reviews on this repo. Configure here.

@sirandreww-starkware sirandreww-starkware changed the base branch from graphite-base/13347 to 03-19-apollo_propeller_add_inbound_channel_capacity_config_field April 30, 2026 09:42
@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_inbound_channel_capacity_config_field branch from c708962 to ae3023d Compare April 30, 2026 09:47
@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_registerhandler_command_and_inbound_unit_selectall branch from 804ca41 to 8f202fe Compare April 30, 2026 09:47
@github-actions

Copy link
Copy Markdown

There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale.
This PR will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions Bot added the stale label May 31, 2026
@github-actions github-actions Bot closed this Jun 8, 2026
@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_registerhandler_command_and_inbound_unit_selectall branch from 8f202fe to d94d469 Compare June 9, 2026 13:47
@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_inbound_channel_capacity_config_field branch from ae3023d to 9183488 Compare June 9, 2026 13:47
@github-actions github-actions Bot removed the stale label Jun 10, 2026
@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_inbound_channel_capacity_config_field branch from 9183488 to ef9da12 Compare June 10, 2026 13:51
@sirandreww-starkware sirandreww-starkware force-pushed the 03-19-apollo_propeller_add_registerhandler_command_and_inbound_unit_selectall branch from d94d469 to 1c30253 Compare June 10, 2026 13:51

@ShahakShama ShahakShama left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShahakShama reviewed 1 file and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on sirandreww-starkware).

@ShahakShama ShahakShama left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@ShahakShama made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on sirandreww-starkware).

@sirandreww-starkware sirandreww-starkware changed the base branch from 03-19-apollo_propeller_add_inbound_channel_capacity_config_field to main June 11, 2026 12:40

@sirandreww-starkware sirandreww-starkware left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@sirandreww-starkware reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on sirandreww-starkware).

@sirandreww-starkware sirandreww-starkware left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sirandreww-starkware resolved 1 discussion and dismissed @guy-starkware from a discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on sirandreww-starkware).

@sirandreww-starkware sirandreww-starkware added this pull request to the merge queue Jun 11, 2026
Merged via the queue into main with commit 271c314 Jun 11, 2026
31 checks passed
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.

4 participants