Commit Graph

14 Commits

Author SHA1 Message Date
Tyera c32377b5af
Split out quic- and udp-client definitions (#28762)
* Move ConnectionCache back to solana-client, and duplicate ThinClient, TpuClient there

* Dedupe thin_client modules

* Dedupe tpu_client modules

* Move TpuClient to TpuConnectionCache

* Move ThinClient to TpuConnectionCache

* Move TpuConnection and quic/udp trait implementations back to solana-client

* Remove enum_dispatch from solana-tpu-client

* Move udp-client to its own crate

* Move quic-client to its own crate
2022-11-18 12:21:45 -07:00
Tyera Eulberg c24eaa36f8
Split up solana-client (#27246)
* Move thin-client to new crate

* Move tpu client and varieties to new crate

* Move pubsub-client to new crate

* Move rpc-client to new crate

* Add client-common crate to avoid circular dependencies

* Move rpc_cache and make less pub

* Remove unused unpub modules

* Add nonce-client

* Remove unused dependencies

* Fix rpc_client docs

* Move spinner to calling clients

* Rename client-common to rpc-client-api

* Remove unnecessary rpc_ prefix

* Remove unused ClientErrorKind variant

* Remove unnecessary Client prefix

* Move mod declarations into lib.rs and remove unnecessary files

* Rename nonce-client and remove redundant module name

* Restore mock_sender_for_cli in solana-client
2022-08-24 05:34:35 +00:00
Pankaj Garg fb922f613c
Compute maximum parallel QUIC streams using client stake (#26802)
* Compute maximum parallel QUIC streams using client stake

* clippy fixes

* Add unit test
2022-07-29 08:44:24 -07:00
Pankaj Garg 27866aeab4
Fix transaction chunking on QUIC batch send (#26642)
* Fix chunking of transaction at batch transmit via QUIC

* clippy fixes
2022-07-22 08:56:15 -07:00
ryleung-solana f0994c4ba1
Merge pull request from GHSA-x236-qc46-7v8j
* Restrict the usable port range of the validator such that adding QUIC_PORT_OFFSET never gets us an invalid port. Also validate this for incoming ContactInfos

* Require the proper port range in ContactInfo::valid_client_facing_addr

* Use asserts instead of panics, and enforce USABLE_PORT_RANGE for all the ports in ContactInfo

* Fix typo

* Make the quic client return errors on the quinn endpoint connect() call,
not just the result of awaiting the connect() call, as the connect()
call can itself fail realistically (e.g. due to expected/invalid IPs, etc)

* Update USABLE_PORT_RANGE to a better range and use port_range_validator to validate dynamic-port-range rather than a panic

* Fall back on UDP when the remote peer's tpu port is too large to have QUIC_PORT_OFFSET added to it

* Get rid of tpu port sanitization in ContactInfo

* Turn USABLE_PORT_RANGE into a Range and make connnection_cache fall back on UDP when the tpu port is out of range

* Fix build

* Dummy commit

* Reert dummy commit

* dummy commit

* revert dummy commit

* Fix typo

* Fix range validation

* Fix formatting

* Fix USABLE_PORT_RANGE

* Remove USABLE_PORT_RANGE

* Avoid creating a QuicLazyInitializedEndpoint when forcing the use of UDP

* Implement test for connection cache overflow
2022-07-19 14:54:42 +02:00
Richard Patel 048b9f670b
Set solana-tpu ALPN protocol ID (#26587) 2022-07-13 20:55:13 +02:00
Pankaj Garg 14ee87d793
Move QUIC TLS certificate code in its own file (#26569) 2022-07-12 13:34:37 -07:00
Pankaj Garg ea7448c568
Use client certs in QUIC to get peer's stake (#26477)
* Use client certs in QUIC to get peer's stake

* fixes to cert processing

* integrate the code

* clippy

* more cleanup

* sort cargo deps

* test fixes

* info -> debug
2022-07-11 18:06:40 +00:00
ryleung-solana 4772a93109
Quic handshake timeout (#26306)
* Implement timeout for the quic client and server handshake
2022-07-11 14:10:12 +08:00
ryleung-solana 826f3312cc
Replace unwraps with expects in quic-client to aid debugging (#26283) 2022-06-29 15:37:27 +08:00
Jon Cinque 2436a2bea8
client: Use async connection in async TPU client (#25969)
* client: Add nonblocking QuicTpuConnection implementation

* Remove integer arithmetic

* client: Support sync and async connections in cache

* client: Use async connection in async TPU client

* Address feedback

* Rename Connection -> BaseTpuConnection
2022-06-28 11:01:49 -04:00
Lijun Wang 61946a49c3
Weight concurrent streams by stake (#25993)
Weight concurrent streams by stake for staked nodes
Ported changes from #25056 after address merge conflicts and some refactoring
2022-06-21 12:06:44 -07:00
Lijun Wang 29b597cea5
Connection pool support in connection cache and QUIC connection reliability improvement (#25793)
* Connection pool in connection cache and handle connection errors

1. The connection not has a pool of connections per address, configurable, default 4
2. The connections per address share a lazy initialized endpoint
3. Handle connection issues better, avoid race conditions
4. Various log improvement for help debug connection issues
2022-06-10 09:25:24 -07:00
Jon Cinque 10afdfee90
client: Refactor quic_client to nonblocking module (#25501) 2022-06-02 01:20:11 +02:00