Commit Graph

179 Commits

Author SHA1 Message Date
Alexander Meißner ee2c2ef6c7
Cleanup - require_static_program_ids_in_transaction (#31767)
require_static_program_ids_in_transaction
2023-06-07 17:12:41 +02: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
behzad nouri 9281ab7d97
separates out connection-cache metrics for different protocols (#31803) 2023-05-25 14:48:22 +00:00
Ashwin Sekar 3e8f5bad81
refactor: highest_cluster_confirmed_root -> highest_super_majority_root (#31619) 2023-05-14 00:42:03 -07:00
behzad nouri 4e34abbf3d
specifies protocol in contact-info get-socket api (#31602) 2023-05-12 16:16:20 +00:00
Illia Bobyr 43c0f05ca0
Bumps base64 from 0.13.1 to 0.21.0. (#31522)
Changes:

  marshallpierce/rust-base64@v0.13.1...v0.21.0

`base64::{encode,decode}` are now deprecated in favor of an API that
explicitly selects an `Engine`.  Migrated all calls to the new API.
2023-05-11 11:34:58 -07: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
Lijun Wang 7cf50e60fc
Fixed missing Root notifications via geyser plugin framework (#31180)
* Fixed missing Root notifications via geyser plugin framework

* Renamed a variable

* fmt issue

* Do not try the loop if no subscribers.

* Addressing some feedback -- passing parent roots from replay_stage to avoid race conditions

* clippy issue

* Address some reviewing findings

* Addressed some feedback from Carl

* fix a clippy issue

* Added comments on optimistically_confirmed_bank_tracker module to explain the workflow

* Addressed Trent's review
2023-05-03 18:50:00 +08: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
behzad nouri 1b08d01a80
removes shred_version from LegacyContactInfo public interface (#31304)
Working towards LegacyContactInfo => ContactInfo migration, the commit
adds more api parity between the two.
2023-04-24 15:19:33 +00:00
behzad nouri 33bde55bbd
adds tpu_quic field to RpcContactInfo (#31310) 2023-04-22 20:18:58 +00:00
behzad nouri cb65a785bc
makes sockets in LegacyContactInfo private (#31248)
Working towards LegacyContactInfo => ContactInfo migration, the commit
hides some implementation details of LegacyContactInfo and expands API
parity with the new ContactInfo.
2023-04-21 15:39:16 +00:00
Tyera 03c1744e1d
Register SendTransactionService exit (#31261)
* Pass exit into SendTransactionService

* Abort SendTransactionService with BanksService

* Register SendTransactionService exit as part of RpcService validator Exit

* Improve test, ensure receiver has been dropped
2023-04-20 18:23:14 -06:00
Trent Nelson f34a6bcfce
runtime: transpose `VoteAccount::vote_state()` return to improve ergonomics (#31256) 2023-04-18 14:48:52 -06:00
Andrew Fitzgerald f226a34f48
Only need bank reference for update (#30879) 2023-03-24 09:48:04 -07:00
Tao Zhu 3e500d9e92
Feature gate builtin consumes static units during processing instruction (#30702)
* add feature gate
* builtins consume statically defined units at beginning of process_instruction()
* Add new instructionError; return error if builtin did not consume units to enforce builtin to consume units;
* updated related tests
* updated ProgramTest with deactivated native_programs_consume_cu feature to continue support existing mock/test programs that do not consume units
2023-03-24 11:31:01 -05:00
Tyera b389d509a8
Track max_complete_rewards_slot for use in rpc, bigtable (#30698)
* Add RewardsMessage enum

* Cache and update max_complete_rewards_slot

* Plumb max_complete_rewards_slot into JsonRpcRequestProcesseor

* Use max_complete_rewards_slot to check get_block requests

* Use max_complete_rewards_slot to limit Bigtable uploads

* Plumb max_complete_rewards_slot into RpcSubscriptions

* Use max_complete_rewards_slot to limit block subscriptions

* Nit: fix test
2023-03-14 12:08:48 -06:00
samkim-crypto 4a94eeee5e
Upgrade to token-2022 0.6.0 (#30353)
* upgrade spl-token-2022 to 0.6.0

* Add spl_token_2022-0.6.0.so to program-test

* cargo lock

* update account decoder tests to use Pubkey::new_from_array instead of Pubkey::new

* update rpc tests to use Pubkey::new_from_array instead of Pubkey::new

* update token-2022 .so file

* cargo lock

* increase the threshold for allowable rebuilds in ci

* update spl ATA to v1.1.3

* decrement back the threshold for allowable rebuilds

* cargo lock

* increment ci rebuild threshold
2023-03-10 10:32:19 +09: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
Kevin Ji cd51499ab9
Use Ipv4Addr constants in socketaddr! (#30095) 2023-02-02 16:48:21 -07:00
behzad nouri ffc9c90cb4
expands api parity between the new and the legacy contact-info (#30038)
Working towards replacing the legacy contact-info with the new one, the
commit expands api compatibility between the two.
2023-02-01 13:07:42 +00:00
Tyera e39153df51
Add Memcmp filter constructor and deprecate fields (#29923)
* Deprecate Memcmp inner fields

* Add Memcmp::new

* Replace some literal construction

* Add convert_to_raw_bytes method and use

* Make convert_to_raw_bytes fallible

* Allow literal matches for complex cases
2023-01-26 14:50:15 -07:00
behzad nouri 1c7662a37f
asserts that cluster-info keypair is consistent with contact-info id (#29818) 2023-01-24 16:57:55 +00:00
behzad nouri 272e667cb2
deprecates Pubkey::new in favor of Pubkey::{,try_}from (#29805)
The commit deprecates Pubkey::new which lacks type-safety and instead
implements TryFrom<&[u8]> and TryFrom<Vec<u8>> for Pubkey.
2023-01-21 18:06:27 +00:00
Trent Nelson c4e43f1de4
vote: encapsulate `Lockout` (#29753) 2023-01-18 19:28:28 -07:00
Illia Bobyr 6e4ecc6758
RPC getPerformanceSamples: Add `numNonVoteTransaction` (#29388)
Allow interested parties to see both total and non-vote transaction
counts in each performance sample.

Fixes https://github.com/solana-labs/solana/issues/29159
2023-01-18 00:22:47 -08:00
Illia Bobyr 59fde130d6
ledger/blockstore: PerfSampleV2: num_non_vote_transactions (#29404)
Store non-vote transaction counts that are now recorded by the banks
into the `blockstore`.

`SamplePerformanceService` now populates `PerfSampleV2` with counts from
the banks.
2023-01-12 19:14:04 -08:00
Pires 8db1f53fe7
Add pubsub address to RpcContactInfo (#29165)
* rpc: add pubsub address to RpcContactInfo

* cli: add pubsub endpoint to gossip node info

* dashboard: add pubsub endpoint

* add missing pubsub info test_rpc_get_cluster_nodes
2023-01-08 22:25:56 -07:00
behzad nouri 8c212f59ad
renames ContactInfo to LegacyContactInfo (#29566)
Working towards adding a new ContactInfo where new sockets can be
added in a backward compatible way.
2023-01-08 16:00:55 +00:00
Jeff Washington (jwash) 2f0d849c84
set rent epoch to max on new account creation (#29528)
* set rent epoch to max on new account creation

* add comment
2023-01-06 14:21:10 -08:00
Tyera c8dd5bbd48
Move getSecondaryIndexKeySize RPC to admin_rpc_service (#29003)
* Move getSecondaryIndexKeySize to admin_rpc_service

* Add AdminRpc test framework

* Move test to admin_rpc_service

* Update test

* Remove full-api infra
2022-12-19 19:54:05 -07:00
Kirill Fomichev ccd96e246b
rpc: fix possible panics in optimize_filters (#29146) 2022-12-15 20:04:41 +00:00
Jeff Washington (jwash) a3c95eaa53
remove BankTestConfig.caching_enabled (#29173) 2022-12-09 11:52:36 -08:00
behzad nouri 9524c9dbff patches errors from clippy::uninlined_format_args
https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
2022-12-06 19:32:15 +00:00
Tyera fd13323f4b
Split rpc_accounts api to identify calls that scan accountsDB (#28968)
* Update stale comment

* Collect RPC endpoints that perform accounts scans
2022-11-29 10:08:19 -07:00
Jeff Washington (jwash) f22104d46b
use write cache by default in some tests (#28876) 2022-11-18 14:35:52 -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
K-anon e8c8235474
Get Index Key Size RPC Support (#28383)
Co-authored-by: K-anon <IntokuSatori@users.noreply.github.com>
2022-11-16 20:39:11 -07:00
Tyera Eulberg b18ef88c40
Fix client get_program_accounts_with_config calls with context (#28772)
* Move OptionalContext to solana-rpc-client-api

* Add helper function

* Add failing test

* Support OptionalContext in RpcClient::get_program_accounts_with_config
2022-11-16 14:35:35 -07:00
Brooks Prumo d1ba42180d
clippy for rust 1.65.0 (#28765) 2022-11-09 19:39:38 +00:00
Justin Starry 322280c5b7
RPC: Improve error messages for decoding errors (#28530) 2022-10-24 19:19:34 +08:00
kirill lykov 6c85778bf1
fix get_multiple_accounts test (#28473) 2022-10-19 10:25:50 -06:00
Justin Starry 58e27d45dc
RPC: respect data slice config if account parsing fails (#28387)
* RPC: respect data slice config if account parsing fails

* Remove check_slice_and_encoding method
2022-10-19 16:49:12 +08:00
Justin Starry 438d96e499
RPC: Return the data length for get account requests (#28421) 2022-10-18 01:56:04 +08:00
Justin Starry db37d6b2ec
RPC: Improve unsupported transaction error message (#28249) 2022-10-06 17:12:56 +08:00
Justin Starry ddf95c181c
RPC: Support versioned txs in getFeeForMessage API (#28217)
* RPC: Support versioned txs in getFeeForMessage API

* Update sdk/program/src/message/sanitized.rs

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

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-10-05 00:00:34 +08:00
Michael Vines df5f9f698f Surface the getVoteAccounts.epochCredits max-length constant in rpc-client-api 2022-09-26 21:58:19 -07:00
behzad nouri 97c9af4c6b plumbs through flag to generate merkle variant of shreds 2022-09-23 16:45:18 +00:00
Tyera Eulberg 9b8bed86f9
Add getRecentPrioritizationFees RPC endpoint (#27278)
* Plumb priority_fee_cache into rpc

* Add PrioritizationFeeCache api

* Add getRecentPrioritizationFees rpc endpoint

* Use MAX_TX_ACCOUNT_LOCKS to limit input keys

* Remove unused cache apis

* Map fee data by slot, and make rpc account inputs optional

* Add priority_fee_cache to rpc test framework, and add test

* Add endpoint to jsonrpc docs

* Update docs/src/developing/clients/jsonrpc-api.md

* Update docs/src/developing/clients/jsonrpc-api.md
2022-09-01 23:12:12 +00:00
Tyera Eulberg b8b3d723da
Use new client crates (#27360)
* Update ancillary cli crates

* Update cli

* Update command-line tools

* Update rpc, etc

* Update client-test

* Update core, validator

* Update local-cluster
2022-08-24 10:47:02 -06:00