apollo_propeller: add PreReconstruction phase and shard collection#12008
Conversation
ad118b6 to
a93fe3d
Compare
a93fe3d to
e1000a3
Compare
3eb4134 to
f8d5a40
Compare
f8d5a40 to
fc5b531
Compare
e1000a3 to
06997e2
Compare
guy-starkware
left a comment
There was a problem hiding this comment.
@guy-starkware reviewed all commit messages and made 3 comments.
Reviewable status: 0 of 1 files reviewed, 5 unresolved discussions (waiting on @noamsp-starkware, @ShahakShama, and @sirandreww-starkware).
crates/apollo_propeller/src/message_processor.rs line 102 at r1 (raw file):
let mut pending_reconstruction: Option<oneshot::Receiver<ReconstructionResult>> = None; // State machine: PreReconstruction -> PostReconstruction
This comment doesn't look like it fits the code under it. Maybe I'm missing something?
crates/apollo_propeller/src/message_processor.rs line 224 at r1 (raw file):
) { // Store the signature from the first unit we receive if signature.is_none() && !unit.signature().is_empty() {
What happens if there are units without signatures? (either one such unit or all of them)
crates/apollo_propeller/src/message_processor.rs line 239 at r1 (raw file):
tracing::trace!("[MSG_PROC] Starting reconstruction with {} shards", received_shards.len()); let shards = received_shards.clone();
why not send the shards in by value? Why clone?
guy-starkware
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 1 files reviewed, 5 unresolved discussions (waiting on noamsp-starkware, ShahakShama, and sirandreww-starkware).
guy-starkware
left a comment
There was a problem hiding this comment.
@guy-starkware reviewed 1 file.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on noamsp-starkware, ShahakShama, and sirandreww-starkware).
fc5b531 to
21443c9
Compare
06997e2 to
12476cd
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 5 comments and resolved 2 discussions.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on guy-starkware, noamsp-starkware, and ShahakShama).
crates/apollo_propeller/src/message_processor.rs line 102 at r1 (raw file):
Previously, guy-starkware wrote…
This comment doesn't look like it fits the code under it. Maybe I'm missing something?
You're not, mistake in split, will be solved in the next PR
crates/apollo_propeller/src/message_processor.rs line 224 at r1 (raw file):
Previously, guy-starkware wrote…
What happens if there are units without signatures? (either one such unit or all of them)
Added a comment to explain this
crates/apollo_propeller/src/message_processor.rs line 239 at r1 (raw file):
Previously, guy-starkware wrote…
why not send the shards in by value? Why clone?
you're right, using std::mem::take here
guy-starkware
left a comment
There was a problem hiding this comment.
@guy-starkware reviewed 1 file and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on noamsp-starkware, ShahakShama, and sirandreww-starkware).
crates/apollo_propeller/src/message_processor.rs line 224 at r1 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
Added a comment to explain this
Is there a check somewhere that all signatures are the same for all units?
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on noamsp-starkware and sirandreww-starkware).
crates/apollo_propeller/src/message_processor.rs line 136 at r2 (raw file):
// the validator permanently lost. Ok(result) = async { pending_validation.as_mut().unwrap().await
instead of unwrap and if is_some, do here unwrap_or(pending())

Note
Medium Risk
Introduces new state and concurrency around shard collection and reconstruction triggering, which could cause subtle lifecycle/ordering bugs even though the reconstruction result is not yet consumed.
Overview
Adds an explicit
ReconstructionPhase::PreReconstructionstate toMessageProcessorto collect validated shard units, track whether the node’s own shard index has been seen, and capture the message signature.Once
tree_manager.should_build()is satisfied, the processor now kicks off a background reconstruction viaspawn_reconstruction_task, storing apending_reconstructiononeshot receiver (result handling is not yet implemented).Written by Cursor Bugbot for commit 12476cd. This will update automatically on new commits. Configure here.