Commit Graph

187 Commits

Author SHA1 Message Date
mergify[bot] eaa3a811a3
v2.0: Deprecate RpcClient::get_stake_activation (backport of #1895) (#1925)
Deprecate RpcClient::get_stake_activation (#1895)

* Deprecate RpcClient::get_stake_activation

* Fixup redelegation test

(cherry picked from commit 114041c46a)

Co-authored-by: Tyera <tyera@anza.xyz>
2024-07-01 10:56:06 -06: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
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
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 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
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
Jon C 6d740b3675
cli: Add `--use-rpc` flag to program deploy and write-buffer (#928)
* cli: Add `--use-rpc` flag to program deploy and write-buffer

* Fix deploy command in transaction-dos

* Add CHANGELOG message
2024-04-23 13:27:47 +02:00
Justin Starry 0056c5481f
cli: add additional buffer validation checks for deploys (#877)
cli: add additional buffer validation checks
2024-04-19 21:34:43 +08:00
Jon C 97c56ac0e2
cli: Introduce `WithComputeUnitConfig` for specifying more than compute unit price (#850)
cli: Introduce `ComputeUnitConfig` for specifying more than price
2024-04-17 12:40:07 +02:00
Joe C caa18a528f
cli tests: correct program data account test check (#660) 2024-04-08 14:52:52 -05:00
Jon C 2643ae85c3
cli: Customize max sign attempts for deploy and write-buffer (#526)
* cli: Customize max sign attempts for deploy and write-buffer

* Update changelog

* Improve help message

* Fixup line break
2024-04-02 15:29:38 +02:00
Justin Starry 2ee606da4f
Add `--with-compute-unit-price` to cli program deploy commands (#364)
* add set compute units arg for program deploy

* update master changes

* remove duplicates

* fixes and tests

* remove extra lines

* feedback

* Use simulation to determine compute units consumed

* feedback

---------

Co-authored-by: NagaprasadVr <nagaprasadvr246@gmail.com>
2024-03-22 16:48:52 +00:00
HaoranYi 0f8f8cd970
Revert deprecate executable feature (#309)
* revert deprecate executable feature

* add native loader account transfer test

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-03-20 10:54:15 -05:00
nathan haim 60ccdb3fb4
cli: program set-upgrade-authority sign-only (#35203)
* cli: program set-upgrade-authority
Add --sign-only flag

* Apply suggestions from code review

This fixes nits.
It modifies tests: it will sign offline with `newAuthority` keypair instead of fee payer. Then it reuses the signature in the next command.

Co-authored-by: Jon C <me@jonc.dev>

* cli/tests/program: fix tests

* cli/src/program: delete unsed import

* fix to pass ci cargo-clippy-nightly

---------

Co-authored-by: Jon C <me@jonc.dev>
2024-02-22 02:07:00 +01:00
Tao Zhu acef7baab6
harden cli tests (#34844)
harden cli tests by setting up TestValidator correctly
2024-01-19 12:14:31 -06:00
Jon C 5cb30cf9cc
cli: Use program length for deployments instead of 2x length (#34730)
* cli: Deploy the appropriate length program

* Extend the extend-program test for new default

* Add CHANGELOG entry

* Update docs, and include `extend`

* Update CHANGELOG.md

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

---------

Co-authored-by: Tyera <teulberg@gmail.com>
2024-01-10 20:12:29 +00:00
HaoranYi 5a3a10e847
Deprecate account meta executable read/update in bpf loaders (#34194)
* use PROGRAM_OWNER + program data for account executable

mock account data with executable_meta in precompiled program and update
test_bank_hash_consistency test

pr: return const slice and add comments

pr: use ReadableAccount

use const to get rid of magic number

add featuregate disable_bpf_loader_instructions to disable bpf loader management instructions, and deprecate_executable_meta_update_in_bpf_loader to deprecate executable flag update in bpf loader

deprecate usage of executable in Account

fix a test

fix sbp bench

fix sbf program tests

add feature gate to account and borrowed account apis

fix tests

more test fixes

* restore bpf_loader v2 tests

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-01-03 15:11:48 -06:00
norwnd 0be3b6e3ba
cli: program upgrade with offline signing (--sign-only mode) (#33860)
* cli: program upgrade with offline signing (--sign-only mode)

* ditch universal NullSigner approach as overly complex

* rearrange some code to make it more coherent, fix typos

* apply clippy suggestions to simplify code

* review pass

* adjust brokens (due to rebase onto refactored structures) doc links

* fix linter complaint in doc formatting

* remove rebase artifacts

---------

Co-authored-by: norwnd <norwnd>
2023-12-14 15:21:17 +01:00
norwnd 8c6239ce85
cli: (program/buffer deploy) introduce --fee-payer argument (#34341)
* cli: (program/buffer deploy) introduce --fee-payer argument

* rename param in do_process_program_upgrade

* revert tricky changes to minimum_balance parameter

---------

Co-authored-by: norwnd <norwnd>
2023-12-07 22:47:50 +01:00
norwnd 8d7e63d420
cli: (program) enhance test_cli_program_set_buffer_authority (#34316)
* cli: (program) enhance test_cli_program_set_buffer_authority

* actually use buffer identity keys as buffer authority in tests(since it's a common real-world usage pattern)

---------

Co-authored-by: norwnd <norwnd>
2023-12-05 13:51:46 +01:00
Justin Starry 34f5c68416
cli: add solana program extend subcommand (#34043) 2023-11-16 09:52:41 +08:00
Jon Cinque fa968da32e
cli: Don't skip preflight when interacting with programs (#33426)
* cli: Don't skip preflight when closing a program

* Don't skip preflight anywhere for program deploys, fix test
2023-09-28 15:08:11 +02:00
Tyera bca41edf20
Make active stake consistent in split (#33295)
* Add feature gate

* Add helper fn

* Require split destination to be rent-exempt if it is active

* Update cli to prefund split accounts

* cli: require rent param with sign-only

* Update tokens to prefund split accounts

* Update split tests with sysvar accounts

* Fix test_split_to_account_with_rent_exempt_reserve

* Fix test_staked_split_destination_minimum_balance

* Fix test_split_more_than_staked

* Fix test_split_minimum_stake_delegation and remove misleading StakeState::Initialized case

* Fix test_split_from_larger_sized_account

* Add test for pre-/post-activation behavior splitting some or all of stake account

* Assert active stake

* Fix runtime test

* Ignore stake-pool downstream

* Review comments

* Feature gate sysvar reads
2023-09-20 06:00:51 +00: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
behzad nouri 4ec5ea6f7b
replaces assert!(matches!(...)) with assert_matches!(...) (#33068)
assert_matches!(...) provides more informative error message when it
fails and it is part of nightly rust:
https://doc.rust-lang.org/std/assert_matches/macro.assert_matches.html
2023-08-30 13:48:27 -04:00
Trent Nelson 2ea88b41fb
cli: skip delegate-stake current voter check for unstaked voters (#32787)
* cli: use `getVoteAccounts` for delegate-stake current voter check

* cli: skip delegate-stake current voter check for unstaked voters

* cli: refactor delegate-stake current voter check
2023-08-11 13:24:14 -06:00
Jon Cinque c73a56faf8
stake: Rename `StakeStateWithFlags` -> `StakeStateV2` (#32795) 2023-08-11 01:07:21 +02:00
Jon Cinque 8e4a9a94ed
sdk: Add new version of `StakeState` to avoid breaking downstream users (#32736)
* sdk: Rename `StakeState` -> `StakeStateWithFlags`

* Add back `StakeFlags` with a deprecation warning
2023-08-09 00:05:40 +02:00
HaoranYi 17af3ab10a
Add stake_flags to stake state (#32524)
add stake_flags to stake state

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-07-24 09:09:40 -05:00
HaoranYi 2e9aeff8dd
Enable partitioned epoch reward by feature id (#32174)
enable partitioned epoch reward feature by feature id
update stake rewards tests with partitioned epoch rewards feature enable

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-06-20 12:12:50 -05:00
Jeff Washington (jwash) 03b260a29f
allow stake tests to wait for rewards payout (#31821) 2023-05-30 08:56:02 -05:00
Tyera 0cdb315b5b
Make redelegate signer more optional (#30734) 2023-03-15 22:59:56 -06: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
Tyera 71ba409bc2
Cli: the authority passed to `solana program write-buffer` must be a proper signer (#29476)
* Fix upgrade signer parsing in program deploy (noop)

* Fix buffer-authority signer parsing in program write-buffer (error on Pubkey input)
2023-01-03 07:32:04 +00: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
kirill lykov c7b2356d37
Replace deploy command with program deploy in tests (#28398)
replace deploy command with program deploy in tests
2022-10-18 10:57:53 +02:00
Dmitri Makarov d6813b98d2 chore: move programs/bpf to programs/sbf 2022-10-13 11:40:40 -04: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
Justin Starry b79abb4fab
Relax authority signer check for lookup table creation (#27248)
* Relax authority signer check for lookup table creation

* cli: support creating lookup tables without authority signer

* add another create lookup table ix function

* improve help message
2022-08-22 23:38:56 +01:00
Justin Starry d8380e4d4a
cli: Add subcommands for address lookup tables (#27123)
* cli: Add subcommand for creating address lookup tables

* cli: Add additional subcommands for address lookup tables

* short commands
2022-08-18 22:12:53 +01:00
Justin Starry bcff977f4c
cli: Require `--bypass-warning` flag to close program accounts (#27108)
* cli: Display warning when closing program accounts

* Fix parsing tests
2022-08-13 08:36:14 +01:00
Tao Zhu 6892970c19
Cli support compute_unit_price (#26464)
* add compute-unit-price trait to insert compute_budget instruction to set priorization fee

* add clap arg for compute-unit-price

* add compute-unit-price arg to commands that send transactions

* add and update tests
2022-08-02 22:23:05 -05:00
Michael Vines b660ac511d cli: Add stake redelegation support 2022-07-27 20:24:25 -06:00