Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0: fix: send votes to the immediate next leader (backport of #2607) #2621

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Aug 16, 2024

Problem

Votes are always sent to the "forward leader" which is defined as the leader of the slot which is 2 slots beyond our latest poh clock slot. This means that a vote for the third slot of a given leader's slot span will always be sent to the following leader for inclusion in the first slot of that leader's slot span. This adds an unnecessary slot of latency to votes because the vote could potentially land in current leader's fourth slot.

Summary of Changes

  • Send votes to the leaders of the next two slots to decrease vote latency

Fixes #


This is an automatic backport of pull request #2607 done by [Mergify](https://mergify.com).

* fix: send votes to the immediate next leader

* feedback

(cherry picked from commit f4e2fa9)
@mergify mergify bot requested a review from a team as a code owner August 16, 2024 02:57
@jstarry jstarry requested a review from behzadnouri August 16, 2024 02:59
// 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;
#[cfg(test)]
static_assertions::const_assert_eq!(UPCOMING_LEADER_FANOUT_SLOTS, 2);

Choose a reason for hiding this comment

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

Is there data on why 2 is chosen versus any other number? Also I'm not sure re-using this makes sense. It seems like an offset not a boundary for forwarding.

Copy link

Choose a reason for hiding this comment

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

2 offset slots is the current behavior of forwarding. This patch minimally changes behavior by additionally sending to the leader at offset spot 1.

Of course we should look closer at forwarding in the future but this change is an incremental improvement on what we have already been doing

@jstarry jstarry merged commit 1fefe5f into v2.0 Aug 20, 2024
39 checks passed
@jstarry jstarry deleted the mergify/bp/v2.0/pr-2607 branch August 20, 2024 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants