Commit Graph

39 Commits

Author SHA1 Message Date
Alexander Meißner 9e703f85de
Upgrades Rust to 1.72.0 & nightly-2023-08-25 (#32961)
* allow pedantic invalid cast lint

* allow lint with false-positive triggered by `test-case` crate

* nightly `fmt` correction

* adapt to rust layout changes

* remove dubious test

* Use transmute instead of pointer cast and de/ref when check_aligned is false.

* Renames clippy::integer_arithmetic to clippy::arithmetic_side_effects.

* bump rust nightly to 2023-08-25

* Upgrades Rust to 1.72.0

---------

Co-authored-by: Trent Nelson <trent@solana.com>
2023-09-01 07:26:13 +00:00
galactus dbac50dcc8
New method to send large number of transactions to the cluster (#32388)
* Adding a method which sends and confirm a large number of transactions in parallel and using it to deploy programs

* Using the new method to deploy programs

* Minor changes, break when transaction map is empty

* Updating cargo for all lock files

* Sorting dependencies

* Changes after tnelson's comment

* confirm recently expired transactions and improve tracking of transaction sending

* Minor changes

* more changes after tnelson's comments

* Adding serialized transaction in TransactionData

* Update client/src/send_and_confirm_transactions_in_parallel.rs

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* Update client/src/send_and_confirm_transactions_in_parallel.rs

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* nit changes from trent

* Fixing kirills comments, adding some unit tests

* fixing ci, and minor change

* addressing Kirills nit comments

---------

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2023-07-25 12:08:01 -06:00
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
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
Brian Anderson 7e7e9b2775
Fix broken doc links in solana-client (#28714) 2022-11-01 21:21:20 -06: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
ryleung-solana 8cfc010b84
Send async quic batch of txs (#24298)
Add an interface send_wire_transaction_batch_async to TpuConnection to allow for sending batches without waiting for completion

Co-authored-by: Anatoly Yakovenko <anatoly@solana.com>
2022-04-14 22:20:34 -04:00
anatoly yakovenko 474080608a
Async send for send transaction service (#24265)
* async send
2022-04-12 07:15:59 -07:00
Tyera Eulberg 3871c85fd7
Add BenchTpsClient trait (#24208)
* Add BenchTpsClient

* Impl BenchTpsClient for used clients

* Use BenchTpsClient in do_bench

* Update integration test to use faucet via rpc

* Support keypairs from file that are not prefunded

* Remove old perf-utils
2022-04-11 13:45:40 -06:00
ryleung-solana 9b46f9b2da
Quic Connection Cache (#23598)
Add a connection cache to allow add modules that send data to get or create connections (e.g. for quic) associated with a certain SocketAddr
2022-03-15 18:16:35 -04:00
ryleung-solana 17b00ad3a4
Add quic-client module (#23166)
* Add quic-client module to send transactions via quic, abstracted behind the TpuConnection trait (along with a legacy UDP implementation of TpuConnection) and change thin-client to use TpuConnection
2022-03-09 21:33:05 -05:00
Brian Anderson 176fd23002
Continue making it possible to implement RpcSender (#23561)
* Make nonblocking RpcClient::new_sender pub

As is the blocking RpcClient::new_sender, per #23503.

* Make solana_client::rpc_sender pub

Per #17631 it is supposed to be possible to implement RpcSender in
order to call RpcClient::new_sender. As of now though it is
not possible to name RpcSender in order to implement it.
2022-03-09 14:07:51 -07:00
Michael Vines 8c376f58cb Drop feature, move to nonblocking mod 2022-01-27 08:19:03 -08:00
Kirill Fomichev a6a8a712e5 Add async WebSocket PubsubClient 2022-01-27 08:19:03 -08:00
Michael Vines 85e8bece2e Add solana_client::nonblocking::RpcClient 2022-01-26 17:58:00 -08:00
Jon Cinque 5f7b60576f
tpu-client: Move `send_messages_with_spinner` from program (#20960)
We have too many ways of sending transactions, and too many
reimplementations of the same logic all over the place.

The program deploy logic and stake-o-matic currently make the
most use of the TPU client, so this merges their implementations into
one place to be reused by both.  Yay for consolidation!
2021-10-26 22:54:26 +02:00
sakridge 60fe29b63e
Move transaction executor (#19946) 2021-10-13 13:06:23 +02:00
Justin Starry 75b8434b76
Add TPU client for sending txs to the current leader tpu port (#16736)
* Add TPU client for sending txs to the current leader tpu port

* Update tpu_client.rs
2021-04-23 09:35:12 +08:00
Tyera Eulberg 974e6dd2c1
Deprecate "confirmed" RpcClient methods (#16520)
* Remove obsolete client methods

* Deprecate GetConfirmed client methods

* Rename Confirmed config structs, with appropriate deprecation

* Fixup client apps

* Map RpcRequest to deprecated when targeting older nodes
2021-04-15 17:00:14 -06:00
Trent Nelson 7f7370c306 Re-allow clippy::integer_arithmetic at crate-level 2021-02-17 13:55:08 -07:00
Josh 4013f91dbe
RPC: add caching to getLargestAccounts (#15154)
* introduce get largest accounts cache

* remove cache size and change hash key

* remove eq and hash derivation from commitment config

* add slot to the cache
2021-02-11 11:32:46 -08:00
Michael Vines 247228ee61 Implementation-defined RPC server errors are now accessible to client/ users 2020-10-13 10:05:44 -07:00
Trent Nelson ba353c2b1d Move CLI blockhash_query module into client crate 2020-09-23 15:58:44 -06:00
Trent Nelson dda48e2d06 Move `CliNonceError` into client crate 2020-09-23 15:58:44 -06:00
Tyera Eulberg 8d951776ab
Rpc: add filter to getProgramAccounts (#10888)
* Add RpcFilterType, and implement CompareBytes for getProgramAccounts

* Accept bytes in bs58

* Rename to memcmp

* Add Memcmp optional encoding field

* Add dataSize filter

* Update docs

* Clippy

* Simplify tests that don't need to test account contents; add multiple-filter tests
2020-07-03 07:46:29 +00:00
Greg Fitzgerald 64cec764b9
Allow RpcClient users to inject custom "senders" (#10157)
automerge
2020-05-20 18:40:45 -07:00
Tyera Eulberg ee7f15eff1
Rpc: optionally filter getLargestAccounts by circulating/nonCirculating (#10007)
* Add circ/non-circ filter to getLargestAccounts

* Plumb largest accounts into client and cli

* Bump timeout toward CI flakiness

* Update docs
2020-05-12 21:05:05 -06:00
Sunny Gleason a7fa92b372
feat: implementation of live-slots command (#8129) 2020-02-06 14:16:30 -05:00
Tyera Eulberg 6d3b8b6d7d
Remove tuples from JSON RPC responses (#7806)
* Remove RpcConfirmedBlock tuple

* Remove getRecentBlockhash tuple

* Remove getProgramAccounts tuple

* Remove tuple from get_signature_confirmation_status

* Collect Rpc response types

* Camel-case epoch schedule for rpc response

* Remove getBlockCommitment tuple

* Remove getStorageTurn tuple

* Update json-rpc docs
2020-01-15 00:25:45 -07:00
Michael Vines d50aef8404 Add get-epoch-info command (#6161)
automerge
2019-09-27 22:00:30 -07:00
sakridge aac626c2c2
Add sample_txs function to perf_utils shared crate (#4104)
Shared code between bench-tps and bench-exchange
2019-05-01 15:58:35 -07:00
Tyera Eulberg 5a79676b8a Custom error decoder (#3783)
automerge
2019-04-25 10:29:44 -07:00
Tyera Eulberg 4068612300 Remove RpcSignatureStatus 2019-04-05 22:09:29 -06:00
Michael Vines 73ceaf07b1 client/: move RpcClient from rpc_request.rs to rpc_client.rs 2019-03-16 23:27:23 -07:00
Michael Vines 7b314f47f7 Factor RPC request mechanism out of RpcClient into *RpcClientRequest 2019-03-16 23:27:23 -07:00
Michael Vines 23337e08eb client/: Merge client.rs into thin_client.rs 2019-03-16 22:48:26 -07:00
Michael Vines e2c24481e4 wallet/ now only dev-depends on core/ 2019-03-16 21:40:39 -07:00
Tyera Eulberg 1d689e84f1 Move and rename cluster_client 2019-03-12 22:05:38 -06:00
Tyera Eulberg 3fc96c4a18 Add solana-client crate 2019-03-12 22:05:38 -06:00