-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Optimize TpuConnection and its implementations #23877
Optimize TpuConnection and its implementations #23877
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. just nits
@@ -63,19 +63,22 @@ impl TpuConnection for QuicTpuConnection { | |||
&self.client.addr | |||
} | |||
|
|||
fn send_wire_transaction(&self, wire_transaction: &[u8]) -> TransportResult<()> { | |||
fn send_wire_transaction<T>(&self, wire_transaction: T) -> TransportResult<()> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally these API changes would be at least a separate commit. given that neither they, nor the switch to enums build off each other, a separate PR is also appropriate.
I know I'm being a pain in the ass about this, but making the smallest, most concise, change per PR drastically improves reviewability (and review turnaround!) and also allows for higher resolution reverts should that need to happen
@@ -121,6 +184,13 @@ mod tests { | |||
addr_str.parse().expect("Invalid address") | |||
} | |||
|
|||
fn ip(conn: Connection) -> IpAddr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be on impl Connection {
(still under mod test
) instead of standalone
…n-cache to not use dyn in order to enable those changes
9ecaca8
to
510c1ca
Compare
Pull request has been modified.
…n-cache to not use dyn in order to enable those changes (#23877) (cherry picked from commit 82945ba) # Conflicts: # client/Cargo.toml # client/src/quic_client.rs # client/src/thin_client.rs # client/src/tpu_connection.rs # client/src/udp_client.rs # core/src/voting_service.rs # send-transaction-service/src/send_transaction_service.rs
…n-cache to not use dyn in order to enable those changes (solana-labs#23877)
…n-cache to not use dyn in order to enable those changes (#23877)
and refactor connection-cache to not use dyn in order to enable those changes
Problem
See #23817 - this PR pulls out the parts of it that optimize TpuConnection to use AsRef as well as the enabling refactoring to connection-cache to allow these changes to be made (i.e. not using dyn).
Summary of Changes
Fixes #