Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Optimize TpuConnection and its implementations #23877

Merged

Conversation

ryleung-solana
Copy link
Contributor

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 #

@t-nelson t-nelson added the CI Pull Request is ready to enter CI label Mar 23, 2022
@solana-grimes solana-grimes removed the CI Pull Request is ready to enter CI label Mar 23, 2022
lijunwangs
lijunwangs previously approved these changes Mar 23, 2022
Copy link
Contributor

@lijunwangs lijunwangs 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 to me

t-nelson
t-nelson previously approved these changes Mar 23, 2022
Copy link
Contributor

@t-nelson t-nelson left a 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<()>
Copy link
Contributor

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 {
Copy link
Contributor

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
@ryleung-solana ryleung-solana force-pushed the tpu-connection-optimize branch from 9ecaca8 to 510c1ca Compare March 23, 2022 23:48
@mergify mergify bot dismissed stale reviews from t-nelson and lijunwangs March 23, 2022 23:51

Pull request has been modified.

@ryleung-solana ryleung-solana merged commit 82945ba into solana-labs:master Mar 24, 2022
@sakridge sakridge added the v1.10 label Mar 24, 2022
mergify bot pushed a commit that referenced this pull request Mar 24, 2022
…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
t-nelson pushed a commit to t-nelson/solana that referenced this pull request Mar 25, 2022
…n-cache to not use dyn in order to enable those changes (solana-labs#23877)
t-nelson pushed a commit that referenced this pull request Mar 25, 2022
…n-cache to not use dyn in order to enable those changes (#23877)
sakridge pushed a commit that referenced this pull request Mar 25, 2022
…n-cache to not use dyn in order to enable those changes (#23877) (#23909)

Co-authored-by: ryleung-solana <91908731+ryleung-solana@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants