241 Commits

Author SHA1 Message Date
Jeff Washington (jwash)
952c3bcbb7 AccountSharedData construction (#15790) 2021-03-11 18:09:04 -06:00
Trent Nelson
24d18b3cf2 docs: add docs links for crates published to crates.io 2021-03-11 08:38:18 +00:00
Jeff Washington (jwash)
52e54e1100 account.data -> data() (#15778) 2021-03-09 22:31:33 +00: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
Trent Nelson
7f7370c306 Re-allow clippy::integer_arithmetic at crate-level 2021-02-17 13:55:08 -07:00
Jon Cinque
3ac7e09de6 docs: Remove references to "create_address_with_seed" (#15339) 2021-02-17 14:25:02 +01:00
Tyera Eulberg
51c27dcc1c Clean & check stake (#15363)
* Add failing test

* Fix test

* Clean up redendant if case

* Demonstrate withdrawal boundaries

* Update test to fail on conditions that should be acceptable

* Fix test

* Add test for larger stake source

* Mirror changes for undelegated accounts

* Extra stake checks

* Split accounts must be the right size

Co-authored-by: Stephen Akridge <sakridge@gmail.com>
2021-02-17 03:42:46 +00:00
Tyera Eulberg
7e17a0d3bb Move fn to sdk 2021-02-16 19:25:00 -08:00
Trent Nelson
ae82b5ebfd stake: add lamports overflow test for withdraw 2021-02-15 11:09:51 -07:00
sakridge
08f94a2bd2 Stake program update (#15307) 2021-02-12 17:24:43 -08:00
Ryo Onodera
4e99aa5fa6 More failure codepath tracing (#15246) 2021-02-12 15:24:23 +09:00
Michael Vines
dc7041ba07 Require lockup authority to change withdraw authority on locked stake (#14861) 2021-02-05 22:40:07 -08:00
Ryo Onodera
c69027e5aa chore: bump serde from 1.0.118 to 1.0.122 (#15126)
* chore: bump serde from 1.0.118 to 1.0.122

* Update programs/bpf/Cargo.lock
2021-02-05 19:23:24 +09:00
dependabot[bot]
1df93fa2be chore: bump serde from 1.0.112 to 1.0.118 (#14828)
* chore: bump serde from 1.0.112 to 1.0.122

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.112 to 1.0.122.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.112...v1.0.122)

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

* [auto-commit] Update all Cargo lock files

* Update frozen_abi digest following serde update

* Revert "chore: bump serde from 1.0.112 to 1.0.122"

This reverts commit a3ef4442a4.

* Revert "[auto-commit] Update all Cargo lock files"

This reverts commit c41c3b005f.

* chore: bump serde from 1.0.112 to 1.0.118

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.112 to 1.0.118.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.112...v1.0.118)

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

* [auto-commit] Update all Cargo lock files

* Remove serum-dex pinning

* blind commit!

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: Ryo Onodera <ryoqun@gmail.com>
2021-02-02 23:28:16 +09: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
Michael Vines
2b50433099 Remove legacy_stake program 2021-01-25 19:34:40 -08:00
Trent Nelson
50710473a8 Deinitialize stake data upon zero balance 2020-12-22 19:37:26 -07:00
Trent Nelson
5b903318b2 vote: Add helper for creating current-versioned states 2020-12-22 19:37:26 -07: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
1e977ac025 Bump version to v1.6.0 2020-12-15 18:28:04 +00:00
Michael Vines
7143aaa89b Clippy 2020-12-14 08:03:29 -08:00
dependabot[bot]
88d950e5a8 chore: bump log from 0.4.8 to 0.4.11 (#13691)
* chore: bump log from 0.4.8 to 0.4.11

Bumps [log](https://github.com/rust-lang/log) from 0.4.8 to 0.4.11.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.8...0.4.11)

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2020-12-13 13:48:23 +09:00
Ryo Onodera
e81c2c826c Don't reset credits_observed due to stale voters (#13836)
* Don't reset credits_observed due to stale voters

* Add tests

* Fix comment
2020-11-30 22:47:34 +09:00
Ryo Onodera
6048342c57 Enhance ledger-tool for multi-epoch rewards (#13837)
* Support ledger-tool for multi-epoch rewards

* nits

* Ensure not to skip some records in csv
2020-11-27 04:20:47 +00:00
Ryo Onodera
42421e77a9 Add stake calculation tests with inflation/slashing (#13605)
* Add stake calculation tests with inflation/slashing

* Clean up the test
2020-11-25 12:49:35 +09:00
Tyera Eulberg
e3a92d6905 Prevent splitting when either source or split stake will equal zero (#13775) 2020-11-24 02:48:56 +00:00
Trent Nelson
488ce982f0 stake: Disallow stakes merging with themselves 2020-11-23 14:32:02 -07:00
Trent Nelson
6b9a019c0a stake: Remove disused test helper function 2020-11-23 14:32:02 -07:00
Trent Nelson
8e73187990 stake: Allow compatible, fully-active stake accounts to be merged 2020-11-23 14:32:02 -07:00
Trent Nelson
bb2772d068 stake: Cosmetic - rename variable 2020-11-23 14:32:02 -07:00
Trent Nelson
dc7f89715a stake: De-replicode mergable info extraction 2020-11-23 14:32:02 -07:00
Tyera Eulberg
38a3ed96bb Fail stake init if account data is the wrong size (#13767) 2020-11-23 20:13:38 +00:00
Tyera Eulberg
f0f99ffc7e Cap split stake at source stake when splitting entire balance (#13754) 2020-11-23 10:11:10 -07:00
Ryo Onodera
3bc7d85986 ledger-tool cap: output credits_observed (#13746) 2020-11-21 16:13:07 +00:00
Trent Nelson
13aa38d307 stake: Don't pay out rewards for epochs where inflation was not enabled 2020-11-21 04:16:27 +00:00
Ryo Onodera
43d5e47ea9 Rewrite stake accounts for clear migration (#13461)
* Reduce overage stake by rewritng stake accounts

* Write tests and finish implemention

* Create and use new feature gate

* Clean up logging

* Fix typo

* Simplify enable_rewrite_stake

* Fix typo...

* Even simplify gating

* Add metrics
2020-11-20 05:15:06 +09:00
Tyera Eulberg
39932d7664 Update Initialized split rent-exempt value (#13646) 2020-11-17 19:03:00 +00:00
Tyera Eulberg
a7bed62af0 Remove overflow opportunities (#13649) 2020-11-17 12:01:11 -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
Ryo Onodera
bcd303a447 ledger-tool cap: delegation owner and stake v2 flag (#13602)
* Output delegation owner as well

* Add --enable-stake-program-v2

* Small cleanup and add sanity assertion

* Fix typo...
2020-11-15 19:38:46 +00:00
Ryo Onodera
89b474e192 Fix slow/stuck unstaking due to toggling in epoch (#13501)
* Fix slow/stuck unstaking due to toggling in epoch

* nits

* nits

* Add stake_program_v2 feature status check to cli

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2020-11-11 14:11:57 -07:00
Ryo Onodera
5306eb93cc Clean up Delegation::stake_activating_and_deactivating (#13471) 2020-11-09 17:39:56 +09:00
Ryo Onodera
737d3e376d Clean up Delegation::stake_and_activating (#13460) 2020-11-08 17:19:27 +09:00
Ryo Onodera
a81e7e7749 Output more inflation calc details in ledger-tool (#13345)
* Output more inflation calc details in ledger-tool

* Fix broken ci...

* Rename confusing variables

* Fix panic by wrapping PointValue with Opiton...

* Minor modifications

* Remove explict needless flush; Drop already does

* Yet another csv field adjustments

* Add data_size and rename epochs to earned_epochs

* Introduce null_tracer

* Unwrap Option in new_from_parent_with_tracer

* Don't shorten identifiers

* Allow irrefutable_let_patterns temporalily

* More null_tracer

* More field adjustments
2020-11-08 16:43:50 +09:00
Tyera Eulberg
4c5f345798 Fix stake split rent-exempt adjustment (#13357)
* Add failing tests

* Fix stake split

* Calculate split rent-exempt-reserve and use

* Add comment in rent.rs

* Add tests for edge cases when splitting to larger accounts, and reject overflow splits

* Reframe InsufficientFunds checks in terms of lamports var

* Test hardening review comments
2020-11-06 20:32:05 +00:00