Skip to content

apollo_network_benchmark: add MessageIndexTracker struct#11556

Closed
sirandreww-starkware wants to merge 1 commit into01-08-apollo_network_benchmark_add_reveresedsqmr_receiver_and_registrationfrom
01-08-apollo_network_benchmark_add_messageindextracker_struct
Closed

apollo_network_benchmark: add MessageIndexTracker struct#11556
sirandreww-starkware wants to merge 1 commit into01-08-apollo_network_benchmark_add_reveresedsqmr_receiver_and_registrationfrom
01-08-apollo_network_benchmark_add_messageindextracker_struct

Conversation

@sirandreww-starkware
Copy link
Copy Markdown
Contributor

@sirandreww-starkware sirandreww-starkware commented Jan 8, 2026

Note

Low Risk
Adds an unused helper module with no behavior changes to the running stress test node.

Overview
Introduces a new message_index_detector module in the broadcast network stress test node containing MessageIndexTracker, which tracks min/max seen message indices and computes an estimated count of missing (pending) messages.

main.rs is 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.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown
Contributor Author

sirandreww-starkware commented Jan 8, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 8, 2026

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 Feb 8, 2026
@github-actions github-actions Bot closed this Feb 16, 2026

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web


mod handlers;
mod message;
mod message_index_detector;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web

@sirandreww-starkware sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_reveresedsqmr_receiver_and_registration branch from 0192b6d to a024e8b Compare February 16, 2026 09:10
@sirandreww-starkware sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_messageindextracker_struct branch from cdd6002 to 0794786 Compare February 16, 2026 09:10
@github-actions github-actions Bot removed the stale label Feb 17, 2026
@sirandreww-starkware sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_messageindextracker_struct branch from 0794786 to b05e636 Compare February 19, 2026 07:24
@sirandreww-starkware sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_reveresedsqmr_receiver_and_registration branch from a024e8b to 31afa17 Compare February 19, 2026 07:24
@sirandreww-starkware sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_reveresedsqmr_receiver_and_registration branch from 31afa17 to 5436db8 Compare February 19, 2026 08:04
@sirandreww-starkware sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_messageindextracker_struct branch from b05e636 to 41a1832 Compare February 19, 2026 08:04
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

#![allow(dead_code)]

#[derive(Default, Clone, Copy)]
pub struct MessageIndexTracker {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web

@sirandreww-starkware sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_reveresedsqmr_receiver_and_registration branch from 5436db8 to 3bd9208 Compare March 16, 2026 15:13
@sirandreww-starkware sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_messageindextracker_struct branch from 41a1832 to 3093d1d Compare March 16, 2026 15:13
@sirandreww-starkware sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_messageindextracker_struct branch from 3093d1d to e8ac9a4 Compare March 22, 2026 17:09
@sirandreww-starkware sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_messageindextracker_struct branch from e8ac9a4 to b32f987 Compare March 30, 2026 11:08
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants