Repository navigation
v4.4: poh: cache start bank fields so pruned banks are freed (backport of #16302) - #16312
Merged
Merged
Conversation
AshwinSekar
approved these changes
Oct 23, 2026
AshwinSekar
left a comment
There was a problem hiding this comment.
approving as SME, mechanical change to only keep the fields from the bank that Tower needs
this allows the bank to be async dropped during root cleanup, rather than holding onto it till the next leader window and performing a sync drop during leader's build time
|
@Mergifyio rebase |
* poh: hold start bank weakly so pruned banks are freed PohRecorder held a strong reference to its start bank. Under Alpenglow, PoH is reset only when our leader window starts, so between windows it kept our last leader bank alive after BankForks pruned it. The next window-start reset then dropped that bank on the block creation loop thread, under the PoH write lock. Hold the start bank as Weak<Bank>, and cache the slot, bank id and ns_per_slot that PoH reads after the bank can be gone. * poh: cache start bank leader id instead of holding the bank weakly Upgrading the Weak in start_slot_was_mine can briefly make PoH the last holder of the start bank, so the bank could still be dropped under the PoH lock. Cache the leader id like the other start bank fields and drop the Weak. (cherry picked from commit 40dcf1d)
Author
✅ Branch has been successfully rebased |
bw-solana
force-pushed
the
mergify/bp/v4.4/pr-16302
branch
from
October 23, 2026 01:54
5aadce8 to
680ced6
Compare
bw-solana
approved these changes
Oct 23, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v4.4 #16312 +/- ##
=========================================
- Coverage 82.4% 82.4% -0.1%
=========================================
Files 934 934
Lines 372236 372297 +61
=========================================
+ Hits 306946 306991 +45
- Misses 65290 65306 +16 🚀 New features to boost your workflow:
|
|
nvm don't rebase. this is deleted. didn't see any github updates until after the comment posted |
Author
☑️ Nothing to do, the required conditions are not metDetails
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PohRecorderholds a strong reference to its start bank. Under Alpenglow, PoH is reset only when our leader window starts, so between windows PoH keeps our last leader bank alive afterBankForksprunes it:Summary of Changes
PoH no longer holds its start bank. It caches the slot, bank id,
ns_per_slotand leader id it reads, so the bank is freed whenBankForksprunes it, like any other bank.Testing
test_poh_recorder_does_not_keep_start_bank_alivecovers both places that set the start bank: a completed working bank and a reset. It fails on the old code.cargo test -p solana-pohandcargo test -p solana-core --lib block_creation_looppass.This is an automatic backport of pull request #16302 done by [Mergify](https://mergify.com).