solana/cli/src
Lijun Wang ada6136a6c
Refactor connection cache to support generic msgs (#29774)
tpu-client/tpu_connection_cache is refactored out the module and moved to connection-cache/connection_cache and the logic in client/connection_cache is consolidated to connection-cache/connection_cache as well. client/connection_cache only has a thin wrapper which forward calls to connection-cache/connection_cache and deal with constructions of quic/udp connection cache for clients using them both.2.

The TpuConnection is refactored to ClientConnection to make it generic and functions renamed to be proper for other workflows. eg. tpu_addr -> server_addr, send_transaction --> send_data and etc...

The enum dispatch is removed so that we can make the bulk of code of quic and udp agnostic of each other. The client is possible to load quic or udp only into its runtime.

The generic type parameter in the tpu-client/tpu_connection_cache is removed in order to create both quic and udp connection cache and use the object to send transactions with multiple branching when sending data. The generic type parameters and associated types are dropped in other types in order to make the trait "object safe" for this purpose.

I have annotated the code explaining the reasoning and the refactoring source -> destination.

There is no functional changes

bench-tps has been performed for rpc-client, thin-client and tpu-client. And it is found the performance number largely match the ones before the refactoring.
2023-02-01 18:10:06 -08:00
..
address_lookup_table.rs patches errors from clippy::uninlined_format_args 2022-12-06 19:32:15 +00:00
checks.rs deprecates Pubkey::new in favor of Pubkey::{,try_}from (#29805) 2023-01-21 18:06:27 +00:00
clap_app.rs cli: Use QUIC if the default TPU does *not* use UDP (#29141) 2022-12-07 23:12:46 +01:00
cli.rs Refactor connection cache to support generic msgs (#29774) 2023-02-01 18:10:06 -08:00
cluster_query.rs Restore compatibility for solana rent --output json command (#29953) 2023-01-27 10:22:12 -06:00
compute_unit_price.rs Cli support compute_unit_price (#26464) 2022-08-02 22:23:05 -05:00
feature.rs Add fee-payer arg to solana feature activate (#29367) 2022-12-22 10:07:56 -07:00
inflation.rs patches errors from clippy::uninlined_format_args 2022-12-06 19:32:15 +00:00
lib.rs cli: Add subcommands for address lookup tables (#27123) 2022-08-18 22:12:53 +01:00
main.rs Refactor connection cache to support generic msgs (#29774) 2023-02-01 18:10:06 -08:00
memo.rs deprecates Pubkey::new in favor of Pubkey::{,try_}from (#29805) 2023-01-21 18:06:27 +00:00
nonce.rs deprecates Pubkey::new in favor of Pubkey::{,try_}from (#29805) 2023-01-21 18:06:27 +00:00
program.rs fixes errors from clippy::needless_borrow (#29535) 2023-01-05 18:21:56 +00:00
spend_utils.rs Use new client crates (#27360) 2022-08-24 10:47:02 -06:00
stake.rs Use RangeBounds for is_within_range (#29763) 2023-02-01 09:17:12 -08:00
test_utils.rs Use new client crates (#27360) 2022-08-24 10:47:02 -06:00
validator_info.rs patches errors from clippy::uninlined_format_args 2022-12-06 19:32:15 +00:00
vote.rs Use RangeBounds for is_within_range (#29763) 2023-02-01 09:17:12 -08:00
wallet.rs patches errors from clippy::uninlined_format_args 2022-12-06 19:32:15 +00:00