Commit Graph

58 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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 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
Justin Starry 68800982ea
Add size_of const fns for upgradeable loader states (#25131) 2022-05-11 22:22:59 +08:00
Trent Nelson bd27eedd15 cli: allow skipping fee-checks when writing program buffers (hidden) 2022-03-25 18:19:03 -06:00
Michael Vines 6d5bbca630 Pacify clippy 2022-01-21 19:12:57 -08:00
Jack May 1632ee03da
nit: Traceable balance checks (#22462) 2022-01-13 09:09:22 -08:00
Michael Vines b8837c04ec Reformat imports to a consistent style for imports
rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
2021-12-03 09:19:13 -08:00
sakridge a8d78e89d3
Move test-validator to own module to reduce core dependencies (#20658)
* Move test-validator to own module to reduce core dependencies

* Fix a few TestValidator paths

* Use solana_test_validator crate for solana_test_validator bin

* Move client int tests to separate crate

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-29 01:27:07 +00:00
Jack May de8331eeaf
Deploy error is buffer is too small (#20358)
* Deploy error is buffer is too small

* missing file
2021-10-01 02:47:26 +00:00
Jack May 57bbbb83a4
cli: show upgradeable program accounts (#19431) 2021-08-25 17:03:55 -07:00
Jack May a89f180145
Allow closing upgradeable program accounts (#19319) 2021-08-24 10:05:54 -07:00
behzad nouri d2d5f36a3c
adds validator flag to allow private ip addresses (#18850) 2021-07-23 15:25:03 +00:00
Alexander Meißner 6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
Tao Zhu 0781fe1b4f
Upgrade Rust to 1.52.0 (#17096)
* Upgrade Rust to 1.52.0
update nightly_version to newly pushed docker image
fix clippy lint errors
1.52 comes with grcov 0.8.0, include this version to script

* upgrade to Rust 1.52.1

* disabling Serum from downstream projects until it is upgraded to Rust 1.52.1
2021-05-19 09:31:47 -05:00
Tyera Eulberg 7dfb51c0b4
Cli: move airdrop to rpc requests (#16557)
* Add recent_blockhash to requestAirdrop

* Move tx confirmation to separate method

* Add RpcClient airdrop methods

* Request cli airdrop via RpcClient

* Pass optional faucet_addr into TestValidator and fix tests

* Update client/src/rpc_client.rs

Co-authored-by: Michael Vines <mvines@gmail.com>

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-04-15 06:25:23 +00:00
Jack May 7f500d610c
Add Close instrruction and tooling to upgradeable loader (#15887) 2021-03-17 21:39:29 -07:00
Jack May d73af9c1dd
cli: don't overallocate upgradeable buffer accounts (#15603) 2021-03-02 00:45:53 -08:00
Justin Starry f5c564bc6c
cli: Speed up program deploys (#15347)
* Speed up deploys

* fix test
2021-02-17 09:00:47 +08:00
Jack May 210514b136
Add cli deploy tests (#15116) 2021-02-05 09:57:44 -08:00
Jack May 9c6d899efb
cli: add command to dump the upgradeable program to a file (#15029) 2021-02-02 22:33:03 -08:00
Tyera Eulberg 52f0de3207
Impl OutputFormat for solana program (#14911) 2021-02-01 10:39:37 -07:00