Commit Graph

149 Commits

Author SHA1 Message Date
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
Brooks Prumo 8105b761ed
Add CLI to get stake minimum delegation (#26645) 2022-07-21 07:23:18 -05:00
behzad nouri 5ee157f43d separates durable nonce and blockhash domains
AdvanceNonceAccount instruction updates nonce to blockhash. This makes it
possible that a durable transaction is executed twice both as a normal
transaction and a nonce transaction if it uses blockhash (as opposed to nonce)
for its recent_blockhash field.

The commit prevents this double execution by separating nonce and blockhash
domains; when advancing nonce account, blockhash is hashed with a fixed string.
As a result a blockhash cannot be a valid nonce value; and if transaction was
once executed as a normal transaction it cannot be re-executed as a durable
transaction again and vice-versa.
2022-06-04 12:39:31 +00:00
Justin Starry 68800982ea
Add size_of const fns for upgradeable loader states (#25131) 2022-05-11 22:22:59 +08:00
Brooks Prumo cb501807ca
cli stake tests: Increase stake amounts to handle raising minimum delegation (#24835) 2022-04-29 16:37:18 -05:00
Justin Starry 2ad1baa753
Add const fn StakeState::size_of and static assertion (#24416) 2022-04-20 01:04:12 +08:00
Michael Vines 57ff7371b4 Add StakeInstruction::DeactivateDelinquent 2022-04-14 01:49:22 -04:00
Trent Nelson bd27eedd15 cli: allow skipping fee-checks when writing program buffers (hidden) 2022-03-25 18:19:03 -06:00
Jack May 3d9874b95a
Add fees to tx-wide caps (#22081) 2022-02-11 16:23:16 -08: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
Tyera Eulberg 637e366b18
Prevent rent-paying account creation (#22292)
* Fixup typo

* Add new feature

* Add new TransactionError

* Add framework for checking account state before and after transaction processing

* Fail transactions that leave new rent-paying accounts

* Only check rent-state of writable tx accounts

* Review comments: combine process_result success behavior; log and metrics before feature activation

* Fix tests that assume rent-exempt accounts are okay

* Remove test no longer relevant

* Remove native/sysvar special case

* Move metrics submission to report legacy->legacy rent paying transitions as well
2022-01-11 11:32:25 -07:00
Tyera Eulberg 873fe81bc0
Add offline and fee-payer utilities to CLI vote module (#21579)
* create-vote-account: add offline, nonce, fee_payer capabilities

* vote-authorize: add offline, nonce, fee-payer

* vote-update-things: add offline, nonce, fee-payer

* withdraw-vote: add offline, nonce, fee-payer

* close-vote-acct: add fee-payer

* Allow WithdrawVoteAccount to empty account, since offline operations cannot perform account state queries as in CloseVoteAccount

* Fix lint

* Update offline-signing docs

* Add some parse unit tests

* Add offline integration test
2021-12-06 15:54:50 -07: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
Michael Vines 7027d56064 Resolve nightly-2021-10-05 clippy complaints 2021-10-06 10:37:58 -07: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
Drew Taylor 2a29072019
Add `solana-close-vote-account` to CLI (#19756) 2021-09-13 08:13:59 -07:00
Bryan Ischo e288459cf2 Removed the --authorized-withdrawer argument from create-vote-account
The parameter is now a required third argument.  This is because authorized
withdrawer should never be the same as vote account keypair or validator
identity keypair for security reasons.

Added a --allow-unsafe-authorized-withdrawer to override this restriction if
necessary.
2021-09-03 16:45:06 -07: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
Jack May 0b50bb2b20
Deprecate FeeCalculator returning APIs (#19120) 2021-08-13 09:08:20 -07:00
behzad nouri d2d5f36a3c
adds validator flag to allow private ip addresses (#18850) 2021-07-23 15:25:03 +00:00
Tyera Eulberg aeb30fa873
Cli: Support checked stake and vote operations (#18449)
* Refactor VoteAuthorize to use SignerIndex and support vote-authorize-*-checked

* Add checked bool const and use in command parsing

* Add create-stake-account-checked handling

* Add stake-set-lockup-checked handling

* Remove unnecessary mut

* Add stake-authorized-checked handling
2021-07-15 16:45:03 -06:00
Alexander Meißner 8d5c04e257
Bump solana_rbpf to version 0.2.13 (#18068)
* Moves syscall_registry into the rbpf Executable constructor.

* Adds the reject_unresolved_syscalls flag which is only set when deploying programs via the CLI.
2021-07-07 09:50:11 +02:00
Alexander Meißner 6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
Jon Cinque 1b1d34da59
Refactor stake program into solana_program (#17906)
* Move stake state / instructions into solana_program

* Update account-decoder

* Update cli and runtime

* Update all other parts

* Commit Cargo.lock changes in programs/bpf

* Update cli stake instruction import

* Allow integer arithmetic

* Update ABI digest

* Bump rust mem instruction count

* Remove useless structs

* Move stake::id() -> stake::program::id()

* Re-export from solana_sdk and mark deprecated

* Address feedback

* Run cargo fmt
2021-06-15 18:04:00 +02:00
Michael Vines 96cde36784 SetLockup now requires the authorized withdrawer when the lockup is not in force 2021-05-21 11:49:01 -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
Greg Fitzgerald 3805874c86
Add --no-wait option to CLI's stake-authorize command (#17244) 2021-05-17 16:54:33 +00:00
Michael Vines cf779c63c5 Add ALL support to withdraw-stake subcommand 2021-04-26 11:03:37 -07:00
Michael Vines ba9a502e7e Add --seed support to delegate-stake and withdraw-stake commands 2021-04-21 20:25:01 +00: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
Tyera Eulberg 03d3ae1cb9
Faucet: repurpose cap and slice args to apply to single IPs (#16381)
* Single use stmt

* Log request IP

* Switch cap and slice to apply per IP

* Use SOL in logs, error msgs

* Use thiserror instead of overloading io::Error

* Return memo transaction for requests that exceed per-request-cap

* Handle faucet memos in cli

* Add some docs, esp about memo transaction

* Use SOL symbol & standardize memo

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

* Differentiate faucet tx-length errors

* Populate signature in cli airdrop memo case

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-04-06 07:01:05 +00:00
bji 364af3a3e0
issue #10831: added --with-memo option to all cli commands that submit (#16291)
* issue #10831: added --with-memo option to all cli commands that submit
transactions.  Also, improve the block command to show UTF-8 string instead
of integer values for memo program data.

* Fixed tests and changed some syntax according to feedback.

* Use spl_memo id (all versions where applicable) instead of hardcoding id.

* Update Cargo.toml in programs/bpf.

* Update formatting via cargo fmt.

* Update to use spl_memo version 3.0.1, which simplifies package imports
2021-04-05 20:53:50 +00:00
Michael Vines 3dff5c9dee transfer now requires --allow-unfunded-recipient if the recipient doesn't exist 2021-03-23 02:31:39 +00:00
Jack May 7f500d610c
Add Close instrruction and tooling to upgradeable loader (#15887) 2021-03-17 21:39:29 -07:00
Trent Nelson 672e9c640f CLI: Support dumping the TX message in sign-only mode 2021-03-16 19:20:54 -06:00
Jack May d73af9c1dd
cli: don't overallocate upgradeable buffer accounts (#15603) 2021-03-02 00:45:53 -08:00