solana/cli/src
behzad nouri 1ad69cfc38
removes dynamic cast and dynamic dispatch from connection-cache (#30128)
Dynamic dispatch forces heap allocation and adds extra overhead.
Dynamic casting as in the ones below, lacks compile-time type safety:
https://github.com/solana-labs/solana/blob/eeb622c4e/quic-client/src/lib.rs#L172-L175
https://github.com/solana-labs/solana/blob/eeb622c4e/udp-client/src/lib.rs#L52-L55

The commit removes all instances of Any, Box<dyn ...>, and Arc<dyn ...>,
and instead uses generic and associated types.

There are only two protocols QUIC and UDP; and the code which has to
work with both protocols can use a trivial thin enum wrapper.

With respect to connection-cache specifically:
* connection-cache/ConnectionCache is a single protocol cache which
  allows to use either QUIC or UDP without any build dependency on the
  other protocol.
* client/ConnectionCache is an enum wrapper around both protocols and
  can be used in the code which has to work with both QUIC and UDP.

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2023-02-09 00:50:44 +00: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 removes dynamic cast and dynamic dispatch from connection-cache (#30128) 2023-02-09 00:50:44 +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