Skip to content

solana-test-validator: activate alpenglow by default - #15665

Merged
AshwinSekar merged 1 commit into
anza-xyz:masterfrom
AshwinSekar:feature-flip-test-validator
Oct 7, 2026
Merged

AshwinSekar merged 1 commit into
anza-xyz:masterfrom
AshwinSekar:feature-flip-test-validator

Conversation

@AshwinSekar

@AshwinSekar AshwinSekar commented Sep 30, 2026 •

Copy link
Copy Markdown

Problem

Currently users have to pass --alpenglow to solana-test-validator in order to activate it at genesis.
However AG is already active on devnet

Summary of Changes

Make it the default for solana-test-validator and remove --alpenglow

Testing

CI & solana-test-validator

@mergify

mergify Bot commented Sep 30, 2026

Copy link
Copy Markdown

If this PR represents a change to the public RPC API:

  1. Make sure it includes a complementary update to rpc-client/ (example)
  2. Open a follow-up PR to update the JavaScript client @solana/kit (example)

Thank you for keeping the RPC clients in sync with the server API @AshwinSekar.

@AshwinSekar
AshwinSekar force-pushed the feature-flip-test-validator branch 2 times, most recently from 67352fe to 7d6ae48 Compare October 6, 2026 15:13
Comment thread validator/src/cli.rs Resolved
@AshwinSekar
AshwinSekar marked this pull request as ready for review October 6, 2026 15:28
@AshwinSekar
AshwinSekar requested a review from joncinque October 6, 2026 15:28

@joncinque joncinque left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code changes look good overall, let's just leave the flag in though

Comment thread CHANGELOG.md Resolved
@AshwinSekar
AshwinSekar force-pushed the feature-flip-test-validator branch from 7d6ae48 to 24b1763 Compare October 6, 2026 18:21
@AshwinSekar
AshwinSekar marked this pull request as draft October 6, 2026 18:24
joncinque
joncinque previously approved these changes Oct 6, 2026

@joncinque joncinque left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks great to me!

Actually, quick question -- what happens if someone has a test-validator ledger with tower, stops it, and then restarts it with this change? Will everything keep going as normal, or will it fail in some way?

If there's a failure, we might need to tell people to regenesis their test validator or keep using an old version.

let payer_address = payer_signer.pubkey();
let (create_lookup_table_ix, lookup_table_address) =
create_lookup_table(authority_address, payer_address, clock.slot);
create_lookup_table(authority_address, payer_address, recent_slot);

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.

basically the issue here is that in low node count clusters clock.slot (the latest finalized slot) could be equal to the latest processed slot e.g. the tip of the chain.

create_lookup_table requires that the slot is at least 1 slot old so we use this hack

@AshwinSekar

Copy link
Copy Markdown
Author

Actually, quick question -- what happens if someone has a test-validator ledger with tower, stops it, and then restarts it with this change? Will everything keep going as normal, or will it fail in some way?

No issues, just tested it out as well. Basically the cluster has already been initialized with alpenglow disabled so as long as they don't pass --reset or manually enable the feature it will continue on with TowerBFT.

This could however be an issue if they have this ledger for multiple releases as we'll eventually remove the TowerBFT code pathways

@AshwinSekar
AshwinSekar marked this pull request as ready for review October 6, 2026 18:54

@joncinque joncinque left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me, looks like still some CI to fight through

Comment on lines +575 to +585
// The clock slot is finalized, but not added to SlotHashes until a child bank is created.
// As finalization under alpenglow is lower than slot times, this means we must use an older slot.
let recent_slot = slot_hashes
.iter()
.find(|slot_hash| slot_hash.slot <= clock.slot)
.ok_or_else(|| {
CliError::RpcRequestError(
"No recent finalized slot found in slot hashes sysvar".to_string(),
)
})?
.slot;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Confirming this is correct since slot hashes are stored in reverse order

@AshwinSekar
AshwinSekar marked this pull request as draft October 6, 2026 19:47
@AshwinSekar
AshwinSekar force-pushed the feature-flip-test-validator branch from 5db316b to b6c0546 Compare October 6, 2026 20:06
@AshwinSekar
AshwinSekar force-pushed the feature-flip-test-validator branch from b6c0546 to 33945ea Compare October 6, 2026 21:25
@codecov-commenter

codecov-commenter commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 4.00000% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.4%. Comparing base (8063bd2) to head (33945ea).

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #15665    +/-   ##
========================================
  Coverage    82.3%    82.4%            
========================================
  Files         938      938            
  Lines      374305   374104   -201     
========================================
+ Hits       308271   308470   +199     
+ Misses      66034    65634   -400     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AshwinSekar
AshwinSekar marked this pull request as ready for review October 6, 2026 22:49
@AshwinSekar

AshwinSekar commented Oct 6, 2026 •

Copy link
Copy Markdown
Author

Should be good now, couple of tests were timing out (now that AG actually enforces a block timeout), so I bumped the opt level / serialized things

@joncinque joncinque left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OK looks good!

On my dev box, the serial tests for solana-test-validator go from to 7s to 75s.

It's tolerable, since they'll likely run in CI for the most part. We could eventually batch some tests if the timing becomes a problem.

For my own information, what does Alpenglow do differently that makes resource contention worse?

@AshwinSekar

Copy link
Copy Markdown
Author

For my own information, what does Alpenglow do differently that makes resource contention worse?

Essentially Alpenglow enforces a block timeout - 200ms + some buffer for leader handoff.
This amounts to roughly 800ms for the first block in the window and 200ms for the remaining 3 blocks.

This is enforced even for single node clusters.

For these tests when running in parallel I noticed heavy contention which caused flakiness - sometimes the leader thread would be paused for so long that it would timeout and cause the block to be skipped.

@AshwinSekar
AshwinSekar added this pull request to the merge queue Oct 7, 2026
Merged via the queue into anza-xyz:master with commit fd2f68b Oct 7, 2026
57 checks passed
@AshwinSekar
AshwinSekar deleted the feature-flip-test-validator branch October 7, 2026 13:37
@joncinque

Copy link
Copy Markdown

For these tests when running in parallel I noticed heavy contention which caused flakiness - sometimes the leader thread would be paused for so long that it would timeout and cause the block to be skipped.

Ah gotcha, thanks for the explanation!

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