Skip to content

fix incorrect inefficient vote worker#9786

Merged
OliverNChalk merged 1 commit intoanza-xyz:masterfrom
cavemanloverboy:fix-incorrect-inefficient-vote-worker
Jan 7, 2026
Merged

fix incorrect inefficient vote worker#9786
OliverNChalk merged 1 commit intoanza-xyz:masterfrom
cavemanloverboy:fix-incorrect-inefficient-vote-worker

Conversation

@cavemanloverboy
Copy link
Copy Markdown

image

Problem

yes.

reached_end_of_slot is set to true after a single vote batch, which reinserts all unprocessed vote packets back into the vote storage.

(git gud @apfitzge)

Summary of Changes

do not mark reached_end_of_slot prematurely...

@mergify mergify Bot requested a review from a team January 5, 2026 09:52
@apfitzge
Copy link
Copy Markdown

apfitzge commented Jan 5, 2026

Put an actual description please

@cavemanloverboy
Copy link
Copy Markdown
Author

cmon u gotta live a little we're building the future of finance

@cavemanloverboy cavemanloverboy force-pushed the fix-incorrect-inefficient-vote-worker branch 2 times, most recently from f1b12fe to 8a0da75 Compare January 5, 2026 12:39
@OliverNChalk
Copy link
Copy Markdown

OliverNChalk commented Jan 5, 2026

Given the fix is a single commit, the PR that lands on master should be clean and meme free. So I think we can just send this?

OliverNChalk
OliverNChalk previously approved these changes Jan 5, 2026
@sakridge
Copy link
Copy Markdown

sakridge commented Jan 5, 2026

Add a test?

@cavemanloverboy
Copy link
Copy Markdown
Author

Add a test?

what's that?

commit_transactions_result,
should_bank_still_be_processing_txs,
) {
(Err(PohRecorderError::MaxHeightReached), _) | (_, false) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I feel it is easier to reason if change to (_, true). Something like this:

        let reached_max_poh_height = match (
            commit_transactions_result,
            bank.is_complete(),
        ) {
            (Err(PohRecorderError::MaxHeightReached), _) | (_, true) => {
                 true
             }
            _ => false,

Also, downstream seems to use function has_reached_end_of_slot() that repeats same logic again, checking bank.is_complete() at ln 419 seems be redundant.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

how about we merge this fix and get the insane perf win and then worry about refactoring out redundant stuff later

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sounds reasonable. What do you think about instead of adding ! in front of bank.is_complete(), let's flip false at ln 424 to true to avoid negative of negative? (first part of original comment)

@OliverNChalk
Copy link
Copy Markdown

Explored testing this, was somewhat feasible if we isolate the process transactions function: OliverNChalk@bd9a71b

@tao-stones any thoughts on testing?
@cavemanloverboy you okay if I push these tests to your branch?

@OliverNChalk OliverNChalk self-requested a review January 5, 2026 18:16
@tao-stones
Copy link
Copy Markdown

Explored testing this, was somewhat feasible if we isolate the process transactions function: OliverNChalk@bd9a71b

@tao-stones any thoughts on testing? @cavemanloverboy you okay if I push these tests to your branch?

I was originally thinking to extract logic of determine reached_max_poh_height into its own function, then test it. But your test looks great.

@cavemanloverboy
Copy link
Copy Markdown
Author

sure push test

@OliverNChalk
Copy link
Copy Markdown

cavemanloverboy/solana#1

@OliverNChalk OliverNChalk self-requested a review January 6, 2026 13:09
Copy link
Copy Markdown

@OliverNChalk OliverNChalk left a comment

Choose a reason for hiding this comment

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

Looks good but can we rebase to squash the merge, else the merge queue will generate a default commit from the PR name which wont be as clear as the commit message you previously wrote

@cavemanloverboy cavemanloverboy force-pushed the fix-incorrect-inefficient-vote-worker branch from 68eb87b to 5d1fbf4 Compare January 7, 2026 06:33
@cavemanloverboy
Copy link
Copy Markdown
Author

alright gogogogo

@cavemanloverboy
Copy link
Copy Markdown
Author

cavemanloverboy commented Jan 7, 2026

pls don't make me do anything else, im just here to fix bugs not fix your test suite coverage or satisfy your nits tyvm

do any other thing in a cleanup/followup

@OliverNChalk OliverNChalk enabled auto-merge January 7, 2026 10:05
@tao-stones tao-stones added the CI Pull Request is ready to enter CI label Jan 7, 2026
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Jan 7, 2026
@OliverNChalk OliverNChalk added this pull request to the merge queue Jan 7, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.7%. Comparing base (d34495d) to head (5d1fbf4).
⚠️ Report is 10 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9786   +/-   ##
=======================================
  Coverage    82.7%    82.7%           
=======================================
  Files         901      901           
  Lines      324845   324866   +21     
=======================================
+ Hits       268722   268777   +55     
+ Misses      56123    56089   -34     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Merged via the queue into anza-xyz:master with commit c92a753 Jan 7, 2026
47 checks passed
@cavemanloverboy cavemanloverboy deleted the fix-incorrect-inefficient-vote-worker branch January 7, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants