Commit Graph

44 Commits

Author SHA1 Message Date
Michael Vines 995d4a029f Remove tokio dev-dependency 2021-03-16 18:33:37 -07:00
Michael Vines c63d854ac7 Switch to Instruction::new_with_bincode 2021-03-16 18:33:37 -07:00
Jon Cinque 9c12b50703
Update solana-program to 1.5.11 (#1362)
* Update solana-program to 1.5.11

* Update all programs
2021-03-02 19:19:50 +01:00
Jon Cinque d536460d3f
stake-pool: Fix stake split and withdraw token calculation (#1352)
* Fix stake split and withdraw token calculation

* Cargo fmt
2021-03-01 21:39:21 +00:00
Jon Cinque 833ea9324d
stake-pool-cli: Fix update command, add verbosity (#1345)
* stake-pool-cli: Fix update command, add verbosity

The update command in the stake pool CLI was passing the validator vote
account instead of the associated stake account from the pool, causing
it to fail.  Additionally, add more verbose logging, and a dry-run mode
to get simulate transaction information, useful for debugging CLI
failures.

* Run cargo fmt
2021-02-27 00:57:38 +01:00
Jon Cinque d74b8c8f0a
stake-pool-cli: Update RPC client per TODO (#1304)
* Update deployed stake pool program id

* Add validator account takes 1 SOL instead of 1 lamport

* Fix "update" command for empty validator list

* Update dependencies

* Revert consequential changes

* Run cargo fmt

* Revert sdk

* Revert Cargo.lock
2021-02-23 00:28:06 +01:00
Jon Cinque d31cd78a54
stake-pool: Validator stake account initialized with 1 SOL (#1305)
* stake-pool: Validator stake account initialized with 1 SOL

A validator stake account only has 1 lamport, which means that it will
gain very few rewards per epoch.  Its credits_observed is not
be reset each epoch, which makes it practically impossible to merge
into.  Get around this by instantiating them with more stake.

* Cargo fmt + fix tests
2021-02-22 23:50:05 +01:00
dependabot[bot] 5b4c62ce49
build(deps): bump solana-program from 1.5.6 to 1.5.8 (#1261)
Bumps [solana-program](https://github.com/solana-labs/solana) from 1.5.6 to 1.5.8.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.5.6...v1.5.8)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-17 23:56:18 +00:00
dependabot[bot] 0caba7d549
build(deps): bump serde from 1.0.120 to 1.0.121 (#1258)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.120 to 1.0.121.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.120...v1.0.121)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-17 22:17:04 +00:00
Trent Nelson 188c03e9a1 chore: bump solana crates to 1.5.6 2021-02-11 16:30:03 -07:00
Atticlab LLC 11df4aa5ec
Various postponed fixes and changes to the stake pool program (#1200)
* Various postponed fixes and changes to the stake pool program

* Fixed PR comments

* Fixed no-signature validator stake account add test

Co-authored-by: Yuriy Savchenko <yuriy.savchenko@gmail.com>
2021-02-10 17:42:28 +01:00
Yuriy Savchenko 13826294ef
Stake pool: test coverage for most of the program errors (#1134)
* Stake pool: test coverage for most of the program errors

* Fixes to stake pool tests PR comments
2021-01-27 23:35:25 +01:00
Jon Cinque 14daf0d370
Stake pool: adding pool balance confirmation (Redo of #960) (#1116)
* Added validator stake account list storage, deprecated old tests

* Added join and leave stake pool instructions, error messages refactoring

* Stake pool tests refactoring, tests for join and leave pool added

* Added validator stake account creation instruction, join/leave pool instructions renamed, version field added

* Formatting fixes

* Added update list/pool instructions (no tests yet), updated deposit instruction logic, claim instruction removed, refactoring

* Updated deposit logic and tests, updated withdraw logic and added tests, refactoring

* Stake pool CLI updated to work with new deposit/withdraw instructions, claim usage removed

* Added validator stake account management and balance update commands to the stake pool CLI, updated dependency versions, updated devnet program address

* Merge conflicts fixed

* Removed deprecated tests

* Fixes for review comments

* Additional program id checks across the code

* Formatting errors fixed

* Changed minimum stake balance in CLI, removed deprecated tests, removed check for stake history id

* Added TODO for stake account warmup status check

* Cargo.lock conflict fix

* Formatting fixed

* Update Cargo lock file for CI

* Pin themis version of subtle

Co-authored-by: Yuriy Savchenko <yuriy.savchenko@gmail.com>
2021-01-21 14:48:46 +01:00
dependabot[bot] 86af1b771a
Bump serde from 1.0.117 to 1.0.118 (#1004)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.117 to 1.0.118.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.117...v1.0.118)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-11 08:55:02 +08:00
dependabot[bot] 7b81c0d3c0
build(deps): bump solana-program from 1.5.0 to 1.5.1 (#1025)
Bumps [solana-program](https://github.com/solana-labs/solana) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.5.0...v1.5.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-04 13:51:29 +00:00
Michael Vines 8ae34d2137 Update to Solana 1.5.0 2020-12-17 21:24:30 -08:00
Yuriy Savchenko c03f45ec30
Multi-account withdraw added the stake-pool CLI (#895)
* Multi-account withdraw added the stake-pool CLI

* Multi-account withdraw refactoring in stake-pool cli, added merge of multiple claim accounts

* Fixed formatting

* Added tests to stake pool CLI withdraw accounts selection

* Formatting fixed

* Clippy warnings fixed
2020-12-03 11:11:56 +01:00
Michael Vines 158fa1dea6 Upgrade to Solana v1.4.14 2020-12-03 05:39:55 +00:00
Michael Vines a477895f02 program-test now adds SPL Token automatically 2020-12-03 05:39:55 +00:00
dependabot[bot] 6aa1d8cce1
Bump solana-program from 1.4.9 to 1.4.13 (#916)
Bumps [solana-program](https://github.com/solana-labs/solana) from 1.4.9 to 1.4.13.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.4.9...v1.4.13)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-02 12:54:42 +00:00
Yuriy Savchenko 90698e4be9
Added negative tests for stake pool (#857)
* Added negative tests for stake pool

* Claim refactoring, error codes fixed

* Linter errors fixed
2020-11-18 22:47:42 +01:00
Michael Vines c6a4ac9a82 Bump solana version to v1.4.9 2020-11-17 20:02:17 -08:00
Michael Vines f4af9054a2 Update to Solana 1.4.8 2020-11-14 02:35:20 +00:00
Jon Cinque b9fed1116b
stake-pool: Add end-to-end testing using ProgramTest (#828)
* WIP: stake-pool: Add end-to-end testing using ProgramTest

* Run cargo fmt

* Add deposit test and extra requirements

* Update Cargo.lock after rebuild

* Bring token program sdk version back to 1.4.7
2020-11-13 13:11:39 +01:00
Michael Vines 5030a87021 Upgrade to Solana 1.4.7 2020-11-12 11:05:20 -08:00
Yuriy Savchenko b9c2bbc275
Added set-staking-auth and set-owner commands to stake pool CLI (#827)
* Added set-staking-auth and set-owner commands to stake pool CLI

* Error handling refactored, fixed new fee owner setting, fixed set owner arg group settings

* Added check for fee account mint to stake pool initialization and set owner methods
2020-11-12 16:44:08 +01:00
dependabot[bot] b71456a8f1
Bump solana-program from 1.4.5 to 1.4.6 (#826)
Bumps [solana-program](https://github.com/solana-labs/solana) from 1.4.5 to 1.4.6.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.4.5...v1.4.6)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-11 12:39:52 +00:00
Yuriy Savchenko fec7794c22
Stake pool CLI added (#806)
* Implemented stake-pool CLI with create-pool, deposit, list and withdraw commands, fixed several bugs in underlying smart contract

* Several typos fixed, some error text clarifications.

* Fee parameter in stake pool creation changed into two: numarator and demoninator

* Refactoring to resolve pool request comments

* Added merge to stake_receiver account when claiming whole stake account

* Removed unused import

* Withdraw bump seed calculation fixed
2020-11-10 15:36:05 +01:00
Michael Vines 238eabc1d0 Bump solana version to v1.4.5 2020-11-06 21:29:04 -08:00
Yuriy Savchenko 87129a93ac
Added positive tests in stake pool and fixed several bugs in instructions (#788)
* Added positive tests for withdraw, claim, set owner, set authority, several bugs fixed

* Fixed PR comments

* Fixed constant with leading zero

* Deposit tests refactoring
2020-11-04 13:34:25 +01:00
Michael Vines 341149d0e9 Back to no-entrypoint feature name 2020-11-03 10:34:43 -08:00
Yuriy Savchenko 480f6604b7
Added missing accounts to the interface to call stake account program (#763)
* Interface accounts added as read-only, fixed mint authority on deposit, fixed stake pool stake deserializing

* Unit test refactoring, added success tests for deposit, updated stake account program id

* Warnings fixed

* Removed random key generation, used Pubkey::new_unique instead

* Imports optimization

* Unit test architecture updated to remove separate invoke_signed declarations

* Added missing accounts (sysvar clock and stake account program id) to calls to stake account program

* Fixed formatting

* Fixed stake pool deposit unit test

* Temporarily removed stake-pool cli from main workspace

* Fixed warning in token program

* Fixed warning in token program v3

* Fixed warnings in token swap program

* Fixed warning in token cli

* Sysvar and program id params reordered
2020-11-02 22:03:54 +01:00
Michael Vines 2b5e9d1286 Drop lifetimes 2020-11-01 20:48:15 -08:00
Michael Vines 9f4e6d8beb Update to solana v1.4.4 2020-11-01 20:48:15 -08:00
Yuriy Savchenko a5babd6cbe
Unit tests refactoring and success deposit test added to stake pool program (#718)
* Interface accounts added as read-only, fixed mint authority on deposit, fixed stake pool stake deserializing

* Unit test refactoring, added success tests for deposit, updated stake account program id

* Warnings fixed

* Removed random key generation, used Pubkey::new_unique instead

* Imports optimization

* Unit test architecture updated to remove separate invoke_signed declarations
2020-10-29 17:19:48 +01:00
Michael Vines 211f92e8c6 Groom Cargo.tomls 2020-10-25 07:52:33 +00:00
Michael Vines f9b4616bb6 Clean up stake-pool copypasta 2020-10-25 03:40:21 +00:00
Michael Vines 80e29ef6b9 Port SPL to solana-program and `cargo build-bpf` 2020-10-24 19:21:38 -07:00
Yuriy Savchenko 100e930f2c
Interface accounts added as read-only, fixed mint authority on deposit, fixed stake pool stake deserializing (#702) 2020-10-23 14:25:53 +02:00
Yuriy Savchenko bb54cf0dc6
Added stake pool instruction interface methods (#684)
* Added address type in programm address generation for the stake pool, renamed nonce to bump seed

* Formatting fixed

* Bump seed calculation moved to the smart contract, test for fee > 1 added, state length public constant added

* Added claim method to stake pool, fixed program address generation in token mint and burn calls

* Refactored signers management when calling other contracts

* Signers formation put back into calling functions, deposit/withdraw/claim method reworked, state serialization bug fixed

* Added instruction interface methods

* Fixed signer flags for accounts in stake pool instruction creation
2020-10-21 14:21:54 +02:00
Yuriy Savchenko df63d6a0f0
Stake pool improvements and fixes (#665)
* Added address type in programm address generation for the stake pool, renamed nonce to bump seed

* Formatting fixed

* Bump seed calculation moved to the smart contract, test for fee > 1 added, state length public constant added

* Added claim method to stake pool, fixed program address generation in token mint and burn calls

* Refactored signers management when calling other contracts

* Signers formation put back into calling functions, deposit/withdraw/claim method reworked, state serialization bug fixed
2020-10-20 21:02:05 +02:00
dependabot[bot] 1dfebe929d
Bump serde from 1.0.116 to 1.0.117 (#660)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.116 to 1.0.117.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.116...v1.0.117)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-19 13:47:45 +00:00
ysavchenko b5b3c56226
Changes to stake pool program address generation (#647)
* Added address type in programm address generation for the stake pool, renamed nonce to bump seed

* Formatting fixed
2020-10-19 13:26:05 +02:00
anatoly yakovenko 44b95aecdb
Token stake pool (#493)
* init

* instructions

* instruction progress

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* update

* wip

* update

* wip

* clippy

* builds

* builds

* wip test

* init testcargo fmt

* update

* wip stake instructions

* wip

* comment

* update

* update

* update

* init cli

* Address review comments

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2020-10-16 19:38:12 +02:00