Skip to content

Commit

Permalink
Enable broadcast duplicates test (#4007)
Browse files Browse the repository at this point in the history
  • Loading branch information
carllin authored Dec 13, 2024
1 parent d11072e commit 269cad0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions local-cluster/tests/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3860,7 +3860,6 @@ fn test_kill_partition_switch_threshold_progress() {

#[test]
#[serial]
#[ignore]
#[allow(unused_attributes)]
fn test_duplicate_shreds_broadcast_leader() {
run_duplicate_shreds_broadcast_leader(true);
Expand Down Expand Up @@ -3892,7 +3891,13 @@ fn run_duplicate_shreds_broadcast_leader(vote_on_duplicate: bool) {

// Critical that bad_leader_stake + good_node_stake < DUPLICATE_THRESHOLD and that
// bad_leader_stake + good_node_stake + our_node_stake > DUPLICATE_THRESHOLD so that
// our vote is the determining factor
// our vote is the determining factor.
//
// Also critical that bad_leader_stake > 1 - DUPLICATE_THRESHOLD, so that the leader
// doesn't try and dump his own block, which will happen if:
// 1. A version is duplicate confirmed
// 2. The version they played/stored into blockstore isn't the one that is duplicated
// confirmed.
let bad_leader_stake = 10_000_000 * DEFAULT_NODE_STAKE;
// Ensure that the good_node_stake is always on the critical path, and the partition node
// should never be on the critical path. This way, none of the bad shreds sent to the partition
Expand Down Expand Up @@ -3920,6 +3925,7 @@ fn run_duplicate_shreds_broadcast_leader(vote_on_duplicate: bool) {
(bad_leader_stake + good_node_stake + our_node_stake) as f64 / total_stake as f64
> DUPLICATE_THRESHOLD
);
assert!((bad_leader_stake as f64 / total_stake as f64) >= 1.0 - DUPLICATE_THRESHOLD);

// Important that the partition node stake is the smallest so that it gets selected
// for the partition.
Expand Down

0 comments on commit 269cad0

Please sign in to comment.