Alexander Meißner
4e65487d2f
Refactor: process_instruction() ( #20448 )
...
* Adds first_instruction_account parameter to process_instruction().
* Removes InvokeContext::remove_first_keyed_account() from all BPF loaders.
* Removes InvokeContext::remove_first_keyed_account() from all builtin programs.
* Removes InvokeContext::remove_first_keyed_account() from all mock ups.
* Deprecates InvokeContext::remove_first_keyed_account().
* Documents index base of keyed_account_at_index().
* Adds dynamic offset to call sites of "keyed_account_at_index()".
2021-10-08 11:41:07 +02:00
Jack May
5cf8d8795b
Feature cleanup ( #19528 )
2021-08-31 14:51:26 -07:00
Tyera Eulberg
74e89a3e3e
Add Stake checked tests
2021-07-06 21:53:18 +00:00
Tyera Eulberg
544f62c92f
Fix set-lockup custodian index
2021-07-06 21:53:18 +00:00
Michael Vines
ee219ffa47
Add vote/stake checked instructions
2021-07-06 21:53:18 +00: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
Jon Cinque
8f5e773caf
system-program: Remove zero lamport check on transfers ( #17726 )
...
* system-program: Move lamports == 0 check on transfers
* Address feedback
* Update stake split to explicitly allocate + assign
* Update stake tests referring to split instruction
* Revert whitespace
* Update split instruction index in test
* Remove unnecessary `assign_with_seed` from `split_with_seed`
* Fix stake instruction parser
* Update test to allow splitting into account with lamports
2021-06-06 01:45:45 +02:00
Michael Vines
2896fc3987
Make `initialize` public ( #17605 )
2021-05-31 00:14:50 -07: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
Trent Nelson
74ac6ab80f
stake: plumb `can_merge_expired_lockups` feature flag
2021-05-21 10:50:27 -06:00
jon-chuang
662c2aaeec
programs/stake: cancel deactivate ( #17344 )
...
fix: remove stray println
add error for inconsistent input.
fix: lamports don't need to match when redelegating to same vote account
Improve comments
bump
Apply suggestions from code review
Add assert in test
Use stake_program_v4
Co-Authored-By: Trent Nelson <trent.a.b.nelson@gmail.com>
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2021-05-21 05:31:55 +00:00
Tyera Eulberg
91f2b6185e
Prevent withrawing Initialized stake account to zero stake ( #17366 )
2021-05-21 02:01:08 +00:00
Jeff Washington (jwash)
fb0b76c1f3
account.owner = X -> account.set_owner(X) ( #16754 )
2021-04-23 12:34:22 -05:00
Alexander Meißner
9dfcb921cf
Refactoring: Move KeyedAccounts to InvokeContext ( #15410 )
...
Collects all parametric occurrences and the construction of keyed_accounts and puts them into InvokeContext.
2021-04-19 18:48:48 +02:00
Ryo Onodera
6d5c6c17c5
Simplify account.rent_epoch handling for sysvar rent ( #16049 )
...
* Add some code for special local testing
* Add comment to store_account_and_update_capitalization
* Simplify account.rent_epoch handling for sysvar rent
* Introduce *_for_test functions
* Add deprecation messages to existing api
2021-03-25 15:23:20 +09:00
Jeff Washington (jwash)
952c3bcbb7
AccountSharedData construction ( #15790 )
2021-03-11 18:09:04 -06:00
Jeff Washington (jwash)
8a3135d17b
Account->AccountSharedData ( #15691 )
2021-03-09 15:06:07 -06:00
Jack May
b53cb8eb2d
Deprecate Instruction::new ( #15695 )
2021-03-04 05:46:48 +00:00
sakridge
8399851d11
check program owners ( #15495 )
...
* check program owners
* BankSlotDelta should change because InstructionError variant added
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-02-26 22:21:34 +00:00
Jon Cinque
ebd43938a7
docs: Update stake merging documentation ( #15489 )
...
* Update stake merging documentation
* Integrate review feedback
* Integrate review feedback in comment too
2021-02-25 17:24:39 +01:00
Jon Cinque
3ac7e09de6
docs: Remove references to "create_address_with_seed" ( #15339 )
2021-02-17 14:25:02 +01:00
Michael Vines
dc7041ba07
Require lockup authority to change withdraw authority on locked stake ( #14861 )
2021-02-05 22:40:07 -08:00
Michael Vines
ff22091a98
Add StakeInstruction::Merge logging
2021-01-26 11:52:39 -08:00
Michael Vines
119e2c75dd
cli now supports a custodian for stake authorize operations
2021-01-26 11:48:28 -08:00
Michael Vines
8359f4f5ff
Include Clock sysvar in AuthorizeWithSeed instruction
2021-01-25 19:38:10 -08:00
Tyera Eulberg
7042f11791
Feature-gate stake-program-v3 ( #14232 )
...
* Remove deprecated legacy stake program
* Add legacy stake program
* Strip out duplicative legacy code
* Feature-deploy stake-program-v3
* Add ownership check in stake processor
2020-12-22 11:20:38 -07:00
Michael Vines
7143aaa89b
Clippy
2020-12-14 08:03:29 -08:00
Trent Nelson
8e73187990
stake: Allow compatible, fully-active stake accounts to be merged
2020-11-23 14:32:02 -07:00
Ryo Onodera
2b3faa1947
Reject faked stake/vote accounts in stake mgmt. ( #13615 )
...
* Reject faked stake/vote accounts in stake mgmt.
* Use clearer name
2020-11-17 05:42:59 +09:00
Michael Vines
df8dab9d2b
Native/builtin programs now receive an InvokeContext
2020-10-29 21:45:24 -07:00
Jack May
c458d4b213
move Account to solana-sdk ( #13198 )
2020-10-28 22:01:07 -07:00
Michael Vines
1b343665a1
Move KeyedAccount out of solana-program. Native programs are not supported by solana-program
2020-10-26 18:54:54 -07:00
Michael Vines
7bc073defe
Run `codemod --extensions rs Pubkey::new_rand solana_sdk::pubkey::new_rand`
2020-10-21 19:08:13 -07:00
Greg Fitzgerald
f02a78d8ff
Add StakeInstruction::AuthorizeWithSeed ( #11700 )
...
* Add StakeInstruction::AuthorizeWithSeed
* chore: add authorize-with-seed to web.js
* fix: add address_owner
* Add SystemInstruction::TransferWithSeed
* Update ABI hash
* chore: better variable names
* Add AuthorizeWithSeedArgs
* Reorder and rename arguments for clarity
2020-08-21 18:28:01 +00:00
Greg Fitzgerald
61d9d219f9
Withdraw authority no longer implies a custodian ( #11302 )
...
* Withdraw authority no longer implies a custodian
Before this change, if the withdraw authority and custodian had
the same public key, then a withdraw authority signature would
imply a custodian signature and lockup would be not be enforced.
After this change, the client's withdraw instruction must
explictly reference a custodian account in its optional sixth
account argument.
Likewise, the fee-payer no longer implies either a withdraw
authority or custodian.
* Fix test
The test was configuring the stake account with the fee-payer as
the withdraw authority, but then passing in a different key to
the withdraw instruction's withdraw authority parameter. It only
worked because the second transaction was signed by the fee-payer.
2020-07-31 13:37:53 -06:00
Jack May
dac7dc2f10
Move types to more appropriate files ( #10638 )
2020-06-17 10:39:14 -07:00
Michael Vines
60bc64629c
Add StakeInstruction::Merge ( #10503 )
...
automerge
2020-06-10 17:22:47 -07:00
Greg Fitzgerald
19d11800bf
Remove WithSigner ( #10325 )
...
automerge
2020-05-29 23:17:44 -07:00
Greg Fitzgerald
55a64712b9
Cleanup program docs ( #10283 )
2020-05-29 20:29:24 -06:00
Greg Fitzgerald
36a36d1c83
No longer allow create-account to add funds to an existing account ( #10192 )
...
automerge
2020-05-22 16:39:01 -07:00
Jack May
eb1acaf927
Remove archiver and storage program ( #9992 )
...
automerge
2020-05-14 18:22:47 -07:00
Jack May
a4fe11fad2
Remove old logging enabler artifacts ( #9777 )
...
automerge
2020-04-28 15:56:51 -07:00
Greg Fitzgerald
ba58589656
Relax setting withdraw authority during lockup ( #9644 )
...
automerge
2020-04-21 21:05:49 -07:00
Greg Fitzgerald
a6ad660e5e
Merge stake::withdraw instructions ( #9617 )
2020-04-20 18:16:50 -06:00
Jack May
268e04cb4a
Rename CustomError to Custom ( #9207 )
2020-04-01 09:01:11 -07:00
Tyera Eulberg
8dc4724340
Allow stake lockup fields to be updated independently ( #8568 )
...
* Make Lockup fields optional for SetLockup instruction
* Use LockupArgs in cli
* Include lockup timestamp in stake-account print
2020-03-02 12:28:43 -08:00
Michael Vines
45774dc4aa
Fix comment
2020-02-20 10:32:36 -07:00
Jack May
8436457e75
Rename program_utils.rs ( #8127 )
2020-02-05 12:48:30 -08:00
Rob Walker
e6803daf10
Remove support for stake redelegation ( #7995 )
...
* Remove support for stake redelegation
* fixup
2020-01-29 17:59:14 -08:00