Commit Graph

502 Commits

Author SHA1 Message Date
GroovieGermanikus df46c3f598
RPC: allow IPv6 binding 2024-12-05 23:28:31 +01:00
GroovieGermanikus 83752afe17
RPC: add method getProgramAccountsCompressed 2024-12-05 23:28:23 +01:00
mergify[bot] f111b36b2d
v2.0: Simplify RPC partitioned_epoch_reward_enabled determination (backport of #2802) (#2823)
Simplify RPC partitioned_epoch_reward_enabled determination (#2802)

* Check num_reward_partitions for partitioned_epoch_reward_enabled

* Make expect slightly more correct

* Better variable name

(cherry picked from commit 22b823c1c0)

Co-authored-by: Tyera <tyera@anza.xyz>
2024-09-03 22:47:36 -06:00
mergify[bot] a829deae22
v2.0: SIMD-0118: fix `total_rewards` for recalculation (backport of #2780) (#2794)
* SIMD-0118: fix `total_rewards` for recalculation (#2780)

* Add new feature key

* Wrap existing code with new feature

* Extend test harness

* Make test fail

* Populate EpochRewards::total_rewards from PointValue

* Remove superfluous struct field

* Fixup tests

(cherry picked from commit 4470f6d96e)

# Conflicts:
#	programs/bpf_loader/src/syscalls/mod.rs
#	sdk/src/feature_set.rs

* Fix conflicts

---------

Co-authored-by: Tyera <tyera@anza.xyz>
2024-09-03 10:31:12 -06:00
mergify[bot] 3e7563cdad
v2.0: RPC: rewards, return error if epoch_boundary_block is a lie (backport of #2758) (#2767)
RPC: rewards, return error if epoch_boundary_block is a lie (#2758)

* Return error if epoch_boundary_block is not actually the epoch boundary block

* Update rpc-client-api/src/custom_error.rs

Co-authored-by: Trent Nelson <490004+t-nelson@users.noreply.github.com>

---------

Co-authored-by: Trent Nelson <490004+t-nelson@users.noreply.github.com>
(cherry picked from commit 9a4b094ded)

Co-authored-by: Tyera <tyera@anza.xyz>
2024-08-30 12:47:29 -06:00
mergify[bot] b57b883355
v2.0: Fix BankForks::new_rw_arc memory leak (backport of #1893) (#2066)
* Fix BankForks::new_rw_arc memory leak (#1893)

(cherry picked from commit d441c0f577)

* Fix flaky test test_banking_stage_entries_only_central_scheduler (#2082)

---------

Co-authored-by: Andrei Silviu Dragnea <andreisilviudragnea@gmail.com>
Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2024-07-17 16:11:40 -07:00
mergify[bot] b5bc3b2381
v2.0: Remove deprecated Memcmp filter symbols (backport of #2050) (#2069)
Remove deprecated Memcmp filter symbols (#2050)

* Add test to demonstrate serialization and acceptable json inputs

* Remove custom serialization

* Unpub deprecated fields

* Remove deprecated, unused field

* Remove deprecated MemcmpEncodedBytes variant

* Remove deprecated error variants

* Add back custom deserialization to support missing 'encoding' field

* Update tests to demonstrate consistency and changes

* Add helper fns to use in rpc spl-token filter checks

* Update base64 syntax and remove allow-deprecated

(cherry picked from commit 3b3ffbb6c9)

Co-authored-by: Tyera <tyera@anza.xyz>
2024-07-10 07:20:45 +00:00
mergify[bot] f653d86e23
v2.0: Remove get_stake_activation methods from RpcClient (backport of #2036) (#2044)
Remove get_stake_activation methods from RpcClient (#2036)

* Remove dangling JsonRpcRequestProcessor method

* Remove get_stake_activation methods from RpcClient

* Remove getStakeActivation from mock_sender

* Remove unused rpc response type

(cherry picked from commit 30791818e0)

Co-authored-by: Tyera <tyera@anza.xyz>
2024-07-08 18:14:36 -06:00
mergify[bot] 3aee1eaf5e
v2.0: Remove deprecated CommitmentLevel variants (backport of #1903) (#1989)
Remove deprecated CommitmentLevel variants (#1903)

* Remove deprecated CommitmentLevel variants and CommitmentConfig methods

* Remove deprecated variants from BlockCommitmentCache usage

* Remove deprecated variants from rpc

* Remove maybe_map_commitment from RpcClient

(cherry picked from commit 2e3c2c78e9)

Co-authored-by: Tyera <tyera@anza.xyz>
2024-07-08 10:34:13 -06:00
mergify[bot] c5ac54bb28
v2.0: Remove rpc endpoint deprecated in v1.18 (backport of #1897) (#1926)
Remove rpc endpoint deprecated in v1.18 (#1897)

* Remove rpc_deprecated_v1_18

* Update changelog

* Fixup redelegation test

(cherry picked from commit 99b2d5ad60)

Co-authored-by: Tyera <tyera@anza.xyz>
2024-07-01 12:36:42 -06:00
mergify[bot] 4d1256af3b
v2.0: Remove support for deprecated rpc endpoints (backport of #1809) (#1886)
* Remove support for deprecated rpc endpoints (#1809)

* Remove rpc_obsolete_v1_7

* Remove rpc_deprecated_v1_7

* Remove rpc_deprecated_v1_9

* Add CHANGELOG entry

* Add another CHANGELOG entry

(cherry picked from commit 83527d9577)

# Conflicts:
#	CHANGELOG.md

* Fix conflict

---------

Co-authored-by: Tyera <tyera@anza.xyz>
2024-06-27 13:51:48 -06:00
mergify[bot] d40aa491a5
v2.0: Use num_partitions to find specific stake rewards in partitions (backport of #1677) (#1881)
Use num_partitions to find specific stake rewards in partitions (#1677)

* Add helper to find and filter rewards from a slot

* Check feature enabled for desired epoch

* Refactor existing rewards code to support vote-rewards after activation

* Append stake rewards from partitions

* Remove feature deactivation from TestValidator

* Improve comments

* Add comment about retaining feature activation slot logic

* Add custom error and use in getInflationReward

* Review nit

(cherry picked from commit 0496b06f89)

Co-authored-by: Tyera <tyera@anza.xyz>
2024-06-26 19:54:52 -06:00
Justin Starry 8da4062644
refactor: consolidate fee deduction for failed transactions (#1636) 2024-06-20 08:03:40 -07:00
Kirill Fomichev dbea20b12a
rpc: add more services to getClusterNodes (#1637)
* rpc: add tpu_forwards/tpu_forwards_quic to getClusterNodes

* add tvu

* order

* add tpu_vote

* add serve_repair

* fix tests

* fix name in tests

* remove tvu / repair quic
2024-06-14 12:19:15 -06:00
galactus a6b2283142
ScanConfig defaults no longer sort results (#1539) 2024-06-14 08:27:33 -04:00
Kevin Heavey 7e0688341e
remove superfluous usage of allow(dead_code) (#1669) 2024-06-13 22:52:49 +08:00
Jon C e0dc5dc707
rpc: Include interest-bearing configuration for UI amount calculation (#1549)
* Plumb new SplTokenAdditionalData everywhere

* account-decoder: Calculate ui amount with interest

* rpc / ledger: Populate interest bearing information

* rpc: Test interest-bearing config

* Deprecate `parse_token` for `parse_token_v2`

* Deprecate parse_account_data and AccountAdditionalData for v2

* Deprecate token_amount_to_ui_amount -> v2

* Make get_mint_owner_and_additional_data pub(crate)

* ledger: Revert changes, always use raw amount
2024-06-06 18:17:51 +02:00
Steven Luscher 4b236e9052
fix: `encode_account()` no longer throws when a slice shortens data enough to be base58 encoded (#1494) 2024-06-04 11:13:40 -07:00
Justin Starry 2cc540a7de
refactor: reuse calculated fees (#1462)
* refactor: reuse calculated fees

* fix tests

* feedback

* fix test

* fix unused warn
2024-05-29 19:41:47 +00:00
galactus 10a09cd30d
Adding a variable sort_results to Rpc config while doing getProgramAccounts (#629) 2024-05-28 08:59:12 -04:00
steviez 9fc8d17fa0
Remove redundant inc_new_counter's in RpcSubscriptions (#1414)
The above datapoint "rpc_subscriptions" reports the same values, and in
general, counters have non-trivial overhead that is hidden within the
macro definition.
2024-05-21 15:44:36 -05:00
Yihau Chen ec9bd79849
clippy: fix legacy_numeric_constants (#1314)
clippy: legacy_numeric_constants
2024-05-15 11:29:19 +08:00
Yihau Chen b42d8f68a4
clippy: allow dead_code for GraphVoteAccountModeError, DroppableTask and SubscriptionToken (#1246)
* clippy: allow dead_code for SubscriptionToken

* clippy: allow dead_code for GraphVoteAccountModeError

* clippy: allow dead_code for DroppableTask

* remove the string in the GraphVoteAccountModeError

* abort the joinhandle when drop

* only trace JoinHandle in the drop

* add comment
2024-05-13 10:45:37 +08:00
Justin Starry 59c7c287d0
refactor: `NonceFull::from_partial` (#1216) 2024-05-11 04:10:19 +08:00
dmakarov b284eb0402
SVM: Move nonce_info from SDK to SVM (#1228)
because it's not something we want to be subjected to the backwards compatibility policy.
2024-05-07 21:27:42 -04:00
Kevin Heavey 61a6f367ba
remove token-2022 dep from rpc-client-api (#941)
* move RpcFilterType::allows to solana-rpc as `filter_allows`

* update imports

* restore and deprecate allows() method

* use Account::valid_account_data from solana_inline_spl

* remove old import

* fix: use inline token_2022

* fix inline_spl import

* fix: another place where inline token_2022 is needed
2024-05-01 17:22:01 +00:00
behzad nouri 5b9b1ca81d
obtains node's client version from the new contact-info (#1128)
The new contact-info embeds client version and can be used directly to
lookup the client version.
2024-04-30 22:56:21 +00:00
Jon C 196626dfcf
rpc: Return accurate last valid block height (#1034)
* blockhash-queue: Deprecate `is_hash_valid`

* blockhash-queue: Deprecate `get_max_age`

* bank: Add a test

* rpc: Fix tests, and limit nonce retries to MAX_PROCESSING_AGE
2024-04-26 13:01:53 +02:00
Jon C b36eec5ab8
spl: Upgrade to newest library versions (#994)
* spl: Upgrade to newest versions

* Patch more crates
2024-04-24 18:48:58 +02:00
Justin Starry 09241ae9c3
Use reserved account keys list to restrict tx write locks (#541)
* Plumb through reserved account keys set

* Plumb through tests
2024-04-13 09:37:58 +08:00
Justin Starry c4996d6e52
Remove stale poh recorder validator id (#700) 2024-04-12 12:09:02 +08:00
carllin d5c291a934
Remove send snapshot hard unwrap (#326) 2024-04-11 12:18:52 -04:00
Sammy Harris c207274e11
feat: include replaced blockhash in RPC simulation response (#380)
* feat: include replaced blockhash in RPC simulation response

* rename blockhash field to `replacement_blockhash`

* add tests to ensure replacement_blockhash is returning correctly

* fixed tests

* fixed tests again for real this time?
2024-04-06 17:27:10 +08:00
Tyera 65a24d5140
RPC sendTransaction: be more liberal in determining and setting last_valid_block_height for skip_preflight case (#483)
* RPC sendTransaction: if skip_preflight, use processed-commitment Bank for last_valid_block_height and sanitization

* Use nonce retry logic for skip_preflight transactions if blockhash was not found
2024-04-03 11:48:04 -06:00
sakridge e0e659680a
Remove duplicated token ids and use a shared inline-spl crate (#456) 2024-04-01 14:31:04 +02:00
Brooks 24fe473b46
clippy: Automated fixes for Rust 1.77.0 (#390) 2024-03-22 13:48:46 -04:00
Jon C 261b3e9ee7
CI: Add windows clippy job and fix clippy errors (#330)
* CI: Run clippy on windows

* Update cargo-clippy-before-script.sh for Windows

* Pacify clippy
2024-03-20 13:21:00 +01:00
Kirill Fomichev 7c007ea737
rpc: disable BigTable with header (#226)
* rpc: disable BigTable with header

* use is_some_and instead map+unwrap_or

Co-authored-by: Tyera <tyera@anza.xyz>

---------

Co-authored-by: Tyera <tyera@anza.xyz>
2024-03-13 17:46:48 -06:00
steviez f8bb98b5f4
Move default value for --rpc-pubsub-notification-threads to CLI (#158)
The default value was previously being determined down where the thread
pool is being created. Providing a default value at the CLI level is
consistent with other args, and gives an operator better visibility into
what the default will actually be
2024-03-12 16:11:44 -05:00
Tyera 9e9aa05b33
Rpc: add support for minimum context slot to `getBlocks(WithLimit)` endpoints (#191)
* Support min_context_slot field in getBlocksWithLimit input

* Use min_context_slot in get_blocks_with_limit

* Support min_context_slot field in getBlocks input

* Use min_context_slot in get_blocks
2024-03-11 23:59:18 -06:00
Tyera 661de5bb76
Rpc: deprecate `getStakeActivation` and make inactive_stake consistent (#69)
* Make inactive_stake consistent

* Add rpc_deprecated_v1_18 module

* Move get_stake_activation to deprecated list

* Fix typo
2024-03-04 19:21:30 -07:00
Yihau Chen 3f9a7a52ea [anza migration] rename crates (#10)
* rename geyser-plugin-interface

* rename cargo registry

* rename watchtower

* rename ledger tool

* rename validator

* rename install

* rename geyser plugin interface when patch
2024-03-03 12:31:24 +08:00
Justin Starry 312f786abf
Rename `SanitizedMessage::try_from` to `try_from_legacy_message` (#35338)
* Simplify and refactor tx message creation in tests

* Rename SanitizedMessage::try_from to try_from_legacy_message
2024-02-29 08:25:22 +08:00
steviez 94698b8dd0
Name PubSubService tokio threads (#35331)
Also add logs for service starting/stopping
2024-02-27 14:59:07 -06:00
Kirill Fomichev 8ad125d0c0
rpc: optimize `getTokenLargestAccounts` (#35315)
* rpc: optimize `getTokenLargestAccounts`

* use tuple instead of struct

* untuple

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

---------

Co-authored-by: Tyera <teulberg@gmail.com>
2024-02-27 00:08:29 -07:00
Brooks 6d15487183
rpc: Parse largest token accounts after sorting & truncating (#35264) 2024-02-20 19:29:14 -05:00
Brooks f122e99c4e
rpc: Faster sorting for get_token_largest_accounts() (#35263) 2024-02-20 17:55:45 -05:00
Dmitri Makarov 0acee67891
SVM: move transaction_results from accounts-db to SVM (#35183)
SVM: Remove accounts-db deps in accounts_loader tests
2024-02-20 12:54:56 -08:00
Dmitri Makarov eeb0cf1ea8
SVM: Move nonce_info from accounts-db to Solana SDK (#35138) 2024-02-08 15:01:15 -05:00
Dmitri Makarov b9ee3b475b
SVM: Move RentDebits from accounts-db to Solana SDK (#35135) 2024-02-07 15:10:17 -08:00