Commit Graph

723 Commits

Author SHA1 Message Date
Jack May 363d8d1539
Bump rBPF (#25593) 2022-06-07 04:45:07 -07: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
Jon Cinque d5e18ba1a1
cli: Speed up fee check on program deployment (#25718) 2022-06-02 11:54:26 +02:00
Tyera Eulberg a3d82b8d06
Find epoch start slot for estimated time elapsed (#25491)
* Find epoch start slot for estimated time elapsed

* Only do stuff requiring additional queries when output != json
2022-05-24 17:13:47 -06:00
Michael Vines b05c7d91ed Fix derive_partial_eq_without_eq clippy lint 2022-05-22 22:22:21 -07:00
Jack May 851958f77a
Disallow deployment of deprecated _sol_alloc_free syscall (#25179) 2022-05-20 13:19:41 -07:00
Justin Starry 4e352bffaf
cli: Fix display of staked validators (#25216) 2022-05-17 14:32:52 +08:00
Tao Zhu b1b3702e6d
Prioritize transactions in banking stage by their compute unit price (#25178)
* - get prioritization fee from compute_budget instruction;
- update compute_budget::process_instruction function to take instruction iter to support sanitized versioned message;
- updated runtime.md

* update transaction fee calculation for prioritization fee rate as lamports per 10K CUs

* review changes

* fix test

* fix a bpf test

* fix bpf test

* patch feedback

* fix clippy

* fix bpf test

* feedback

* rename prioritization fee rate to compute unit price

* feedback

Co-authored-by: Justin Starry <justin@solana.com>
2022-05-16 12:06:33 +08:00
Jack May 8902a66b20
Revert "Disallow deployment of deprecated _sol_alloc_free syscall (#24986)" (#25170)
This reverts commit 8f1d4c1665.
2022-05-12 17:58:17 -05:00
Jack May cde15ff687
support 64-bit prioritization fee (#25027) 2022-05-12 11:07:36 -07:00
Justin Starry a118af069e
RPC: Add API version to context response (#25134)
* RPC: Add API version to context response

* restore backwards compatibility
2022-05-12 12:17:21 +08:00
Justin Starry 05de0e3155
cli: Fix deploy program length calculation when using buffers (#25132) 2022-05-12 09:05:41 +08:00
Justin Starry 68800982ea
Add size_of const fns for upgradeable loader states (#25131) 2022-05-11 22:22:59 +08:00
Justin Starry 766e361111
cli: Aggregate cluster info stats by software version (#25103)
* cli: Aggregate cluster info stats by software version

* remove unused itertools dep
2022-05-11 21:33:22 +08:00
Jack May 8f1d4c1665
Disallow deployment of deprecated _sol_alloc_free syscall (#24986)
* Disallow deployment of deprecated _sol_alloc_free syscall

* remove cli argument
2022-05-11 05:22:49 +00:00
Jon Cinque a6b3ab394f
cli: Fix `withdraw-stake` error display (#24942) 2022-05-04 00:19:30 +02:00
Justin Starry 2d7e29477a
cli: Feature status improvements (#24745)
* cli: Display feature activation epoch instead of slot

* cli: Always display feature statuses for specific queries

* cli: Add epoch column and show epoch for pending features

* cli: Remove epoch column and clarify statuses

* skip serializing bookkeeping fields

* Add activation slot to feature status table
2022-04-30 04:08:57 +08:00
Trent Nelson 7d535e87d7
Cli limit features (#24582)
* cli: functionalize feature status resolution

* cli: hide old active features by default
2022-04-22 17:31:07 +08:00
Justin Starry 2ad1baa753
Add const fn StakeState::size_of and static assertion (#24416) 2022-04-20 01:04:12 +08:00
Justin Starry 3426433f99
cli: Fix resume deploy directions (#24422) 2022-04-17 16:10:22 +08:00
Michael Vines 57ff7371b4 Add StakeInstruction::DeactivateDelinquent 2022-04-14 01:49:22 -04:00
Tyera Eulberg 8a73badf3d
Move helpers to solana-cli-config (#24246)
* Add solana-cli-utils crate

* Use cli-utils in cli

* Move println fn to cli-output

* Use cli-config instead
2022-04-11 12:56:51 -06:00
Trent Nelson 91993d89b0 cli: sort option for validators by version 2022-04-11 00:47:47 -06:00
Trent Nelson bd27eedd15 cli: allow skipping fee-checks when writing program buffers (hidden) 2022-03-25 18:19:03 -06:00
Michael Vines c8c3c4359f `vote-authorize-voter` now accepts either the vote or withdraw authority 2022-03-24 16:46:41 -07:00
Tao Zhu 0ed23899e7 directly use compute_budget MAX_UNITS and DEFAULT_UNITS 2022-03-18 08:53:11 -05:00
Justin Starry 0eccacbd5b
Add CLI support for versioned transactions (#23606) 2022-03-17 11:43:04 +08:00
Enrique Fynn 7eaec26a1c
Add space for keys in calculation for rent exempt in `process_set_validator_info` (#23485)
* Fix `process_set_validator_info`

Add space for keys in calculation for rent exempt in
`process_set_validator_info`.

The space required for allocating the `(ConfigKeys, ValidatorInfo)`
tuple only considered space for `ValidatorInfo`.
But `config_instruction::create_account` also requires space for `n`
keys.

* Remove one clone call from closure
2022-03-14 15:10:31 -06:00
Justin Starry 021135978d
Refactor: Split up cli transaction display methods (#23547) 2022-03-11 10:49:53 +08:00
Justin Starry 249d926d1b
Refactor: Add transaction binary encoding enum (#23546) 2022-03-09 16:09:08 +08:00
Justin Starry 3114c199bd
Add RPC support for versioned transactions (#22530)
* Add RPC support for versioned transactions

* fix doc tests

* Add rpc test for versioned txs

* Switch to preflight bank
2022-03-08 15:20:34 +08:00
Tao Zhu e790d0fc53
Optional Cli parameter to add additional-fee to solana ping (#23513)
* Optional Cli parameter to add additional-fee to solana ping

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* Update cli/src/cluster_query.rs

correct the help message for arg

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

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2022-03-08 03:49:36 +00:00
Trent Nelson e2d0ede630 cli: accept 'system' program id mnemonic for with seed 2022-02-18 19:51:18 -07:00
Trent Nelson dcd0a39cb6 cli: coerce with seed program id mnemonics to uppercase 2022-02-18 19:51:18 -07:00
Tyera Eulberg 88b66ae3a8
Allow cli users to authorize Staker signed by Withdrawer (#23146) 2022-02-15 22:08:53 -07:00
Tyera Eulberg d2c89213ff
Implement json output for solana ping (#22959) 2022-02-05 21:40:12 +00:00
Alexander Meißner 96c88d1a5e
Bumps solana_rbpf to version v0.2.22 (#22923)
* Bumps solana_rbpf to v0.2.22

* Adjusts vm::Config and feature gates.
2022-02-04 21:17:49 +01:00
Michael Vines 85e8bece2e Add solana_client::nonblocking::RpcClient 2022-01-26 17:58:00 -08:00
Tyera Eulberg 90689585ef
Update ping to transfer to self, with rotating amount (#22657)
* Update ping to transfer to self, with rotating amount

* Remove balance check
2022-01-21 22:10:50 -07:00
Alexander Meißner b448472037
Refactor: Move `InstructionRecorder` into `TransactionContext` (#22578)
* Moves InstructionRecorder into TransactionContext.

* Adds assertions for number_of_instructions_at_transaction_level.
2022-01-19 22:40:09 +01:00
Michael Vines e14ae33e86 Improve nonce-related error messages 2022-01-14 12:59:01 -08:00
Justin Starry ae6c511f13
Refactor: Split vote_instruction.rs into multiple files (#22502) 2022-01-14 17:25:15 +08:00
Jack May 1632ee03da
nit: Traceable balance checks (#22462) 2022-01-13 09:09:22 -08:00
Jeff Biseda 8b66625c95
convert std::sync::mpsc to crossbeam_channel (#22264) 2022-01-11 02:44:46 -08:00
Brooks Prumo d90d5ee9b6
Refactor Rent::due() with RentDue enum (#22346) 2022-01-08 09:03:46 -06:00
Alexander Meißner 73e6038986
Refactor: Remove `KeyedAccount` from program runtime (#22226)
* Makes error handling in BorrowedAccount optional.
Adds BorrowedAccount ::get_rent_epoch().
Exposes InstructionContext::get_index_in_transaction().
Turns accounts and account_keys into pinned boxed slices.

* Introduces "unsafe" to InvokeContext::push().

* Turns &TransactionContext into &mut TransactionContext in InvokeContext.

* Push and pop InstructionContext in InvokeContext.
Makes test_process_cross_program and test_native_invoke symmetric.
Removes the borrow check from test_invoke_context_verify.

* Removes keyed_accounts from prepare_instruction()

* Removes usage of invoke_stack.

* Removes keyed_accounts from program-test.

* Removes caller_write_privileges.

* Removes keyed_accounts from BPF parameter (de-)serialization.
2022-01-03 23:30:56 +01:00
Justin Starry 2a00382d71
Refactor: cleanup solana_transaction_status crate (#22230) 2022-01-03 15:45:18 +00:00
Alexander Meißner a06646631c
Feature: TransactionContext, InstructionContext and BorrowedAccount (#21706)
* Adds TransactionContext, InstructionContext and BorrowedAccount.

* Redirects the usage of accounts in InvokeContext through TransactionContext.
Also use the types declared in transaction_context.rs everywhere.

* Adjusts all affected tests.
2021-12-27 18:49:32 +01:00
Ryan Laursen d06c04d02c Update checks.rs 2021-12-23 05:14:37 -08:00
Ryan Laursen 52c1eb0160 Remove msg spam from deploying 2021-12-23 05:14:37 -08:00
losman0s 0e9e67b65d Add complete account dump to file
This commit introduces the ability to dump the complete content of an
account to a JSON file (compact or not depending on the provided format
option).

Example:

```sh
solana account -u m \
  --output json-compact \
  --output-file SRM_token.json \
  SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt
```

Note: Behavior remains untouched if format option `--output` is not
provided (only account data gets written to file).
2021-12-15 11:05:02 -08:00
Tyera Eulberg dcd2854829
Add json support for feature sets; also print output after feature list (#21905)
* Add json support for feature sets; also print output after feature list

* Move stringifying into Display implementation
2021-12-15 05:11:08 +00:00
Tyera Eulberg bed1b143a5
Restore ALL behavior; add enum variant, comments, and help text to make behavior clearer (#21854) 2021-12-13 19:00:29 -07:00
Justin Starry 1149c1880d
cli: Order displayed feature list by status (#21810) 2021-12-13 07:42:57 -05: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
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
Michael Vines 4098af3b5b Record vote account commission with voting/staking rewards and surface in RPC 2021-07-12 15:09:44 -07:00
Tyera Eulberg f39ffa69f6
Remove dead solana airdrop parameters (#18520) 2021-07-08 18:18:44 +00: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
Tyera Eulberg 1dd730d685
Cli: expose `--with-memo` to nonce and stake commands (#18404)
* Fmt memo_arg

* Add --with-memo to nonce and stake cli commands
2021-07-03 11:46:52 -06:00
Michael Vines 52290dbd35 `solana validators` output now includes average skip rate 2021-06-30 22:08:26 +00:00
Tyera Eulberg 9d4428d3d8
Use timeout to allow RpcClient to retry initial transaction confirmation (#18311)
* Tidying: relocate function

* Use proper helper method for RpcClient commitment

* Add RpcClientConfig

* Add configurable confirm_transaction_initial_timeout

* Use default 5s timeout for initial tx confirmation
2021-06-30 01:08:45 +00:00
Tyera Eulberg f2b0d562b0
Cli epoch-info: generate epoch-completed time from block times (#18258)
* Generate epoch-completed time from block times

* Add annotation when block times not available
2021-06-28 15:32:28 -06:00
Alexander Meißner 789f33e8db chore: cargo fmt 2021-06-18 10:42:46 -07: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
Jack May 39654d3fa5
Improve program deployment error message (#17717) 2021-06-03 15:52:36 -07:00
Tyera Eulberg b7f98ea18a
Cli: Decode known program custom errors returned from simulation (#17652) 2021-06-01 23:22:01 -06:00
dependabot[bot] a43c29e858
Bump indicatif from 0.15.0 to 0.16.2 (#17628)
* Bump indicatif from 0.15.0 to 0.16.2

Bumps [indicatif](https://github.com/mitsuhiko/indicatif) from 0.15.0 to 0.16.2.
- [Release notes](https://github.com/mitsuhiko/indicatif/releases)
- [Commits](https://github.com/mitsuhiko/indicatif/compare/0.15.0...0.16.2)

Signed-off-by: dependabot[bot] <support@github.com>

* [auto-commit] Update all Cargo lock files

* Fix message types

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-01 17:38:02 +00:00
Trent Nelson 06a926f2f4 Improve missing default filepath signer error messaging 2021-05-28 20:10:36 -06:00
Trent Nelson ca8c1c6c42 Revert "Improve missing default signer error messaging (#17486)"
This reverts commit 6d40d0d141.
2021-05-28 20:10:36 -06:00
Jack May 89ee8778bc
Unify BPF verifiers (#17585) 2021-05-28 14:24:02 -07:00
Michael Vines cbce440af4 simulateTransaction can now return accounts modified by the simulation 2021-05-26 14:20:23 -07:00
Tyera Eulberg e9bc1c6b07
Add last valid block height to rpc Fees (#17506)
* Add last_valid_block_height to fees rpc

* Add getBlockHeight rpc

* Update docs
2021-05-26 07:26:19 +00:00
Jack May 6d40d0d141
Improve missing default signer error messaging (#17486) 2021-05-25 18:31:27 -07:00
Nikita d41266e4e9
rpc: add context toggle to getProgramAccounts (#17399)
* fix(rpc): return context in get_program_accounts

* doc(rpc): document withContext flag

* fix(rpc): fix comment

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

* fix(rpc): fix doc

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

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-22 07:12:21 +00: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
Trent Nelson cb5e000615 CLI: Print gossip nodes with `cli-output` crate 2021-05-06 07:49:47 +00:00
Tyera Eulberg 46d2755205
Correct days/year (#17024) 2021-05-04 10:00:30 +00:00
Michael Vines d640ac143b Add skip rate to `solana validators` 2021-04-28 22:43:06 -07:00
Michael Vines b66a68975b block-production subcommand now uses SlotHistory sysvar when possible 2021-04-26 21:00:16 -07:00
Michael Vines cf779c63c5 Add ALL support to withdraw-stake subcommand 2021-04-26 11:03:37 -07:00
Justin Starry 75b8434b76
Add TPU client for sending txs to the current leader tpu port (#16736)
* Add TPU client for sending txs to the current leader tpu port

* Update tpu_client.rs
2021-04-23 09:35:12 +08:00
Trent Nelson 63957f0677 CLI: Make `pay` subcommand a proper alias of `transfer` 2021-04-21 21:21:06 +00:00
Michael Vines ba9a502e7e Add --seed support to delegate-stake and withdraw-stake commands 2021-04-21 20:25:01 +00:00
Trent Nelson f91de6a84d CLI: Limit `stake-history` output by default 2021-04-20 10:15:25 +00:00
Michael Vines f14cf3ed1a Add --number argument 2021-04-19 16:31:23 -07:00
Michael Vines b66faf7e80 Add --sort argument to `solana validators` 2021-04-19 16:31:23 -07:00
Michael Vines a911ae00ba clippy 2021-04-18 20:55:02 -07:00
Trent Nelson 09dcc9ea04 clap-utils: Rename KeypairUrl to SignerSource 2021-04-16 13:56:12 -06:00
Tyera Eulberg 974e6dd2c1
Deprecate "confirmed" RpcClient methods (#16520)
* Remove obsolete client methods

* Deprecate GetConfirmed client methods

* Rename Confirmed config structs, with appropriate deprecation

* Fixup client apps

* Map RpcRequest to deprecated when targeting older nodes
2021-04-15 17:00:14 -06: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 ccb11a939f
Deprecate RpcClient methods, RpcRequest variants (#16516)
* Deprecate RpcClient methods, RpcRequest variants

* Update cli to getSupply
2021-04-13 14:05:42 -06:00
François Garillot b08cff9e77
Simplify some pattern-matches (#16402)
When those match an exact combinator on Option / Result.

Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust).
2021-04-08 12:40:37 -06:00
Tyera Eulberg bb9d2fd07a
Cli: use get_inflation_rewards and limit epochs queried (#16408)
* Fix block-with-limit when not finalized blocks found

* Enable confirmed commitment in getInflationReward

* Use get_inflation_rewards in cli

* Line up rewards output

* Add range validator

* Change cli epoch arg -> num epochs

* Add solana inflation rewards subcommand

* Consolidate epoch rewards meta
2021-04-08 10:57:33 -06:00
Trent Nelson c5c3ae0203
CLI: Fix `rent` panic (#16417)
* CLI: Fix `rent` panic on non-numeric input (+monikers)

* Update cli/src/cluster_query.rs

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

* Update cli/src/cluster_query.rs

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

* Update cli/src/cluster_query.rs

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

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-04-07 09:57:12 -06: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
Jack May aa45e81b3e
nit: fix variable names (#16283) 2021-03-31 23:18:29 -07:00
Tyera Eulberg da27acabcc
Rpc: enable getConfirmedSignaturesForAddress2 to return confirmed (not yet finalized) data (#16281)
* Update blockstore method to allow return of unfinalized signature

* Support confirmed sigs in getConfirmedSignaturesForAddress2

* Add deprecated comments

* Update docs

* Enable confirmed transaction-history in cli

* Return real confirmation_status; fill in not-yet-finalized block time if possible
2021-04-01 04:35:57 +00:00
Tyera Eulberg 433f1ead1c
Rpc: enable getConfirmedBlock and getConfirmedTransaction to return confirmed (not yet finalized) data (#16142)
* Add Blockstore block and tx apis that allow unrooted responses

* Add TransactionStatusMessage, and send on bank freeze; also refactor TransactionStatusSender

* Track highest slot with tx-status writes complete

* Rename and unpub fn

* Add commitment to GetConfirmed input configs

* Support confirmed blocks in getConfirmedBlock

* Support confirmed txs in getConfirmedTransaction

* Update sigs-for-addr2 comment

* Enable confirmed block in cli

* Enable confirmed transaction in cli

* Review comments

* Rename blockstore method
2021-03-26 16:47:35 -06:00