Skip to content

Commit

Permalink
target current leader with votes (#5063)
Browse files Browse the repository at this point in the history
  • Loading branch information
bw-solana authored Feb 26, 2025
1 parent 8c43470 commit 2124876
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/next_leader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub(crate) fn upcoming_leader_tpu_vote_sockets(
) -> Vec<SocketAddr> {
let upcoming_leaders = {
let poh_recorder = poh_recorder.read().unwrap();
(1..=fanout_slots)
(0..fanout_slots)
.filter_map(|n_slots| poh_recorder.leader_after_n_slots(n_slots))
.collect_vec()
};
Expand Down
9 changes: 6 additions & 3 deletions core/src/voting_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,13 @@ impl VotingService {
trace!("{measure}");
}

// Attempt to send our vote transaction to the leaders for the next few slots
const UPCOMING_LEADER_FANOUT_SLOTS: u64 = FORWARD_TRANSACTIONS_TO_LEADER_AT_SLOT_OFFSET;
// Attempt to send our vote transaction to the leaders for the next few
// slots. From the current slot to the forwarding slot offset
// (inclusive).
const UPCOMING_LEADER_FANOUT_SLOTS: u64 =
FORWARD_TRANSACTIONS_TO_LEADER_AT_SLOT_OFFSET.saturating_add(1);
#[cfg(test)]
static_assertions::const_assert_eq!(UPCOMING_LEADER_FANOUT_SLOTS, 2);
static_assertions::const_assert_eq!(UPCOMING_LEADER_FANOUT_SLOTS, 3);
let upcoming_leader_sockets = upcoming_leader_tpu_vote_sockets(
cluster_info,
poh_recorder,
Expand Down

0 comments on commit 2124876

Please sign in to comment.