apollo_network_benchmark: add MessageIndexTracker struct#11556
Conversation
|
There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale. |
|
|
||
| let min_message_index = self.min_message_index.unwrap(); | ||
| let max_message_index = self.max_message_index.unwrap(); | ||
| max_message_index - min_message_index + 1 - self.seen_messages_count |
There was a problem hiding this comment.
Duplicate indices break pending count
Low Severity
pending_messages_count() assumes every seen_message() call is a unique index. Because seen_messages_count increments on duplicates, max - min + 1 - seen_messages_count can go negative and underflow as u64, producing an incorrect huge pending value (or debug overflow panic) in message_index_detector.rs.
Additional Locations (1)
|
|
||
| mod handlers; | ||
| mod message; | ||
| mod message_index_detector; |
There was a problem hiding this comment.
New tracker code is currently unused
Low Severity
message_index_detector is added to the binary, but MessageIndexTracker, seen_message(), and pending_messages_count() are not referenced anywhere else. The file also suppresses this with #![allow(dead_code)], which leaves dead code in production and increases maintenance risk.
Additional Locations (1)
0192b6d to
a024e8b
Compare
cdd6002 to
0794786
Compare
0794786 to
b05e636
Compare
a024e8b to
31afa17
Compare
31afa17 to
5436db8
Compare
b05e636 to
41a1832
Compare
| #![allow(dead_code)] | ||
|
|
||
| #[derive(Default, Clone, Copy)] | ||
| pub struct MessageIndexTracker { |
There was a problem hiding this comment.
Module name mismatches struct name semantically
Low Severity
The module is named message_index_detector but the struct it contains is MessageIndexTracker. "Detector" and "tracker" have different semantics — a detector identifies something, a tracker follows state over time. The struct clearly tracks state, so the module name is misleading. The module name could be message_index_tracker to match.
Additional Locations (1)
5436db8 to
3bd9208
Compare
41a1832 to
3093d1d
Compare
3093d1d to
e8ac9a4
Compare
e8ac9a4 to
b32f987
Compare



Note
Low Risk
Adds an unused helper module with no behavior changes to the running stress test node.
Overview
Introduces a new
message_index_detectormodule in the broadcast network stress test node containingMessageIndexTracker, which tracks min/max seen message indices and computes an estimated count of missing (pending) messages.main.rsis updated to include the new module, but the tracker is not yet wired into message handling (dead-code allowed).Written by Cursor Bugbot for commit b32f987. This will update automatically on new commits. Configure here.