Skip to content

consensus: axe the intermediate accumulation pathway for OC#10594

Merged
AshwinSekar merged 2 commits intoanza-xyz:masterfrom
AshwinSekar:axe-intermediate-accum
Feb 19, 2026
Merged

consensus: axe the intermediate accumulation pathway for OC#10594
AshwinSekar merged 2 commits intoanza-xyz:masterfrom
AshwinSekar:axe-intermediate-accum

Conversation

@AshwinSekar
Copy link

@AshwinSekar AshwinSekar commented Feb 14, 2026

Problem

This optimization doesn't actually get us anything and is complex to reason about
Screenshot 2026-02-13 at 11 01 32 PM

Summary of Changes

Remove it and bank hash cache to ibrl

@AshwinSekar AshwinSekar force-pushed the axe-intermediate-accum branch 2 times, most recently from 4c6024e to 97c478b Compare February 16, 2026 01:59
@codecov-commenter
Copy link

codecov-commenter commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.0%. Comparing base (2ba28f5) to head (f0cda73).

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #10594    +/-   ##
========================================
  Coverage    83.0%    83.0%            
========================================
  Files         844      843     -1     
  Lines      316049   315942   -107     
========================================
- Hits       262470   262399    -71     
+ Misses      53579    53543    -36     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

// Track the last vote slot for optimistic confirmation
if last_vote_slot > root {
let epoch = root_bank.epoch_schedule().get_epoch(last_vote_slot);
if let Some(epoch_stakes) = root_bank.epoch_stakes(epoch) {

Choose a reason for hiding this comment

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

I think we could save a layer of nesting here

let Some(epoch_stakes) = root_bank.epoch_stakes(epoch) else {
    break;
}

Copy link
Author

Choose a reason for hiding this comment

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

we're not actually looping here, instead of looping through all the slots we now split into 2:

  • Lookup the last slot and track for OC
  • loop through the remaining slots to update tracking related to the propagated check

the previous versions of the code would still loop through remaining slots if the last slot was in an epoch without stake info.

Technically this means it's a malicious vote, e.g. the final slot is > 2 epochs than the root bank, so I could be convinced to return early here.

Choose a reason for hiding this comment

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

brain short circuited.

I like the idea of sub-functioning this out so we can just do some early returns. Something like:

fn track_last_vote_slot(...) {
    if last_vote_slot <= root {
        return;
    }

    let Some(epoch_stakes) = root_bank.epoch_stakes(epoch) else {
        return;
    }

    ...
}

but given we likely want to backport this improvement, punt it to a follow-up

@AshwinSekar AshwinSekar force-pushed the axe-intermediate-accum branch from c1ceea9 to f0cda73 Compare February 18, 2026 17:47
Copy link

@bw-solana bw-solana left a comment

Choose a reason for hiding this comment

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

latest LGTM.

waiting to click Approve to give @t-nelson a chance to rip things apart for backport possibility

@AshwinSekar AshwinSekar added the v3.1 Backport to v3.1 branch label Feb 18, 2026
@mergify
Copy link

mergify bot commented Feb 18, 2026

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

Copy link

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

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

wfm

Comment on lines -548 to +500
slot,
hash,
last_vote_slot,
last_vote_hash,

Choose a reason for hiding this comment

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

try to minimize renames like these for backport candidates in the future. they bloat the diff unnecessarily

Copy link
Author

Choose a reason for hiding this comment

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

noted

break;
}

is_new_vote = is_new;

Choose a reason for hiding this comment

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

nit: now that we aren't looping, this could be returned directly from the block instead of setting a mutable temporary

Copy link
Author

Choose a reason for hiding this comment

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

agreed will clean this up on master in a follow up

@AshwinSekar AshwinSekar added this pull request to the merge queue Feb 19, 2026
Merged via the queue into anza-xyz:master with commit 207fb1d Feb 19, 2026
51 checks passed
@AshwinSekar AshwinSekar deleted the axe-intermediate-accum branch February 19, 2026 15:59
mergify bot pushed a commit that referenced this pull request Feb 19, 2026
* consensus: axe the intermediate accumulation pathway for OC

* pr feedback: fold continue into filter

(cherry picked from commit 207fb1d)

# Conflicts:
#	core/src/cluster_info_vote_listener.rs
#	runtime/src/bank_forks.rs
#	runtime/src/bank_hash_cache.rs
AshwinSekar added a commit that referenced this pull request Feb 19, 2026
…ckport of #10594) (#10697)

* consensus: axe the intermediate accumulation pathway for OC (#10594)

* consensus: axe the intermediate accumulation pathway for OC

* pr feedback: fold continue into filter

(cherry picked from commit 207fb1d)

# Conflicts:
#	core/src/cluster_info_vote_listener.rs
#	runtime/src/bank_forks.rs
#	runtime/src/bank_hash_cache.rs

* cherry-pick: fix conflicts

---------

Co-authored-by: Ashwin Sekar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3.1 Backport to v3.1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants