stake-program: `MoveStake` and `MoveLamports` (#1415)
implement two new instructions for moving delegated stake and undelegated lamports, respectively, between accounts with the same Authorized and Lockup using the Staker authority
(cherry picked from commit 361ade4439)
Co-authored-by: hana <81144685+2501babe@users.noreply.github.com>
* port join from itertools and use it in program_stubs.rs
* move itertools to dev-dependencies of solana-program
* add comment to join fn
* more concise replacement for join fn
Co-authored-by: Jon C <me@jonc.dev>
* remove join fn
---------
Co-authored-by: Jon C <me@jonc.dev>
* extract solana-poseidon crate
* update imports and lock files
* remove now-unused light-poseidon dep from program crate
* add missing posiedon dep when target_os = "solana"
* set solana-poseidon version to 2.0.0
* sort workspace members
* use workspace version in Cargo.toml
Co-authored-by: Joe C <joecaulfield29@yahoo.com>
* move syscall definition to solana-poseidon crate
Co-authored-by: Joe C <joecaulfield29@yahoo.com>
* finish moving sol_poseidon defn to solana-poseidon crate
* update imports in examples
---------
Co-authored-by: Joe C <joecaulfield29@yahoo.com>
* use serde_derive instead of the derive feature of serde
* make serde_derive version match serde version
* remove serde dep entirely from programs/address-lookup-table
* replace remaining usage of serde "derive" feature
* update lock files
* explicitly use serde_derive in svm and frozen-abi
* add comments about serde and serde_derive versions matching
* make frozen-abi optional in solana-program
* fix syntax error
* activate solana-program's frozen-abi feature in dev deps of program and sdk
* undo putting solana-program itself in solana-program dev deps
* add missing whitespace
Co-authored-by: Tyera <teulberg@gmail.com>
---------
Co-authored-by: Tyera <teulberg@gmail.com>
* program: remove unused tiny_bip39 dep
* add wasm-bindgen feature for wasm builds of solana-sdk
* make rand version explicit
* remove line specifying rand version for wasm32
* sdk: Enable wasm-bindgen feature on getrandom
---------
Co-authored-by: Jon C <me@jonc.dev>
```
error: assigning the result of `Clone::clone()` may be inefficient
--> bucket_map/src/bucket.rs:979:17
|
979 | hashed = hashed_raw.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `hashed.clone_from(&hashed_raw)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note: `-D clippy::assigning-clones` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::assigning_clones)]`
```
* Fix crash if vote state is malformed
* Fix vote program crash if clock rewinds
Return an instruction error instead of panicking if the vote
program detects the vote program's vote authority history is
newer than the current clock.
---------
Co-authored-by: Richard Patel <ripatel@jumptrading.com>
* Add new StakeError variant
* Add closure to return error if EpochRewards::active
* Use error_during_epoch_rewards for Instructions that mutate stake accounts
* Use try instead of manually matching Ok/Err
* Consolidate error_during_epoch_rewards check
* Add new test helper
* Add test demonstrating which ix return StakeError::EpochRewardsActive
* Remove single-use fn
* alt_bn128: simplify errors in sycalls (alt_bn128, compress, poseidon)
* add TODO for feature gate. remove validate from compress
* add feature gate
* fix one more error case
* all changes under feature gate
* revert removing from()
* return unexpected errors in lib
* add comment to remove error types, once the feature gate is activated
* remove unnecessary/impossible error
* fix mispelled comments