Commit Graph

1011 Commits

Author SHA1 Message Date
HaoranYi 304333405c 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 16:28:38 -05:00
Justin Starry 21eff36754 cli: skip no-op program buffer writes (#277)
cli: skip no-op program deploy write txs
2024-03-20 16:28:37 -05:00
Nagaprasad V R 50cc77c58f relax stake split destination check (#162)
* relax stake split destination check

* change stake_account error handling logic

* fmt

* modify logic

* change error message when account is neither owned by stake program or system program

* add a comment explaining nested ifs in stake_account error handling

* fix typos in comments

* update comment
2024-03-15 22:25:14 -05:00
Han Yang e3b9d7fbb3
SDK: refactor `Signer` and `Signers` traits (#34984)
* read_keypair_file\((.+?)\)[\n\r\s]+.unwrap\(\)[\n\r\s]+.into\(\) -> Box::new(read_keypair_file().unwrap()), Presigner::new\((.*?)\).into\(\) -> Box::new(Presigner::new())

* compiles

* moar general

* doc

* Result impls FromIterator

* doc
2024-03-01 12:34:32 +01: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
omahs d87e7bc8e5
Fix typos (#35234)
* fix typos

* fix typo

* fix typos

* fix typo
2024-02-19 15:51:13 +00:00
0xF812 1c78ed6f3e
Fix: add missing required attribute to LOOKUP_TABLE_ADDRESS arg for get subcommand (#35200)
make LOOKUP_TABLE_ADDRESS arg required for address-lookup-table get subcommand
2024-02-14 17:39:39 -07:00
ellttBen 9e09524595
Cli: Return final transaction signature in solana program deploy (#34931) 2024-01-25 22:25:03 +00: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
Justin Starry 88af74d1d0
refactor: optional `stake_history` arg is never `None` (#34556)
refactor: optional stake_history arg is never none
2023-12-22 10:44:28 +08:00
GoodDaisy 03386cc7b9
Fix typos (#34459)
* Fix typos

* Fix typos

* fix typo
2023-12-21 13:06:00 -07: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
Tyera 636992b51e
Fix pubkey-macro args (#34410)
* Update macro to be a complete sentence

* Update punctuation/spaces to match new macro

* Remove repetitive 'address' usage and correct other verbiage

* Improve a couple withdrawal-recipient messages

* Fix wording

* Review comments
2023-12-12 19:54:43 +00:00
norwnd 2e34bfc248
comments: fix typos (#34402)
fix miscellaneous typos

Co-authored-by: norwnd <norwnd>
2023-12-11 11:24:34 -07: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 f41badfc19
cli: (program) move buffer fetching/validation into separate fn (#34317)
* cli: (program) move buffer fetching/validation into separate fn

* error gracefully (don't panic)

---------

Co-authored-by: norwnd <norwnd>
2023-12-05 16:11:29 +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
Tyera 68928bb7d6
solana-cli: format strings (#34288)
* Format strings in solana-cli

* Restore some wallet.rs strings that were better before

* Fixup vote.rs string

* Fixup stake.rs string

* Fixup program.rs strings

* Fixup some address_lookup_table.rs strings

* Fixup clap_app.rs string

* Clarify validator_info help

* Fixup cluster_query.rs
2023-12-01 09:00:14 +00:00
Justin Starry 34f5c68416
cli: add solana program extend subcommand (#34043) 2023-11-16 09:52:41 +08:00
Brooks 725ab37bf4
clippy: Replaces .get(0) with .first() (#34048) 2023-11-13 17:22:17 -05:00
Pankaj Garg 6fd0dcb3eb
Add support for fetching program in cargo registry (#33759)
* Rename publisher.rs to crate_handler.rs

* support for fetching program in cargo registry
2023-10-20 15:41:24 -07:00
Pierre e1a9f8ef17
CLI remove unwrap_or_default() on rpc calls (#33782) 2023-10-20 14:27:31 +02:00
Pankaj Garg 1155d46266
Add CLI command to show/dump v4 programs (#33693) 2023-10-13 12:13:45 -07:00
Pankaj Garg 4c664a8d31
Cargo registry service for deploying programs (#33570) 2023-10-09 14:32:35 -07:00
Andrew Fitzgerald 973df825b7
log signature after successful feature activation (#33488) 2023-10-06 09:46:26 -07:00
Pankaj Garg ef47c977dc
Decouple program-v4 command processors from CliConfig (#33554) 2023-10-06 03:53:55 -07:00
sakridge 83b49daf29
Fix CLI help text for `solana stake-account` (#33387)
Fix help text
2023-10-05 17:23:41 +00: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
sakridge 3b1cbaec72
Add csv output option to stake and vote account rewards (#32360)
* Add csv option to vote-account

* Add CSV format to solana stake command

Csv rename
2023-09-21 19:23:37 +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
Pankaj Garg 62888d297a
Implement CLI front-end for loader-v4 commands (#33289)
* Implement CLI front-end for loader-v4 commands

* remove dead_code clippy overrides

* Add unit tests
2023-09-19 08:27:35 -07:00
Pankaj Garg 5dbc19ccbf
Processors to compile and send LoaderV4 CLI commands (#33228)
* Processors to compile and send LoaderV4 CLI commands

* suppress unused code warning

* clippy fixes

* redeploy program using source buffer

* unify deploy and redeploy to a single function

* clippy fixes

* fixes after testing the CLI frontend
2023-09-18 06:43:33 -07:00
bji bdf7207eec
Implement timely vote credits feature. (#32957) 2023-09-12 10:40:04 -07:00
Alexander Meißner bbb57be0a5
Refactor - Move interfaces of address-lookup-table into the program SDK (#33165)
* Adds a module `address_lookup_table` to the SDK.

* Adds a module `address_lookup_table::instruction` to the SDK.

* Adds a module `address_lookup_table::error` to the SDK.

* Adds a module `address_lookup_table::state` to the SDK.

* Moves AddressLookupTable into SDK as well.

* Moves AddressLookupTableAccount into address_lookup_table.

* Adds deprecation messages.

* Disentangles dependencies across cargo files.
2023-09-11 21:10:40 +02:00
Alexander Meißner 424666e341
Bump solana_rbpf to v0.7.0 (#33104)
* Upgrades RBPF in Cargo.toml

* Adjustments to updated interfaces.
2023-09-06 10:54:15 +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
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 b8dc5daedb
preliminaries for bumping nightly to 2023-08-25 (#33047)
* remove unnecessary hashes around raw string literals

* remove unncessary literal `unwrap()`s

* remove panicking `unwrap()`

* remove unnecessary `unwrap()`

* use `[]` instead of `vec![]` where applicable

* remove (more) unnecessary explicit `into_iter()` calls

* remove redundant pattern matching

* don't cast to same type and constness

* do not `cfg(any(...` a single item

* remove needless pass by `&mut`

* prefer `or_default()` to `or_insert_with(T::default())`

* `filter_map()` better written as `filter()`

* incorrect `PartialOrd` impl on `Ord` type

* replace "slow zero-filled `Vec` initializations"

* remove redundant local bindings

* add required lifetime to associated constant
2023-08-29 23:05:35 +00:00
Alexander Meißner 67d6d688cc
Refactor - Demotes `Arc` to `Rc`. (#32982)
Demotes `Arc` to `Rc`.
2023-08-25 00:54:06 +02:00
Alexander Meißner a8be70fa7a
General cleanup (#32980)
* Fixes `cargo::` in build.rs

* Fixes overshadowing reexports.

* Removes unnecessary `as *const u8`.

* Removes unnecessary `.into_iter()`.

* cargo clippy
2023-08-24 21:44:19 +02:00
steviez 427b8b1332
Revert "Implement timely vote credits feature (#31291)" (#32890)
This reverts commit 35ec7bf804.
2023-08-18 17:04:20 +00:00
Jon Cinque 0f8a871fc0
client: Rename confrim -> confirm (#32861)
* client: Rename confrim -> confirm

* Rebase fix
2023-08-17 19:05:30 +02:00
galactus 1999138e12
Using new method to deploy the programs (#32638)
Using new method to deploy the programs, making blockheight comparison similar to previous implementation.
2023-08-16 18:02:34 -06: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
Pankaj Garg a1a0829a8b
Initialize and store PRv2 environment in cache (#32812)
* Initialize and store PRv2 environment in cache

* address review comments
2023-08-11 18:58:22 +00:00
Jon Cinque c73a56faf8
stake: Rename `StakeStateWithFlags` -> `StakeStateV2` (#32795) 2023-08-11 01:07:21 +02:00
bji 35ec7bf804
Implement timely vote credits feature (#31291) 2023-08-10 14:07:51 -07: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