Commit Graph

1086 Commits

Author SHA1 Message Date
mergify[bot] ea019b8be5
v2.1: cli: show max vote credits in vote-account based on TVC activation epoch (backport of #3776) (#3780)
cli: show max vote credits in vote-account based on TVC activation epoch (#3776)

(cherry picked from commit b543f25b4df91f0622614fb369fb9f1ec088443a)

Co-authored-by: Ashwin Sekar <ashwin@anza.xyz>
2024-12-04 11:44:49 -05:00
mergify[bot] 285e2e8466
v2.1: Revert "remove test-only bool arg from calculate_fee (#3211)" (backport of #3367) (#3373)
Revert "remove test-only bool arg from calculate_fee (#3211)" (#3367)

This reverts commit aad0381e10.

(cherry picked from commit cec2324188166be17b1ffdc2b6538386a6a010e1)

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2024-10-29 19:32:21 -05:00
zilayo 10bebfaf42
fix: fix shell generation panic due to unnecessary 'conflicts_with' (#2934) 2024-10-25 20:06:22 -07:00
Andrew Fitzgerald aad0381e10
remove test-only bool arg from calculate_fee (#3211) 2024-10-25 05:23:40 -05:00
Jon C 42122042d0
cli: Simulate for compute units in `validator-info publish` (#3164)
#### Problem

Similar to the other PRs like #2710, we should simulate transactions to
find out the CUs consumed before sending them out.

#### Summary of changes

Similar to #2710, use `Simulated` compute units and perform the
simulation before sending out the transaction. Also, add a test.
2024-10-16 18:45:10 +02:00
sakridge 50d13d1388
refactor cli-output large functions and add starting epoch for rewards (#3085)
* refactor cli-output large functions

* solana CLI: Add starting reward epoch option
2024-10-08 12:12:06 +02:00
Jon C 43cc2dd434
cli: Use simulated compute units in vote interactions (#2696)
* cli: Add simulated compute units to vote interactions

#### Problem

The CLI can simulate to get the compute budget used by a transaction,
but vote interactions are still using the default compute unit limit.

#### Summary of changes

Add tests for setting a compute unit price with `test_case`, and then
change the compute unit limit to `Simulated`.

* Use simulated compute units

* Fix rebase issues
2024-09-24 11:07:46 +02:00
Jon C 18d0428e3a
cli: Use simulated compute unit limit in stake interactions (#2710)
* cli: Use simulated compute unit limit in stake interactions

#### Problem

The CLI has the ability to simulate transactions before sending to use
the correct number of compute units, but stake commands are still using
the default compute unit limit.

#### Summary of changes

Update tests to use a compute unit limit, and then update the stake
commands to use the simulated compute unit limit.

* Simulate for compute units in stake commands

* Pass compute unit limit enum to `simulate_and_update...`
2024-09-23 23:16:37 +02:00
Brooks 1184bc8c9a
clippy: Fixes blocks_in_conditions warning (#2900) 2024-09-11 14:07:37 -04:00
Kevin Heavey 8116c10021
Extract feature-set crate (#2172)
* extract feature-set crate

* update feature_set dependents

* re-export with deprecation notice

* fix path after rebase

* fmt

* fmt after rebase

* fixes after rebase

* unused import

* fix import

* unused import

* post-rebase fixes

* fix path

* missing frozen-abi support

* update lock file

* use workspace lints

* fix paths

* fix import

* remove unused import

* remove unused deps

* consolidate imports

* add back dep (not unused after all)
2024-09-10 19:27:20 +02:00
Alexander Meißner f6b77526f1
Adjustments of loader-v4 (part 2) (#2750)
* Splits transfer authority and finalize into two instructions.

* Adds next-version-forwarding to finalization.

* Makes loader-v4 a program runtime v1 loader.
2024-08-29 15:46:29 +02:00
Jon C 164d37c526
cli: Use simulated compute units in ping (#2693)
* cli: Use simulated compute units in ping

#### Problem

The CLI has the ability to simulate transactions before sending to use
the correct number of compute units, but `solana ping` is still using
the default compute unit limit.

#### Summary of changes

Simulate once to get the compute unit limit and then re-use the
simulated number for every ping.

* Refactor per review

* Only get compute unit limit if simulation needed, add test
2024-08-27 11:28:55 +02:00
Jon C ae6285ffbf
cli: Use simulated compute units in nonce interactions (#2695)
* cli: Use simulated compute unit limit for nonces

#### Problem

The CLI can simulate to get the compute budget used by a transaction,
but nonce interactions are still using the default compute unit limit.

#### Summary of changes

Refactor the tests into `test_case`s, add tests for setting a compute
unit price, and then change compute unit limit to `Simulated`.

* Add compute unit price test case

* Change to using simulated compute units everywhere

* Run simulations where it isn't done normally

* Fix clippy issues
2024-08-26 13:19:30 +02:00
Jon C 93341c6682
cli: Use a better amount during transaction simulation (#2709)
* cli: Use a better amount during transaction simulation

#### Problem

There are issues with the current strategy of simulating a test
transaction in the `resolve_spend_message`. If the transaction is
creating an account, the test transaction will fail because not enough
lamports are sent to the destination.

#### Summary of changes

It's a tricky situation in which we can't always be correct, since
there's a chicken-and-egg situation with calculating the fee for spend
variants of `All` and `RentExempt` if the sender and the fee payer are
the same account.

To get the simulation correct in almost all situations, we simulate with
the real transfer amount. But if the fee payer is the sender, we
simulate with `0`. But we also add a new variant on `SpendAmount` to
cover some minimum amount required that must be transferred. Currently,
the only situations in which we have an issue are:

* creating a nonce account
* creating a stake account
* transferring SOL

Those first two have a minimum requirement, so use that. The third works
fine with a 0 amount, since it's just a SOL transfer.

* Address feedback
2024-08-23 14:19:25 +02:00
Jon C 0da63a3972
cli: Simulate for compute units consumed during transfer (#1923)
* cli: Plumb down `ComputeUnitLimit` to resolve tx

* Use simulated compute units in transaction

* wallet: Use simulated compute units for non-nonce transactions

* Modify transfer test
2024-08-22 11:47:25 +02:00
Justin Starry 9db1d9c58e
clean up uses of activated `vote_state_add_vote_latency` feature (#2469)
clean up uses of activated vote_state_add_vote_latency feature
2024-08-08 01:13:50 +08:00
Tao Zhu c7192d37a6
refactor: move process_compute_budget_instructions to reduce dependency (#2392)
refactor: move process_compute_budget_instructions from solana_compute_budget to solana_runtime_transaction, to break circular dependencies. Issue #2169
2024-08-01 17:54:03 -05:00
Jon C 576fa44523
stake: Remove redelegate instruction (#2213)
* stake: Remove redelegate code and tests

* Mark stake flags as deprecated

* Remove usage of feature gate

* Add a changelog entry for the removal

* Remove repeated #[allow(deprecated)]s

* Re-add "redelegate-stake" command

* Remove feature

* Make CI happy -> `hidden_unless_forced()`
2024-07-29 18:27:58 +02:00
Ivan 7be36fb4a3
Make clap optional for libraries (#2090)
* Move binaries from solana-net-utils to examples

* Put clap under feature (rpc-client-nonce-utils)

* Disable clap by default for `solana-rpc-client-nonce-utils`

* Apply suggestions

* Add separate features for each binary dependency for net-utils

* Put all dependencies for binaries under clap feature

* `./scripts/cargo-for-all-lock-files.sh tree`

* Sort rpc-client-nonce-utils dependencies

* Fix banking-bench
2024-07-24 16:28:29 -05:00
Kevin Heavey 31012e3790
Extract decode-error from solana-program (#1813)
* extract decode-error crate

* update decode_error dependents and re-export in sdk and program

* fmt

* fix bad import after rebase
2024-07-17 14:11:36 +00:00
Kevin Heavey 0b6f4a0d4d
replace solana-client with its constituent parts where possible (#2086) 2024-07-16 11:25:13 -06:00
Kevin Heavey 0fa8da419e
Remove some unused deps (#1929)
* move deps to dev-dependencies where possible

* remove unused deps

* put solana-program behind target.'cfg(target_os = "solana")' in curve25519

* update lock files
2024-07-11 10:16:16 +02:00
hana fa43d4bc7f
solana-program: `StakeHistorySyscall` and `get_entry` (#1404) 2024-06-30 00:32:42 -07:00
Tyera 114041c46a
Deprecate RpcClient::get_stake_activation (#1895)
* Deprecate RpcClient::get_stake_activation

* Fixup redelegation test
2024-06-28 19:11:52 -06:00
Tyera 51af772e63
Remove deprecated RpcClient methods (#1899)
* Remove deprecated RpcClient methods corresponding to #1809

* Remove internal handling for pre-v1.9.0 servers

* Remove unused import of deprecated_config module

* Remove request mapping (pre-v1.7.0)

* Remove dangling allow-deprecated tag

* Add line to changelog

* Remove deprecated RpcRequest variants

* Remove reprecated rpc-client-nonce-utils methods

* Remove deprecated TestValidator method

* Remove deprecated solana fees command
2024-06-28 16:35:08 -06:00
Jon C 0acaece546
cli: Use `WithComputeUnitConfig` for compute unit limit (#1810)
* cli: Add `ComputeUnitConfig` and use it, no functional changes

* Use Option<u64> directly instead of ref

* Correct default compute unit limit comment
2024-06-24 18:06:20 +02:00
Lucas Ste 437a6b1c92
Verify elf locally for write buffer cli command (#1794)
Verify elf locally for write buffer command
2024-06-21 15:31:32 -03:00
Lucas Ste 8b8ddcbb84
Verify elf with active feature set before attempting deployment (#1654)
Co-authored-by: Jon C <me@jonc.dev>
2024-06-17 18:25:25 -03:00
galactus a6b2283142
ScanConfig defaults no longer sort results (#1539) 2024-06-14 08:27:33 -04:00
ryleung-solana ed500b5afc
Solana ping tpu client (#923)
Add support for using the TPU client in solana-ping to better isolate the effect of the transport layer on ping performance.
2024-06-05 03:55:08 +00:00
Joe C 62eb4cc068
Add Compute Budget Crate (#1121) 2024-06-01 01:38:19 -05:00
Yihau Chen f2f1a22ccc
chore: remove unused clippy attributes, unnecessary_wraps (#1514)
remove clippy unnecessary_wraps
2024-05-29 11:09:29 +00:00
Yihau Chen a5fa713a59
chore: remove unused clippy attributes, redundant_closure (#1513)
remove clippy redundant_closure
2024-05-29 11:07:47 +00:00
Jon C 4f6dd3d91a
rpc-client: Print transaction logs in preflight error (#1387)
* rpc-client: Print transaction logs in preflight error

* Address feedback

* Update expected error message in program deploy test

* Use a semicolon before the data
2024-05-17 00:20:41 +00:00
Yihau Chen ec9bd79849
clippy: fix legacy_numeric_constants (#1314)
clippy: legacy_numeric_constants
2024-05-15 11:29:19 +08:00
Illia Bobyr ca6fc5135e
cli::cluster_query: Remove `allow(clippy::arithmetic_side_effects)` (#1167) 2024-05-10 13:04:33 -07:00
Justin Starry d8dd61d0fc
refactor: split cli fn `do_process_program_write_and_deploy` into two functions (#1249) 2024-05-09 09:31:28 +08:00
Justin Starry bfd16fa36b
refactor: remove unused partial init from cli deploy (#1149)
* refactor: remove unused partial init from cli deploy

* feedback
2024-05-08 18:44:37 +08:00
Illia Bobyr 8f694bacd2
cli::program: Remove `allow(clippy::arithmetic_side_effects)` (#1168) 2024-05-07 13:02:51 -07:00
Illia Bobyr c5aea86b10
cli: program: Extract `auto_extend` logic into a function (#1164)
`do_process_program_upgrade()` is already huge.  It is better to put
sufficiently self-contained chunks of logic into individual functions.

Also, restructured the "staircase" pattern using early exits.  It seems
to be more readable this way.
2024-05-06 21:34:08 -07:00
Emil Kuban fa55053e7a
Fix: solana stakes <pubkey> clean handling (#797)
* Fix: solana stakes <pubkey> clean handling

* multiple rpc call to single call

* multiple rpc call to single call

* review fixes

* review fixes
2024-05-06 20:31:43 +00:00
Illia Bobyr 18221c0e29
cli::tests: program: Clarify all `unwrap_err()`. (#1166)
`unwrap_err()` does not contain a descriptive message for the case when
it succeeds.  It may help someone debugging the test, in particular they
will see a short explanation without looking at the failed test.

Also, in a number of cases, `unwrap_err()` result was not checked,
creating a possibility for false positives.  As the generated error
might be different from the one expected by the test author.
2024-05-03 14:55:41 -07:00
Illia Bobyr 448d0ab00b
cli/tests: program_extend_program: Check for a specific error (#1165)
There are many errors that could be generated, creating a possibility for false
positives.  We actually observed it in this test.
2024-05-03 10:39:08 -07:00
Brooks fbbae8a59a
clippy: clone_from() (#1177)
```
error: assigning the result of `Clone::clone()` may be inefficient
   --> bucket_map/src/bucket.rs:979:17
    |
979 |                 hashed = hashed_raw.clone();
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `hashed.clone_from(&hashed_raw)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
    = note: `-D clippy::assigning-clones` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::assigning_clones)]`
```
2024-05-03 15:21:10 +00:00
Illia Bobyr 7daa369344
cli::feature: Remove `allow(clippy::arithmetic_side_effects)` (#1040) 2024-05-02 22:42:58 -07:00
sakridge e2f361e9ec
Add get-recent-prioritization-fees command to cli (#805) 2024-04-30 17:56:08 +02:00
Tyera f255b31bdc
Cli: flip no_extend to auto_extend internally (#1119)
* Flip no_extend to auto_extend

* Apply suggestions from code review

Co-authored-by: Joe C <joecaulfield29@yahoo.com>

---------

Co-authored-by: Joe C <joecaulfield29@yahoo.com>
2024-04-30 07:06:34 +00:00
Tyera 680946c77a
Fix test_cli_program_extend_program (#1115)
* Unignore test

* Don't extend program accounts by default on test that expects them not to
2024-04-29 19:27:30 -06:00
Tyera 170f8ff08e
Ignore test_cli_program_extend_program (#1113) 2024-04-29 16:59:32 -06:00
Nagaprasad V R 23905c08b8
CLI: Auto-extend program accounts by default (#791)
* add checks for program data account overflow during upgrade and add --auto-extend-program flag to solana program deploy command

* remove logs

* cleanup tests

* automatically extend program data account and add a --no-auto-extend-program falg

* change comments in do_process_program_upgrade

* simplify  comments in do_process_program_upgrade

* resolve comments

* cleanup

* change error messages

* resolve comments

* Fix after rebase

* Fix after rebase

* fix cargo clippy

* cli: add tests for auto-extend

---------

Co-authored-by: Joe Caulfield <joe.caulfield@anza.xyz>
2024-04-24 06:51:23 +00:00