Commit Graph

363 Commits

Author SHA1 Message Date
Tyera Eulberg 96e5342292
Update deprecated variant in RpcClient doctests (#21121) 2021-11-01 20:58:01 -06:00
Tyera Eulberg 1b47f7f2cd
Fixup filter deprecated since (#21123) 2021-11-01 19:06:38 -06:00
Jack May bced07a099
Update fee api to use blockhash (#21054) 2021-10-29 13:52:59 -07:00
Manuel Gil a0f9e0e8ee
Add missing websocket methods to rust RPC PubSub client (#21065)
- Added accountSubscribe,  programSubscribe, slotSubscribe and rootSubscribe to rust RpcClient
 - Removed duplication on cleanup threads
 - Moved RPCVote from rpc/ to client/rpc_response
2021-10-29 17:11:20 +00:00
sakridge 700e42d556
Different error if block status is not yet available (#20407)
* Different error if block is not available

* Add slot to error message

* Make and use helper function

* Check finalized path as well

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-27 13:11:27 -06:00
Tyera Eulberg b2f6cfb9ff
Restore getProgramAccounts spl-token secondary-index functionality (#20993)
* Allow get_spl_token_X_filters to match on any encoding, and optimize earlier

* Remove redundant optimize calls

* Compress match statements

* Add method docs, including note to use optimize_filters before spl-token checks

* Add logs
2021-10-26 21:44:24 +00: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
Jack May 2515f6a04f
Update deprecation versions (#20959) 2021-10-26 09:06:41 -07:00
Tyera Eulberg fbc0919a1f
Bump fee-api check version (#20831) 2021-10-20 22:18:50 +00:00
Kirill Fomichev e9a427b9c8
Rpc: filters performance improvement (#20185)
* Add Base58,Base64,Bytes to MemcmpEncodedBytes

* Rpc: decode memcmp before filtering accounts

* Add deprecated attribute

* Add Memcmp::bytes

* Fix clippy for deprecated

* Another clippy fix

* merge RpcFilterError::DataTooLarge

* add deprecation for Base58DataTooLarge

* change filter data size limit

* strict data size len for base58

* add magic numbers

* fix tests
2021-10-14 12:43:27 -06:00
Jack May da45be366a
Remove blockhash from fee calculation (#20641) 2021-10-13 13:10:58 -07:00
sakridge 60fe29b63e
Move transaction executor (#19946) 2021-10-13 13:06:23 +02:00
Brian Anderson 1417c1456d
Reorder RpcClient method defs for more logical docs. (#20549)
Methods follow this order:

- Constructors
- send_and_confirm variations
- send variations
- confirm variations
- simulate variations
- queries
2021-10-11 12:12:05 -06:00
Michael Vines 7027d56064 Resolve nightly-2021-10-05 clippy complaints 2021-10-06 10:37:58 -07:00
Brian Anderson 082d5dc5b2
Add more docs for RpcClient (#19771)
* Add more docs for RpcClient

* Use custom mocks in rpc_client examples

* Move create_rpc_client_mocks into rpc_client module

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* Update client/src/rpc_client.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update RpcClient docs per review feedback

* Consistently link 'commitment level' in RpcClient docs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-09-27 14:59:25 -06:00
Kirill Fomichev ac79ae6848 Rpc: use rust convenient methods 2021-09-27 11:05:39 -07:00
Kirill Fomichev 9542bae56e Rpc: remove not required clone 2021-09-26 09:17:21 -07:00
Jon Cinque e9b066d497
client: Add retry logic on Pubsub 429s (#19990) 2021-09-18 12:40:43 +02:00
Pavel Strakhov 65227f44dc
Optimize RPC pubsub for multiple clients with the same subscription (#18943)
* reimplement rpc pubsub with a broadcast queue

* update tests for new pubsub implementation

* fix: fix review suggestions

* chore(rpc): add additional pubsub metrics

* integrate max subscriptions check into SubscriptionTracker to reduce locking

* separate subscription control from tracker

* limit memory usage of items in pubsub broadcast queue, improve error handling

* add more pubsub metrics

* add final count metrics to pubsub

* add metric for total number of subscriptions

* fix small review suggestions

* remove by_params from SubscriptionTracker and add node_progress_watchers map instead

* add subscription tracker tests

* add metrics for number of pubsub notifications as a counter

* ignore clippy lint in TokenCounter

* fix underflow in token counter

* reduce queue capacity in pubsub tests

* fix(rpc): fix test timeouts

* fix race in account subscription test

* Add RpcSubscriptions::new_for_tests

Co-authored-by: Pavel Strakhov <p.strakhov@iconic.vc>
Co-authored-by: Nikita Podoliako <n.podoliako@zubr.io>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-17 13:40:14 -06:00
sakridge c8f76b8bd0
Fix tpu service fanout (#19944) 2021-09-17 01:01:56 +02:00
Michael Vines 21f4606212 Add RpcClient::get_transport_stats() 2021-09-09 20:11:15 -07:00
Michael Vines b83284c9f6 TpuClient now uses the processed slot to seed its leader schedule cache 2021-09-08 16:51:25 -05:00
Michael Vines 007fb3abe5 Improve comments, error handling, and retry delay handling 2021-09-08 10:51:55 -05:00
Michael Vines ae43ca3bfb Add RpcClient::get_multiple_accounts_with_config() 2021-09-03 22:41:38 +00:00
Brooks Prumo 38e1f7c4ba
Add backwards compatibility support to get_highest_snapshot_slot() (#19591)
Co-authored-by: Michael Vines <mvines@gmail.com>
2021-09-02 20:47:35 -05:00
Brooks Prumo 8ac94b2cf4
Add Incremental Snapshot support to RPC (#19559)
#### Problem

There's no way to get incremental snapshot information from RPC.

#### Summary of Changes

- Add new RPC method, `getHighestSnapshotSlot` that returns a `SnapshotSlotInfo`, which contains both the highest full snapshot slot, and the highest incremental snapshot slot _based on_ the full snapshot.
- Deprecate old RPC method, `getSnapshotSlot`
- Update API docs

Fixes #19579
2021-09-02 15:25:42 -05:00
Jack May f81bfc8462
Limit message encoding to base-64 (#19468) 2021-08-29 19:53:37 -07:00
Tyera Eulberg 7482861f4b
Add parameter to allow setting max-retries for SendTransaction rpc (#19387)
* Add parameter to cap rpc send retries for a tx

* Add parameter to docs
2021-08-24 22:44:13 -06:00
Brian Anderson 628ad58912
Document more RpcClient methods (#19236)
* Document more RpcClient methods

* Update client/src/rpc_client.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update RpcClient docs per feedback

* Address review feedback

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-08-23 18:49:37 -06:00
Tyera Eulberg cf3fc61821
Add backward compatibility for new RpcClient methods (#19383) 2021-08-24 00:09:00 +00:00
Justin Starry c053df143f
RPC: add option to exclude accounts from get_supply (#19270) 2021-08-17 23:32:58 +00:00
dependabot[bot] 74cc2e5ffa
chore: bump tungstenite from 0.14.0 to 0.15.0 (#19222)
* chore: bump tungstenite from 0.14.0 to 0.15.0

Bumps [tungstenite](https://github.com/snapview/tungstenite-rs) from 0.14.0 to 0.15.0.
- [Release notes](https://github.com/snapview/tungstenite-rs/releases)
- [Changelog](https://github.com/snapview/tungstenite-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/snapview/tungstenite-rs/compare/v0.14.0...v0.15.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

* [auto-commit] Update all Cargo lock files

* Update stream type

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <anatoly+githubjenkins@solana.io>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-13 11:57:22 -06:00
Jack May 0b50bb2b20
Deprecate FeeCalculator returning APIs (#19120) 2021-08-13 09:08:20 -07:00
Tyera Eulberg 5970083b4d
Use last_valid_block_height in services and client apps (#19163)
* Add deprecated tag to Bank::get_blockhash_last_valid_slot

* Update SendTransactionService to use last_valid_block_height

* Update solana-tokens to use last_valid_block_height

* Remove dangling file

* Update solana program to use last_valid_block_height

* Update Banks crates to use last_valid_block_height
2021-08-11 01:04:00 -06:00
Brian Anderson e4b66a5913
Fix deserialization of RPC errors in HttpSender (#19110)
Fixes #15576
2021-08-09 10:45:00 -07:00
Brian Anderson b67ffab370
Add more API documentation for Rust RpcClient (#19021)
* Add doc links to Transaction API docs

* Add more RpcClient API docs

* Reflow some rpc_client docs

* Update client/src/rpc_client.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update client/src/rpc_client.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update client/src/rpc_client.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/src/transaction.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update RpcClient docs per review

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-08-05 15:03:33 -06:00
Trent Nelson 21bc43ed58
nonce: Unify `NonceError` with `SystemError` 2021-07-30 14:47:14 -06:00
Brian Anderson 58f395257b
Fix serialization of parameters in RpcClient::get_block_production_with_config (#18998)
Params must be an array or null.
2021-07-30 20:20:33 +00:00
Michael Vines f264511585 RpcClient::send<T> now supports client-defined RPC methods via RpcRequest::Custom 2021-07-24 09:53:47 -07:00
Michael Vines 69f02af98e Fix build 2021-07-20 12:02:10 -07:00
Brian Anderson 5dcfd7ce74
Add some docs for RpcClient and friends (#18748)
* Add some docs for RpcSender, HttpSender, MockSender

* Support SimulateTransaction in MockSender

* Add docs for RpcClient constructors

* Add some more RpcClient examples

* rustfmt

* Reflow docs in rpc_client and friends
2021-07-20 18:49:32 +00:00
Jack May 74539020b4
Transaction simulation includes cost (#18715) 2021-07-16 14:58:15 -07:00
Trent Nelson bf90ea282a rpc: more params for `GetVoteAccountsConfig` 2021-07-14 08:41:52 +00:00
Tyera Eulberg 8ad4ffdee5
Cli: expose last valid block height (#18620)
* Add Fees struct to client

* Add complete RpcClient::get_fees methods

* Switch cli to last_valid_block_height
2021-07-13 01:41:27 +00:00
Michael Vines 4098af3b5b Record vote account commission with voting/staking rewards and surface in RPC 2021-07-12 15:09:44 -07:00
hrls 70234dfdf4
refactor(rpc_client): const number of retries for send and confirm transaction (#18390)
* refactor(rpc_client): simplfy send and confirm transaction flow

* chore: configurable num of retries for send and confirm
2021-07-05 09:14:48 -07:00
Justin Starry d5961e9d9f
Reject transactions with extra signatures (#18306)
* Reject transactions with extra signatures

* fix tests

* fix check

* fix check

* tx method

* fix checks
2021-07-01 18:06:59 +00:00
Tyera Eulberg 9d4428d3d8
Use timeout to allow RpcClient to retry initial transaction confirmation (#18311)
* Tidying: relocate function

* Use proper helper method for RpcClient commitment

* Add RpcClientConfig

* Add configurable confirm_transaction_initial_timeout

* Use default 5s timeout for initial tx confirmation
2021-06-30 01:08:45 +00:00
Alexander Meißner 6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
carllin ccc013e134
Handle removing slots during account scans (#17471) 2021-06-14 21:04:01 -07:00