Commit Graph

569 Commits

Author SHA1 Message Date
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
Alexander Meißner
015250f96c Feature gates for rbpf v0.2.16 (#21590)
- Adds feature reject_section_virtual_address_file_offset_mismatch.
- Adds feature start_verify_shift32_imm.
- Enables enable_symbol_and_section_labels only in the rbpf-cli.
2021-12-03 15:45:25 +01:00
Alexander Meißner
bfdb775ffc Unifies ThisInvokeContext and dyn trait InvokeContext. (#21563) 2021-12-02 18:47:16 +01:00
Trent Nelson
04c0f124c4 cli: always print feature version info with status query 2021-12-01 20:07:20 -07:00
Michael Vines
e922c2da9d Update to Rust 1.56.1 2021-11-30 23:28:07 -08:00
Alexander Meißner
c9aa7ed5ca Bumps solana_rbpf to v0.2.16 (#21492) 2021-11-30 16:26:36 +01:00
DimAn
09799590ac fix checks in process_vote_authorize (#21465) 2021-11-29 09:46:29 -06:00
Michael
755221bac4 Adjust "solana rent" sub command to clarify automatic inclusion of account overhead (#21383)
* Adjust CLI rent command description and help to clarify account overhead already included

* Adjust rent sub command about message

* Adjust CLI message

* Adjust CLI rent command description and help to clarify account overhead already included

* Adjust rent sub command about message
2021-11-24 09:53:05 -07:00
Andrei Lebedev
3c7cb2522c complete_partial_program_init: remove redundant conditional (#20895) 2021-11-11 15:43:35 -08:00
Alexander Meißner
7200c5106e Replaces MockInvokeContext by ThisInvokeContext in tests (#20881)
* Replaces MockInvokeContext by ThisInvokeContext in BpfLoader, SystemInstructionProcessor, CLIs, ConfigProcessor, StakeProcessor and VoteProcessor.

* Finally, removes MockInvokeContext, MockComputeMeter and MockLogger.

* Adjusts assert_instruction_count test.

* Moves ThisInvokeContext to the program-runtime crate.
2021-11-04 21:47:32 +01:00
Jack May
bced07a099 Update fee api to use blockhash (#21054) 2021-10-29 13:52:59 -07:00
Tyera Eulberg
0b8fcf0808 Check whether vote-authorize-voter-checked new vote authority is_interactive (#21051)
* Check interactive signer for vote-authorize-voter-checked

* Recommend checked vote reauthorization
2021-10-28 20:48:16 +00:00
Jon Cinque
5f7b60576f tpu-client: Move send_messages_with_spinner from program (#20960)
We have too many ways of sending transactions, and too many
reimplementations of the same logic all over the place.

The program deploy logic and stake-o-matic currently make the
most use of the TPU client, so this merges their implementations into
one place to be reused by both.  Yay for consolidation!
2021-10-26 22:54:26 +02:00
Jack May
af405f0ed7 Hide deploy from cli subcommands (#20901) 2021-10-25 09:53:21 -07:00
Thomas Sauvajon
91de3013dd Test some validator_info error paths (#20635)
* Test some validator_info error paths

* Fix a linting issue

* Improve test robustness by removing magic numbers
2021-10-25 09:59:42 -06:00
Trent Nelson
d98c8b861c cli: improve feature status arithmatic readability 2021-10-22 23:45:33 -06:00
Trent Nelson
30d277b9fd cli: sort feature status output 2021-10-22 23:45:33 -06:00
Trent Nelson
152da44b62 cli: add software version(s) to feature status 2021-10-22 23:45:33 -06:00
Trent Nelson
b9eb6242f5 cli: struct the tuples 2021-10-22 23:45:33 -06:00
Jack May
bfbbc53dac Divorce the runtime from FeeCalculator (#20737) 2021-10-22 14:32:40 -07:00
Trent Nelson
5794bba65c cli: account for rpc nodes when considering feature set adoption 2021-10-18 22:17:37 -06:00
Kirill Fomichev
e9a427b9c8 Rpc: filters performance improvement (#20185)
* Add Base58,Base64,Bytes to MemcmpEncodedBytes

* Rpc: decode memcmp before filtering accounts

* Add deprecated attribute

* Add Memcmp::bytes

* Fix clippy for deprecated

* Another clippy fix

* merge RpcFilterError::DataTooLarge

* add deprecation for Base58DataTooLarge

* change filter data size limit

* strict data size len for base58

* add magic numbers

* fix tests
2021-10-14 12:43:27 -06:00
Jack May
da45be366a Remove blockhash from fee calculation (#20641) 2021-10-13 13:10:58 -07:00
Alexander Meißner
f30f3bddbb Refactor: Remove program_id from process_instruction() (#20540)
* Replaces usage of program_id parameter by invoke_context.get_caller()?.

* Removes "pubkey: &Pubkey" parameter from "process_instruction()".
2021-10-10 22:29:18 +02:00
Michael Vines
7027d56064 Resolve nightly-2021-10-05 clippy complaints 2021-10-06 10:37:58 -07:00
Justin Starry
0ddb34a0b4 Add struct and convenience methods to track stake activation status (#20392)
* Add struct and convenience methods to track stake activation status

* fix nits

* rename
2021-10-04 18:59:11 -04: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
Justin Starry
53a810dbad cli: Stop topping up buffer balance (#20181) 2021-09-29 12:27:18 -04:00
Tyera Eulberg
15144fc923 Cli: check current authorities before attempting to change them (#19853)
* Stake-authorize: check account current authority

* Stake-set-lockup: check account current custodian

* Make helper fn pub(crate)

* Vote-authorize: check account current authority
2021-09-15 13:59:05 -06:00
Drew Taylor
2a29072019 Add solana-close-vote-account to CLI (#19756) 2021-09-13 08:13:59 -07:00
Justin Starry
24fd47a32d Speed up program deploys by writing larger chunks (#19654) 2021-09-07 10:20:17 -07:00
Michael Vines
b44ff347e2 Surface write transaction failures during program deployment 2021-09-04 21:04:47 -07:00
Michael Vines
787c62fb15 Generalize send_and_confirm_transactions_with_spinner() 2021-09-04 21:04:47 -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
Tyera Eulberg
7c7640b462 Fix typos (#19448) 2021-08-26 13:05:05 -06: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
Jon Cinque
73aa004c59 stake: Remove v2 program references (#19308)
* stake: Remove v2 program references

* Remove stake v2 feature, along with stake rewrite
2021-08-20 01:08:44 -04:00
Jack May
0b50bb2b20 Deprecate FeeCalculator returning APIs (#19120) 2021-08-13 09:08:20 -07:00
Tyera Eulberg
5970083b4d Use last_valid_block_height in services and client apps (#19163)
* Add deprecated tag to Bank::get_blockhash_last_valid_slot

* Update SendTransactionService to use last_valid_block_height

* Update solana-tokens to use last_valid_block_height

* Remove dangling file

* Update solana program to use last_valid_block_height

* Update Banks crates to use last_valid_block_height
2021-08-11 01:04:00 -06:00
Alexander Meißner
0a63f65c03 Bumps solana_rbpf to v0.2.14 (#18869)
* Bumps solana_rbpf to v0.2.14

* Feature gate for verify_mul64_imm_nonzero as discussed in #17520.
2021-08-04 09:50:28 +02:00
Trent Nelson
21bc43ed58 nonce: Unify NonceError with SystemError 2021-07-30 14:47:14 -06:00
NearlyAlwaysThere
46fdf8a4d2 Tiny typo fix (#18978) 2021-07-29 14:07:10 -06:00
Tyera Eulberg
662ccfa558 Cli: app and wallet command reorg (#18955)
* Clean up wallet commands

* Move global args
2021-07-29 00:19:34 -06:00
theonekeyg
9d0a937a05 Auto-generate shell completions for solana-cli (issue #8879 and #14005) (#18931)
* Auto-generate shell completions for solana-cli (issue #8879 and #14005)

Implement `completion` SubCommand for solana-cli, which outputs
completion script to stdout and exits the process. The script generation
handled completely by clap.

In order to implement the generation, one minor design change was
necessary regarding the creation of clap `App`.

Previously: One part of App initialization was in the `app` function,
and some other arguments and subcommands were added later directly in
the `main` function.

Now: The whole construction of App was moved to `get_clap_app` function.

P.S. I wasn't sure if constructing App separately had visual importance,
so both constructing parts are still separate in `base_clap_app` and
`final_clap_app` functions. But they sure could be in one single
function.

* Dereplicode match expr, fix clippy warning.

* Move clap App construction into separate module

Also join two parts of the construction into a single function

* Fix tests

* Apply rustfmt lints
2021-07-28 09:43:32 -06:00
Tyera Eulberg
467c18e0d1 Add cli-output helpers (#18933)
* Add OutputFormat helper to reduce copy-pasta

* Add CliSignOnlyData constructor
2021-07-28 04:21:23 +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
Trent Nelson
a4a24b6531 cli: allow returning more solana validators 2021-07-14 08:41:52 +00:00
Tyera Eulberg
8ad4ffdee5 Cli: expose last valid block height (#18620)
* Add Fees struct to client

* Add complete RpcClient::get_fees methods

* Switch cli to last_valid_block_height
2021-07-13 01:41:27 +00:00