Commit Graph

42 Commits

Author SHA1 Message Date
Ryo Onodera 0e4509c497
Small code cleanup and typo fixes (#13325)
* Small code cleanup and typo fixes

* Clean up calculate_points_and_credits
2020-11-02 10:28:24 +09: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
Rob Walker 7cc2a6801b
fix rewards points (#10914)
* fix rewards points

* fixups

* * verify that we don't spend more in rewards than we've allocated for rewards
* purge f64s from calculations that could be done with integers

* test typical values

* simplify iteration over delegations some

* fixups

* Use try_from

* Add a comment for commission_split()

* Add assertion to detect inconsistent reward dist.

* Fix vote_balance_and_staked

* Don't overwrite accounts with stale copies

* Fix CI...

* Add tests for vote_balance_and_staked

* Add test for the determinism of update_rewards

* Revert "Don't overwrite accounts with stale copies"

This reverts commit 9886d085a69d695f48970f48f2f567e62ba05414.

* Make stake_delegation_accounts to return hashmap

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2020-07-21 13:57:25 +09:00
Ryo Onodera 39b3ac6a8d
Introduce automatic ABI maintenance mechanism (2/2; rollout) (#8012)
* Introduce automatic ABI maintenance mechanism (2/2; rollout)

* Fix stable clippy

* Change to symlink

* Freeze abi of Tower

* fmt...

* Improve dev-experience!

* Update BankSlotDelta

$ diff -u /tmp/abi8/*7dg6BreYxTuxiVz6aLvk3p2Z7GQk2cJqfGvC9h4FAoSj* /tmp/abi8/*9chBcbXVJ4fK7uGgydQzam5aHipaAKFw6V4LDFpjbE4w*
--- /tmp/abi8/bank__BankSlotDelta_frozen_abi__test_abi_digest_7dg6BreYxTuxiVz6aLvk3p2Z7GQk2cJqfGvC9h4FAoSj      2020-06-18 18:01:22.831228087 +0900
+++ /tmp/abi8/bank__BankSlotDelta_frozen_abi__test_abi_digest_9chBcbXVJ4fK7uGgydQzam5aHipaAKFw6V4LDFpjbE4w      2020-07-03 15:59:58.430695244 +0900
@@ -140,7 +140,7 @@
                                                         field u8
                                                             primitive u8
                                                         field solana_sdk::instruction::InstructionError
-                                                            enum InstructionError (variants = 34)
+                                                            enum InstructionError (variants = 35)
                                                                 variant(0) GenericError (unit)
                                                                 variant(1) InvalidArgument (unit)
                                                                 variant(2) InvalidInstructionData (unit)
@@ -176,6 +176,7 @@
                                                                 variant(31) CallDepth (unit)
                                                                 variant(32) MissingAccount (unit)
                                                                 variant(33) ReentrancyNotAllowed (unit)
+                                                                variant(34) MaxSeedLengthExceeded (unit)
                                                     variant(9) CallChainTooDeep (unit)
                                                     variant(10) MissingSignatureForFee (unit)
                                                     variant(11) InvalidAccountIndex (unit)

* Fix some merge conflicts...
2020-07-06 20:22:23 +09:00
Michael Vines 60bc64629c
Add StakeInstruction::Merge (#10503)
automerge
2020-06-10 17:22:47 -07:00
Trent Nelson f9ee97d6f5 CLI: Improve stake (de)activation display 2020-05-27 14:21:09 -06:00
Kristofer Peterson 58ef02f02b
9951 clippy errors in the test suite (#10030)
automerge
2020-05-15 09:35:43 -07:00
Justin Starry b762319fc5
Correct comment stating lockup gates stake authorize ixs (#10063)
* Correct old comment stating lockup gates stake authorize ixs

* Delete dead stake code
2020-05-15 22:02:20 +08:00
Greg Fitzgerald 450f1d2867
Add set-lockup to solana-stake-accounts (#9827)
* Add a command to set lockups or authorize a new custodian on derived stake accounts

* Thanks clippy
2020-04-30 17:56:37 -06:00
Greg Fitzgerald ba58589656
Relax setting withdraw authority during lockup (#9644)
automerge
2020-04-21 21:05:49 -07:00
Greg Fitzgerald 31ebdbc77f
Don't subject authorizing a new stake authority to lockup (#9434) 2020-04-10 17:21:24 -06: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
Greg Fitzgerald c6a7f499ce
Allow withdrawer to change the authorized stake key (#8456) 2020-02-25 19:03:26 -07:00
carllin d821fd29d6
Add versioning (#8348)
automerge
2020-02-25 17:12:01 -08:00
Michael Vines 72b11081a4 Report validator rewards in getConfirmedBlock JSON RPC 2020-02-11 17:25:45 -07:00
Rob Walker e6803daf10
Remove support for stake redelegation (#7995)
* Remove support for stake redelegation

* fixup
2020-01-29 17:59:14 -08:00
Rob Walker 0d6c233747
Add set_lockup to stake (#7997) 2020-01-28 20:59:53 -08:00
Jack May c95e5346a4
Boot the mut (#7926) 2020-01-22 17:54:06 -08:00
Rob Walker 1e2b55c0d7
Remove RedeemVoteCredits (#7916)
* Move redeem_vote_credits into runtime

* Move redeem_vote_credits into runtime

* Remove RedeemVoteCredits

* chugga for less indentation

* resurrect NoCreditsToRedeem

* fixup
2020-01-22 16:53:42 -08:00
Rob Walker ce70d6eedc
Add redeem_vote_credits to runtime (#7910)
* Move redeem_vote_credits into runtime

* fixup

* test

* move stake manipulation to stake program

* chugga for less indentation
2020-01-22 12:21:31 -08:00
Jack May 023074650f
Allow the same account to be passed multiple times to a single instruction (#7795) 2020-01-22 09:11:56 -08:00
Rob Walker 7e1b380f01
Move vote_state current credits into epoch_credits (#7909)
* Move vote_state current credits into epoch_credits

* fixups

* fixup
2020-01-21 19:08:40 -08:00
Rob Walker cc299053cc
Add support for stake::split() via create_account_with_seed() (#7879)
* Add split with seed

* move to new system_program APIs

* de-replicode
2020-01-20 12:33:27 -08:00
Rob Walker 8dad3af36d
Update Lockup comments (#7692) 2020-01-06 19:52:20 -08:00
Rob Walker 63f185f9bf
Delete unused type (#7653) 2020-01-02 13:15:31 -08:00
Rob Walker e97b0088f2
Make lockups block stake transfers via rekeying (#7651) 2020-01-01 11:03:29 -08:00
Rob Walker a7040896f0
Update to rust 1.40.0 (#7572)
* Update to rust 1.40.0

* fixups
2019-12-19 23:27:54 -08:00
Rob Walker 3f405d8908
Add unix_timestap to stake lockups (#7569) 2019-12-19 14:37:47 -08:00
Rob Walker b22dc38ba1
Add support for split of 100% of stake (#7510) 2019-12-16 15:56:34 -08:00
Rob Walker 39cd6dff7d
turn on rent (#7368)
* turn on rent

* add rent exempt balances for bootstrap accounts

* use Rent::free() when not testing rent
2019-12-09 21:56:43 -08:00
Rob Walker 709bda5939
custodian signs withdraw (#7286) 2019-12-04 21:25:01 -08:00
Rob Walker ae93d574c2
commission as percent (#7239)
* commission_as_percent

* fixup
2019-12-03 20:55:04 -08:00
Rob Walker 369f37a0a4
genesis validators (#7235)
* genesis validators

* slp1 nodes get 500SOL

* no commission
2019-12-03 20:44:02 -08:00
Parth ba688cf629
enforce proper range for rent burn_percent (#7217)
* enforce proper range for burn_percent
2019-12-04 00:54:01 +05:30
Rob Walker ef64f00cbb
Revert "Revert "add genesis stake placeholders (#6969)" (#7109)" (#7124)
This reverts commit 702f7cc51d.
2019-11-25 15:11:55 -08:00
Rob Walker acbe89a159
shrink stakes (#7122) 2019-11-25 13:14:32 -08:00
anatoly yakovenko 702f7cc51d Revert "add genesis stake placeholders (#6969)" (#7109)
* Revert "add genesis stake placeholders (#6969)"

This reverts commit 8a879faac7.

* fixup! Revert "add genesis stake placeholders (#6969)"

* fixup! fixup! Revert "add genesis stake placeholders (#6969)"

* fixup! fixup! fixup! Revert "add genesis stake placeholders (#6969)"

* fixup! fixup! fixup! fixup! Revert "add genesis stake placeholders (#6969)"

* fmt
2019-11-23 23:15:21 -07:00
Rob Walker 8a879faac7
add genesis stake placeholders (#6969)
* add investor stake placeholders

fixups

fixups

review comments, fixups

make more data-looky for easier management

rent may be zero

rework with more tables, derived keys

fixups

rebase-fix

fixups

fixups

* genesis is now too big to boot in 10 seconds
2019-11-21 12:05:31 -08:00
Jack May d184d3a732
Merge native programs parts into one unit (#7047) 2019-11-20 10:12:43 -08:00