Skip to content

Conversation

@asmaastarkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

asmaastarkware commented Dec 17, 2025

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

@asmaastarkware asmaastarkware marked this pull request as ready for review December 17, 2025 09:54
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_honest_nodes_consensus_sim branch from fc26f31 to ceb5ac4 Compare December 18, 2025 07:31
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from f8e0428 to 4a7dfad Compare December 18, 2025 07:31
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_honest_nodes_consensus_sim branch from ceb5ac4 to 0e51b51 Compare December 21, 2025 06:25
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from 4a7dfad to a8f5824 Compare December 21, 2025 06:25
Copy link
Collaborator

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

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

@matanl-starkware reviewed 1 file and all commit messages, and made 4 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @asmaastarkware and @dafnamatsry).


crates/apollo_consensus/src/simulation_test.rs line 100 at r2 (raw file):

    node_votes: HashMap<Round, Vote>,
    /// The drop rate for the network.
    drop_rate: f64,

Consider keeping as 'keep_ratio', to avoid 1-P everywhere

Code quote:

drop_rate

crates/apollo_consensus/src/simulation_test.rs line 153 at r2 (raw file):

        let leader_id = Self::get_leader(round);

        if leader_id != *VALIDATOR_ID && self.rng.gen_bool(1.0 - self.drop_rate) {

Move this part into self.schedule

Code quote:

&& self.rng.gen_bool(1.0 - self.drop_rate)

crates/apollo_consensus/src/simulation_test.rs line 167 at r2 (raw file):

        for i in 1..self.validators.len() {
            let voter = self.validators[i];
            let commitment = Some(PROPOSAL_COMMITMENT);

We should have different commitments per round

Code quote:

PROPOSAL_COMMITMENT

crates/apollo_consensus/src/simulation_test.rs line 201 at r2 (raw file):

    fn check_and_generate_next_round(&mut self, request_round: Round) {
        if request_round > self.current_max_round {

Suggestion:

       if self.current_max_round < request_round

@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from a8f5824 to ce997f5 Compare December 21, 2025 11:53
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_honest_nodes_consensus_sim branch from 0e51b51 to 7e7b39b Compare December 21, 2025 11:53
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch 4 times, most recently from e294bb6 to fcb800e Compare December 21, 2025 12:23
Copy link
Contributor Author

@asmaastarkware asmaastarkware left a comment

Choose a reason for hiding this comment

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

@asmaastarkware made 3 comments.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @dafnamatsry and @matanl-starkware).


crates/apollo_consensus/src/simulation_test.rs line 153 at r2 (raw file):

Previously, matanl-starkware (Matan Lior) wrote…

Move this part into self.schedule

Done.


crates/apollo_consensus/src/simulation_test.rs line 167 at r2 (raw file):

Previously, matanl-starkware (Matan Lior) wrote…

We should have different commitments per round

Done.


crates/apollo_consensus/src/simulation_test.rs line 201 at r2 (raw file):

    fn check_and_generate_next_round(&mut self, request_round: Round) {
        if request_round > self.current_max_round {

This just reads more naturally/readable to me..

Copy link
Collaborator

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

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

@matanl-starkware reviewed 1 file and all commit messages, made 2 comments, and resolved 2 discussions.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @asmaastarkware and @dafnamatsry).


crates/apollo_consensus/src/simulation_test.rs line 201 at r2 (raw file):

Previously, asmaastarkware (asmaa-starkware) wrote…

This just reads more naturally/readable to me..

https://github.com/rust-lang/rust-analyzer/blob/master/docs/book/src/contributing/style.md#comparisons


crates/apollo_consensus/src/simulation_test.rs line 170 at r3 (raw file):

                }
            }
        }

Split logic and operation

Code quote (i):

        match &event {
            InputEvent::Internal(_) => {
                self.pending_events.push(TimedEvent { tick: self.current_tick + delay, event });
            }
            _ => {
                if self.rng.gen_bool(self.keep_ratio) {
                    self.pending_events.push(TimedEvent { tick: self.current_tick + delay, event });
                }
            }
        }

Code snippet (ii):

let should_enqueue = matches!(event, InputEvent::Internal(_))
    || self.rng.gen_bool(self.keep_ratio);

if should_enqueue {
    self.pending_events.push(TimedEvent { tick: self.current_tick + delay, event });
}

@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from fcb800e to 70fb297 Compare December 22, 2025 14:11
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_honest_nodes_consensus_sim branch from 7e7b39b to 2b93b33 Compare December 22, 2025 14:30
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from 70fb297 to 178a8c3 Compare December 22, 2025 14:30
Copy link
Collaborator

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

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

@matanl-starkware reviewed 1 file and all commit messages, and resolved 2 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dafnamatsry).

@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_honest_nodes_consensus_sim branch 2 times, most recently from 9278d7c to 32a5ce3 Compare December 28, 2025 10:42
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from a4df0f9 to 1500d7a Compare December 28, 2025 10:42
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_honest_nodes_consensus_sim branch from 32a5ce3 to a95546c Compare December 28, 2025 12:39
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from 1500d7a to 54525f0 Compare December 28, 2025 12:39
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_honest_nodes_consensus_sim branch from a95546c to 877d8d7 Compare January 6, 2026 07:20
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from 54525f0 to 7834218 Compare January 6, 2026 07:20
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_honest_nodes_consensus_sim branch from 877d8d7 to 4ee399d Compare January 6, 2026 12:53
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from 7834218 to db5fd8e Compare January 6, 2026 12:53
Copy link
Collaborator

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

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

@matanl-starkware made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @asmaastarkware and @dafnamatsry).


crates/apollo_consensus/src/simulation_test.rs line 179 at r9 (raw file):

    /// For rounds where NODE_0 is the proposer, peer votes are scheduled after
    /// the build finish event (which will be determined dynamically during simulation).
    fn pre_generate_all_rounds(&mut self) {

Most of the changes related to PR 10868.
Can you check why it happened?

Code quote:

 fn pre_generate_all_rounds

Copy link
Collaborator

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

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

@matanl-starkware reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dafnamatsry).

@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from db5fd8e to 4af840c Compare January 7, 2026 11:42
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_honest_nodes_consensus_sim branch from 4ee399d to 8cfadb5 Compare January 7, 2026 11:42
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from 4af840c to c367da5 Compare January 7, 2026 12:12
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_honest_nodes_consensus_sim branch 2 times, most recently from 996a755 to f4e8619 Compare January 8, 2026 11:56
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from c367da5 to a9f614d Compare January 8, 2026 11:56
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_honest_nodes_consensus_sim branch from f4e8619 to dbcb7f4 Compare January 11, 2026 11:09
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from a9f614d to 4e8a975 Compare January 11, 2026 11:09
@asmaastarkware asmaastarkware changed the base branch from asmaa/sim_test/add_honest_nodes_consensus_sim to graphite-base/10869 January 12, 2026 12:44
@asmaastarkware asmaastarkware force-pushed the asmaa/sim_test/add_drop_rate branch from 4e8a975 to c5575e4 Compare January 12, 2026 12:44
@asmaastarkware asmaastarkware changed the base branch from graphite-base/10869 to main-v0.14.1-committer January 12, 2026 12:44
Copy link
Collaborator

@dafnamatsry dafnamatsry left a comment

Choose a reason for hiding this comment

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

:lgtm:

@dafnamatsry reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @asmaastarkware).

@asmaastarkware asmaastarkware added this pull request to the merge queue Jan 14, 2026
Merged via the queue into main-v0.14.1-committer with commit fc7d85b Jan 14, 2026
15 of 28 checks passed
@asmaastarkware asmaastarkware deleted the asmaa/sim_test/add_drop_rate branch January 14, 2026 12:08
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 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.

5 participants