apollo_propeller: add backpressure flood test#13345
Conversation
guy-starkware
left a comment
There was a problem hiding this comment.
@guy-starkware reviewed 2 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on ShahakShama and sirandreww-starkware).
crates/apollo_propeller/tests/backpressure_test.rs line 9 at r1 (raw file):
//! When full back-pressure is implemented (handler + behaviour), the sender's writes will return //! Pending (yamux window closes because the receiver stops reading) and the assertion should be //! flipped to verify the sender was blocked.
👍 💯
BTW if this didn't have an M-dash I would be more impressed.
Code quote:
//! Tests that demonstrate the lack of inbound back-pressure in the propeller stack.
//!
//! A custom FloodHandler writes raw PropellerUnitBatch frames as fast as yamux allows on a
//! propeller substream. The receiver runs the real propeller Behaviour. The test asserts that the
//! sender was able to write all batches without being slowed — documenting the vulnerability.
//!
//! When full back-pressure is implemented (handler + behaviour), the sender's writes will return
//! Pending (yamux window closes because the receiver stops reading) and the assertion should be
//! flipped to verify the sender was blocked.crates/apollo_propeller/tests/backpressure_test.rs line 132 at r1 (raw file):
unreachable!(); }; let mut framed = framed;
Suggestion:
let FloodOutboundState::Sending(mut framed) =
std::mem::replace(&mut self.outbound, FloodOutboundState::Done)
else {
unreachable!();
};8969808 to
8dda1ff
Compare
0d9a9b4 to
faeab50
Compare
e58cba4 to
82f7eb8
Compare
faeab50 to
638b968
Compare
82f7eb8 to
f340c33
Compare
638b968 to
159516a
Compare
f340c33 to
c6fe4d2
Compare
159516a to
3b4fb1d
Compare
PR SummaryMedium Risk Overview Adds Reviewed by Cursor Bugbot for commit 0aa1086. Bugbot is set up for automated code reviews on this repo. Configure here. |
c6fe4d2 to
b55aebe
Compare
3b4fb1d to
a6b2d65
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a6b2d65. Configure here.
| pub mod metrics; | ||
| pub mod padding; | ||
| mod protocol; | ||
| pub mod protocol; |
There was a problem hiding this comment.
Internal module made unconditionally public for test
Low Severity
The protocol module was the only deliberately private non-test module in this crate. It's now made unconditionally pub solely so the integration test can import PropellerCodec and PropellerProtocol. The crate already defines an unused testing feature in Cargo.toml that could gate this visibility, avoiding leaking wire-level implementation details to all downstream consumers.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a6b2d65. Configure here.
b55aebe to
8b47ad3
Compare
a6b2d65 to
0aa1086
Compare
|
There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale. |



Note
Medium Risk
Mostly test-only, but it expands the crate’s public API by exposing
protocol, which could create unintended external dependencies and future compatibility obligations.Overview
Adds a new integration test (
tests/backpressure_test.rs) that spins up a custom libp2pFloodHandlerto send manyPropellerUnitBatchframes as fast as yamux allows, asserting the sender can complete without being blocked (documenting the current lack of end-to-end back-pressure).Makes
protocola public module (pub mod protocol) so the test can constructPropellerProtocol/PropellerCodecand write raw frames into the receiver’s realBehaviour.Written by Cursor Bugbot for commit 159516a. This will update automatically on new commits. Configure here.