Skip to content

streamer: refactor config structs#9093

Merged
alexpyattaev merged 1 commit intoanza-xyz:masterfrom
alexpyattaev:streamer_configs
Nov 18, 2025
Merged

streamer: refactor config structs#9093
alexpyattaev merged 1 commit intoanza-xyz:masterfrom
alexpyattaev:streamer_configs

Conversation

@alexpyattaev
Copy link
Copy Markdown

@alexpyattaev alexpyattaev commented Nov 15, 2025

Problem

  • Streamer config structs are a bit messy.
  • Parameters that are only useful for SWQOS ended up in the struct that was used for both QOS modes
  • Config parameters were splatted in the QoS modules complicating further modifications
  • Current organization blocks SWQOS: a better implementation #8880

Summary of Changes

  • Organize the config structs for TPU QoS
  • This PR does not introduce any functional changes

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 15, 2025

Codecov Report

❌ Patch coverage is 77.66990% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.6%. Comparing base (89ae196) to head (15f1a0c).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9093   +/-   ##
=======================================
  Coverage    82.6%    82.6%           
=======================================
  Files         889      889           
  Lines      320852   320857    +5     
=======================================
+ Hits       265215   265241   +26     
+ Misses      55637    55616   -21     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexpyattaev alexpyattaev marked this pull request as ready for review November 15, 2025 23:01
@alexpyattaev alexpyattaev mentioned this pull request Nov 15, 2025
4 tasks
Comment thread streamer/src/quic.rs

pub(crate) fn max_concurrent_connections(&self) -> usize {
let conns = self.max_staked_connections + self.max_unstaked_connections;
conns + conns / 4
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We intentionally added this cushion of 1/4 in the max connections. Is this logic kept?

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.

Thank you for reminder, will bring it back.

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.

Brought it back in cc5f599

@alexpyattaev alexpyattaev changed the title refactor streamer configs streamer: refactor config structs Nov 16, 2025
Comment thread streamer/src/quic.rs Outdated
max_connections_per_ipaddr_per_min: DEFAULT_MAX_CONNECTIONS_PER_IPADDR_PER_MINUTE,
wait_for_chunk_timeout: DEFAULT_WAIT_FOR_CHUNK_TIMEOUT,
num_threads: NonZeroUsize::new(num_cpus::get().min(1)).expect("1 is non-zero"),
max_concurrent_connections: (DEFAULT_MAX_STAKED_CONNECTIONS
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

maybe this logic preceding but requires 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.

This did not exactly bring back the max_concurrent_connections() encapsulation -- as it is only handles when it is default, When it is configured by the user, it does not give the cushion.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The cushion is needed so that allows the application layer to do more filtering based on that layer logic -- otherwise Quinn would just reject the connection.

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.

The rejection is all at application layer already. But you are right we need to compute it also in validator.rs in case someone increases e.g. max staked connections to 16k

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.

Made a clean solution by adding a function to the qos trait. This way it is not ugly and is computed same way as before.

@@ -48,10 +48,6 @@ where

let swqos = Arc::new(SwQos::new(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe in separate PR, but this Arc is not needed here, SwQos clearly must be Clone cause all it's attributes are Clone.

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.

We eventually need to move it into an Arc but yeah it can be done way later.

KirillLykov
KirillLykov previously approved these changes Nov 17, 2025
Copy link
Copy Markdown

@KirillLykov KirillLykov left a comment

Choose a reason for hiding this comment

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

My understanding is that this PR moves 4 attributes (max_staked_connections etc) from SwQos to SwQosConfig which sort of makes sense.

@alexpyattaev alexpyattaev added this pull request to the merge queue Nov 17, 2025
@alexpyattaev alexpyattaev removed this pull request from the merge queue due to a manual request Nov 17, 2025
Copy link
Copy Markdown

@KirillLykov KirillLykov left a comment

Choose a reason for hiding this comment

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

re-approving

@alexpyattaev alexpyattaev added this pull request to the merge queue Nov 18, 2025
Merged via the queue into anza-xyz:master with commit 432d810 Nov 18, 2025
46 checks passed
@alexpyattaev alexpyattaev deleted the streamer_configs branch November 18, 2025 09:40
rustopian pushed a commit to rustopian/agave that referenced this pull request Nov 20, 2025
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.

4 participants