Commit Graph

436 Commits

Author SHA1 Message Date
Greg Cusack f35bda5067 add in method for building a `TpuClient` for `LocalCluster` tests (#258)
* add in method for building a TpuClient for LocalCluster tests

* add cluster trait. leave dependency on solana_client::tpu_client
2024-03-20 16:28:37 -05:00
anwayde 6e29c801f3 bench-tps: allow option to not set account data size on every transaction (#209)
bench-tps: allow option to not set account data size
2024-03-15 22:25:14 -05:00
Greg Cusack 9a8da98577 Fully remove `ThinClient` from `bench-tps` (#132)
remove ThinClient from bench-tps
2024-03-15 22:22:45 -05:00
kirill lykov ca1af7b702 Add get_blocks and get_slot methods to bench-tps-client (#94)
* add get_block(s)/slot methods to BenchTpsClient

* Update Cargo.lock

* add commitment level for get_slot/blocks
2024-03-09 13:28:07 -06:00
Greg Cusack 5f6d66e87b
Deprecate `ThinClient` and remove `ThinClient` from `bench-tps` (#35365)
* deprecate ThinClient

* switch localcluster bench test to use tpuclient

add back in command line args for thinclient. add thin-client deprecation README

refactor TpuClient connection

* remove thin-client from net/

* change 2.0.0 to 1.19.0
2024-03-01 12:14:52 -08:00
Greg Cusack 98ec72e6ed
change default `bench-tps` client to `tpu-client` (#35335)
* change default bench-tps client to tpu-client

* remote client default to tpu-client

* add --use-tpu-client back in. hide --use-thin-client

* address nit, inform of future thinclient deprecation
2024-02-28 12:30:24 -08:00
Greg Cusack fe571bbab3
Plumb `CommitmentConfig` through `bench-tps` client types (#35282)
* use --commitment-config <commitment-level> for setting blockhash commitment level for sending transactions with rpc-client

* clarify default

* leave get_balance_with_commitment at processed()

* rm unused variable

* refactor commitment_config flag read in

* update cli and change send_batch's get_latest_blockhash() to get_latest_blockhash_with_client_commitment() and use client's internal commitment level

* change fix some nits based on PR comments

* rm unused import
2024-02-23 11:50:41 -08:00
Pankaj Garg 6bbd3661e1
Throttle unstaked quic streams for a given connection (#34562)
* Throttle unstaked quic streams for a given connection

* Fix interval duration check

* move wait to handle_chunk

* set max unistreams to 0

* drop new streams

* cleanup

* some more cleanup

* fix tests

* update test and stop code

* fix bench-tps
2023-12-21 18:47:52 -08:00
GoodDaisy 03386cc7b9
Fix typos (#34459)
* Fix typos

* Fix typos

* fix typo
2023-12-21 13:06:00 -07:00
Lucas Steuernagel 1877fdb273
Use BankForks on tests - Part 4 (#34271)
* Use BankForks on tests - Part 4

* Ensure the correct slot is set
2023-12-06 13:32:04 -03:00
Lucas Steuernagel b97b3dd4ab
Use BankForks on tests - Part 3 (#34248)
* Add BankForks to core tests

* Refactor functions under DCOU
2023-12-01 13:47:22 -03:00
Lijun Wang 344e466e12
Async connection creation in connection cache (#33302)
If there is a connection in the cache available, use it and create the additional connection asynchronously.
2023-09-25 18:17:47 -07:00
kirill lykov c6b0d4a496
specify compute budget when padding program is used (#33234)
* specify compute budget when padding program is used

* fix numeric const format
2023-09-14 14:18:58 +02:00
kirill lykov ec9b30965e
Increase loaded accounts data size when padding program is used (#33219)
* Increase loaded accounts data size when padding program is used

* fix dos tool accordingly
2023-09-13 11:20:40 +02:00
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
Andrew Fitzgerald 0996b5e245
BenchTPS: Allow a fixed compute-unit-price (#32775) 2023-08-15 15:20:04 -07:00
Andrew Fitzgerald a875562ccd
Funding transactions must specify data limit (#32131) 2023-06-15 18:53:04 +00:00
Andrew Fitzgerald 90812fac76
bench-tps tests use bank w/ all features enabled (#32142) 2023-06-15 17:38:39 +00:00
Tao Zhu 4b30454193
bench-tps add 1_000 as multiplier to compute-unit-price (#32132)
add 1_000 as multiplier to compute-unit-price
2023-06-14 14:50:18 -05:00
Tao Zhu e83a06d85e
set Transfer transaction loaded_accounts_data_size in bench-tps (#32105)
* set Transfer transaction loaded_accounts_data_size in bench-tps

* increase compute_unit_limit for additional ix
2023-06-14 13:30:43 -05:00
behzad nouri 5760390d3b
removes redundant NewConnectionConfig trait (#31979)
Working towards removing hard-coded TPU specific configurations from
QUIC code; NewConnectionConfig is redundant and gets in the way.
2023-06-06 21:28:29 +00:00
Illia Bobyr 4353ac6797
Pass Arc<AtomicBool> by value, not by reference. (#31916)
`Arc` is already a reference internally, so it does not seem to be
beneficial to pass a reference to it.  Just adds an extra layer of
indirection.

Functions that need to be able to increment `Arc` reference count need
to take `Arc<AtomicBool>`, but those that just want to read the
`AtomicBool` value can accept `&AtomicBool`, making them a bit more
generic.

This change focuses specifically on `Arc<AtomicBool>`.  There are other
uses of `&Arc<T>` in the code base that could be converted in a similar
manner.  But it would make the change even larger.
2023-06-01 17:25:48 -07:00
Yihau Chen 420784d19e
chore: use workspace's tempfile (#31895) 2023-05-31 16:58:40 +00:00
behzad nouri 9281ab7d97
separates out connection-cache metrics for different protocols (#31803) 2023-05-25 14:48:22 +00:00
Illia Bobyr 00405bbc42
Cargo.toml: Remove duplicate solana dependencies (#31607)
See comment in Cargo.toml for an explanation of the issue.

This change removes duplicate dependencies for older version of solana-*
crates, and any of the dependencies that are no longer needed.
2023-05-15 19:02:11 -07:00
behzad nouri 4e34abbf3d
specifies protocol in contact-info get-socket api (#31602) 2023-05-12 16:16:20 +00:00
behzad nouri 6a4a0418a6
removes hard-coded QUIC_PORT_OFFSET from connection-cache (#31541)
New ContactInfo has api identifying QUIC vs UDP ports; no need to hard-code
port-offset deep in connection-cache.
2023-05-09 13:46:17 +00:00
dependabot[bot] d6f65ccc27
Bump tempfile from 3.4.0 to 3.5.0 (#31439)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/Stebalien/tempfile/releases)
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/NEWS)
- [Commits](https://github.com/Stebalien/tempfile/commits)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: illia.bobyr@solana.com
2023-05-02 11:29:23 -07:00
behzad nouri aafcac27d8
removes pubkey from LegacyContactInfo public interface (#31375)
Working towards LegacyContactInfo => ContactInfo migration, the commit
adds more api parity between the two.
2023-04-28 12:05:15 +00:00
Andrew Fitzgerald 6f014710ff
Fix keypair multiplier check (#31374) 2023-04-27 18:00:09 -07:00
Andrew Fitzgerald 99cd1a51f5
Set compute unit limit correctly (#31352) 2023-04-26 18:28:56 -07:00
Andrew Fitzgerald 843ff9e5d2
bench-tps: rename tx_count arg to tx-count for consistency (#31213) 2023-04-17 10:59:39 -07:00
behzad nouri ce21a58b65
reworks streamer::StakedNodes (#31082)
{min,max}_stake are computed but never assigned:
https://github.com/solana-labs/solana/blob/4564bcdc1/core/src/staked_nodes_updater_service.rs#L54-L57

The updater code is also inefficient and verbose.
2023-04-10 17:07:40 +00:00
Ryo Onodera 721719d776
Add solana_clap_utils::hidden_unless_forced() (#30843)
* Add solana_clap_utils::hidden_unless_forced()

* Use more descriptive env name

Co-authored-by: mvines <mvines@gmail.com>

---------

Co-authored-by: mvines <mvines@gmail.com>
2023-03-22 08:59:17 +00:00
behzad nouri 3cc74a6087
updates tempfile to 3.4.0 (#30727)
Patching below rustsec advisory:

    Crate:     remove_dir_all
    Version:   0.5.3
    Title:     Race Condition Enabling Link Following and Time-of-check Time-of-use (TOCTOU)
    Date:      2023-02-24
    ID:        RUSTSEC-2023-0018
    URL:       https://rustsec.org/advisories/RUSTSEC-2023-0018
    Solution:  Upgrade to >=0.8.0
2023-03-15 18:25:35 -06:00
kirill lykov 2c37763d7c
Improve cli args parsing in bench-tps (#30307)
* Improve cli args parsing in bench-tps

* Rename parse funciton
* Get rid of panics, exit and println
* Add basic unit tests

* add allow dead_code and unused_imports for cli tests

* simplify code by using map_err instead of macro

* simplify data_size parsing

* use tempfile crate to create temp keypair files

* fix bug with reading client_id from config by default, re-added client_id tests

* minor fix of an error message

* add Eq to bench_tps::cli::Congig

* some minor error messages corrections
2023-02-24 15:39:43 +01:00
Yihau Chen df3ef111f7
chore: workspace inheritance (#29893)
* introduce workspace.package

* introduce workspace.dependencies

* read version from root cargo.toml

* pass check when version = { workspace = true }

* don't bump version when version = { workspace = true }

* including workspace Cargo.toml when bump version

* programs/sbf use workspace inheritance

* fix increasing cargo version ignore program/sbf/Cargo.toml
2023-02-23 22:01:54 +08:00
Michael Vines 5136ed3448
Update homepage value for all crates (#30444) 2023-02-23 02:20:18 +00:00
kirill lykov 069ebb8081
Node identity for bench (#29929)
* add beind_address and client_node_id to bench cli

* use provided node_id and bind_address in connection cache

* add two cli args client_node_stake and client_node_total_stake

* update connection cache construction after upstream update

* use ConnectionCache without Arc to use BackendConnectionCache

* remove comments

* Extend client_node_od cli arg help message

* address PR comments

* simplified staked_nodes creation

* remove delinquent nodes when computing total stake at bench-tps
2023-02-18 09:52:48 +01:00
behzad nouri ded457cd73
embeds the new gossip ContactInfo in ClusterInfo (#30022)
Working towards replacing the legacy gossip contact-info with the new
one, the commit updates the respective field in gossip cluster-info.
2023-02-10 20:07:45 +00:00
Lijun Wang 84fbf9273b
Refactor thin client (#30229)
Make client/thin_client a thin wrapper and forward calls to the thin-client/thin_client
2023-02-10 09:55:13 -08:00
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
Lijun Wang a24363bb04
Refactor tpu_client -- remove duplicate code (#30104)
Removed implementation in client/tpu_client and make it a thin wrapper to forward calls to the backend TpuClient. There is some minor change to coerce the client/ConnectionCache to connection-cache/ConnectionCache.
2023-02-03 17:47:50 -08: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
Andrew Fitzgerald d944c657a2
Use RangeBounds for is_within_range (#29763) 2023-02-01 09:17:12 -08:00
Will Hickey 04a6a631bc
Bump version to v1.16 (#30028) 2023-01-31 17:48:33 -06:00
joeaba a12bf8c003
Update maintainers references (#29997)
* update maintainers references

* chore: update maintainers reference
2023-01-31 08:07:13 -05:00
Yihau Chen 9193b4221d
Revert "chore: workspace inheritance (#29509)" (#29892)
This reverts commit a67d239dde.
2023-01-25 15:50:41 +08:00
Yihau Chen a67d239dde
chore: workspace inheritance (#29509)
* introduce workspace.package

* introduce workspace.dependencies

* read version from root cargo.toml

* pass check when version = { workspace = true }

* don't bump version when version = { workspace = true }

* including workspace Cargo.toml when bump version

* programs/sbf use workspace inheritance

* fix increasing cargo version ignore program/sbf/Cargo.toml
2023-01-25 13:59:59 +08:00
Kevin Ji dd92f225bb
Use Ipv4Addr::{LOCALHOST, UNSPECIFIED} constants (#29813) 2023-01-23 16:49:51 -06:00