Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ThinClient from dos/ #117

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

gregcusack
Copy link

@gregcusack gregcusack commented Mar 6, 2024

5th PR on the way to remove ThinClient completely.
See

Problem

ThinClient is deprecated, so we need to remove solana-dos's reliance on it

Summary of Changes

Use TpuClient in solana-dos instead of ThinClient

@gregcusack gregcusack added the noCI Suppress CI on this Pull Request label Mar 6, 2024
@gregcusack gregcusack added CI Pull Request is ready to enter CI and removed noCI Suppress CI on this Pull Request labels Mar 6, 2024
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Mar 6, 2024
@gregcusack gregcusack force-pushed the remove-thin-client-from-dos branch 2 times, most recently from 3edaa52 to f2e0867 Compare March 6, 2024 23:21
Comment on lines -218 to -228
let (rpc_addrs, tpu_addrs): (Vec<_>, Vec<_>) = nodes
.iter()
.filter_map(|node| node.valid_client_facing_addr(protocol, socket_addr_space))
.unzip();
let num_nodes = tpu_addrs.len();
(
ThinClient::new_from_addrs(rpc_addrs, tpu_addrs, connection_cache),
num_nodes,
)
Copy link
Author

@gregcusack gregcusack Mar 6, 2024

Choose a reason for hiding this comment

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

this seems to be spinning up rpc multiple clients under the wrapper of a ThinClient. I was able to get similar performance with a single TPU Quic client. This similar performance is why I changed it to a single TPU Client. However, I am not sure I have full context as to whether solana-dos needs to spin up multiple TPU clients for reasons other than maximizing rate_per_second

@gregcusack gregcusack marked this pull request as ready for review March 7, 2024 00:18
@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 25 lines in your changes are missing coverage. Please review.

Project coverage is 81.8%. Comparing base (e027a8b) to head (7d09b50).
Report is 17 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master     #117    +/-   ##
========================================
  Coverage    81.8%    81.8%            
========================================
  Files         838      838            
  Lines      226389   226273   -116     
========================================
- Hits       185342   185263    -79     
+ Misses      41047    41010    -37     

KirillLykov
KirillLykov previously approved these changes Mar 7, 2024
Copy link

@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.

looks good, the only thing is that this PR does two things:

  • ThinClient -> TpuClient in dos
  • removes ThinClient from bench-tps

I would split these changes because they are unrelated from what I see.

dos/src/main.rs Outdated
let rpc_pubsub_url = format!("ws://{}/", cluster.entry_point_info.rpc_pubsub().unwrap());
let rpc_url = format!("http://{}", cluster.entry_point_info.rpc().unwrap());

let ConnectionCache::Quic(cache) = &*cluster.connection_cache else {

Choose a reason for hiding this comment

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

&* looks a bit suspicious

Copy link
Author

Choose a reason for hiding this comment

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

Ya tbh i thought so too lol. But it is used in ThinClient here, here, and here.

Also looks like it is a valid way to get a reference to the internal structure in an Arc. See: https://doc.rust-lang.org/beta/std/sync/struct.Condvar.html and https://stackoverflow.com/questions/62651479/understanding-to-access-a-rust-arc

dos/src/main.rs Outdated
.unwrap(),
cluster.connection_cache.clone(),
));
let rpc_pubsub_url = format!("ws://{}/", cluster.entry_point_info.rpc_pubsub().unwrap());

Choose a reason for hiding this comment

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

myabe move this common code to create TpuClient to some helper function in the scope of tests submodule?

Copy link
Author

Choose a reason for hiding this comment

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

good idea. will do

KirillLykov
KirillLykov previously approved these changes Mar 7, 2024
CriesofCarrots
CriesofCarrots previously approved these changes Mar 7, 2024
gossip/src/gossip_service.rs Show resolved Hide resolved
dos/src/main.rs Show resolved Hide resolved
@gregcusack gregcusack merged commit 218de23 into anza-xyz:master Mar 11, 2024
46 checks passed
@gregcusack gregcusack deleted the remove-thin-client-from-dos branch March 11, 2024 22:19
codebender828 pushed a commit to codebender828/agave that referenced this pull request Oct 3, 2024
* remove `ThinClient` from `dos/` and replace `ThinClient` with `TpuClient`

* remove test for valid_client_facing_addr since it is no longer used
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.

5 participants