Commit Graph

184 Commits

Author SHA1 Message Date
Jon Cinque d336b8b714
stake-pool: Use checked_ceil_div for withdraw calc (#1482)
* stake-pool: Use checked_ceil_div for withdraw calc

When a stake account is totally removed from a stake pool by the
manager, there's a chance that the operation would not take enough of
the manager's pool tokens by 1 due to truncation.

Do a ceiling division instead, and refactor ceiling division into the
math library.

* Use new function name on CLI

* Cargo fmt
2021-03-23 00:33:51 +01:00
Tyera Eulberg ed4ef42c8b
Remove explicit tokio (#1470) 2021-03-18 20:38:09 +00:00
Vadim cd57d1cf10
Binary oracle implementation (#1347)
* oracle pair init

* update

* updates

* progress

* update

* update

* progress

* builds

* update

* progress

* update

* copy pasta

* Refactor and add Instruction serializing/deserializing

* Add pack/unpack for Pool struct

* Implement InitPool instruction

* Add unit test and refactor InitPool instruction

* Minor changes

* Add using deposing token mint decimals in pass and fail mints

* Add Deposit instruction processing

* Add test for Deposit instruction

* Add Withdraw instruction processing

* Add test for Withdraw instruction

* Add Decide instruction with test

* Changes in Withdraw instruciton and add time travel to Decide instruction test

* Fix clippy warning

* Fix warning with if operator

* Fix clippy warnings

* Update libs version and minor fixes

* Minor changes

* Add user_transfer_authority to withdraw instruction and other minor changes

* Fix clippy warns

* Change return value after serialization

* Update tokio and solana-program-test libs version

Co-authored-by: Anatoly Yakovenko <anatoly@solana.com>
2021-03-18 18:18:20 +01:00
Michael Vines 662f38f939 Bump Solana version to 1.6.1 2021-03-18 04:07:16 +00:00
Michael Vines 686444088b Bump Solana version to 1.5.15 2021-03-16 18:33:37 -07:00
Tyera Eulberg 82a385b7c3
Bump spl-token-cli for new release (#1463) 2021-03-16 18:24:04 -06:00
Justin Starry 4107c17a3b
Bump token-cli to v2.0.8 (#1458) 2021-03-16 17:44:36 -06:00
Michael Vines 723aacadb7 Pin Solana versions used by spl-token-cli 2021-03-16 15:07:56 -07:00
Tyera Eulberg 5aa0341478
Token cli: spl-token accounts improvements (#1440)
* Swap token/account to prep for display changes

* Refactor accounts parsing for deterministic order and to batch by mint

* Add Aux tags and gc alert

* Hide account addresses for non-verbose returns

* Review nits

* Set balance display len dynamically

* Bump solana version to reduce Account parse failures

* Fix aux width
2021-03-12 19:34:14 -07:00
Jon Cinque 8fd6f8ec55
CRUD program: create / update / delete (#1226)
* Add scaffolding

* Add create / update / delete instructions and tests

* Update SerializationError -> IOError and program id

* Address review feedback

* Make initialize work with `create_with_seed`

* Cargo fmt

* Use offset for writing

* Update crud -> record

* More feedback

* Remove rent

* Update program id

* Use official Solana crates 1.5.10

* Update Cargo lock and toml

* Cargo fmt

* Update record program version to 1.5.11

* Bump compute budget
2021-03-06 00:20:06 +01:00
Tyera Eulberg 4f50c512f9
Bump token-cli to v2.0.7 (#1366) 2021-03-02 12:31:58 -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
dependabot[bot] 1e5b376df6
build(deps): bump serde_json from 1.0.61 to 1.0.62 (#1265)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.61 to 1.0.62.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.61...v1.0.62)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 02:07:29 +00:00
dependabot[bot] 8fd665c271
build(deps): bump assert_matches from 1.4.0 to 1.5.0 (#1264)
Bumps [assert_matches](https://github.com/murarth/assert_matches) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/murarth/assert_matches/releases)
- [Commits](https://github.com/murarth/assert_matches/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 01:37:57 +00:00
dependabot[bot] e1f1ff0283
build(deps): bump borsh-derive from 0.7.2 to 0.8.1 (#1263)
Bumps [borsh-derive](https://github.com/nearprotocol/borsh) from 0.7.2 to 0.8.1.
- [Release notes](https://github.com/nearprotocol/borsh/releases)
- [Commits](https://github.com/nearprotocol/borsh/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 01:05:43 +00:00
dependabot[bot] 17ea31a05b
build(deps): bump serde_yaml from 0.8.15 to 0.8.17 (#1262)
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.8.15 to 0.8.17.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.8.15...0.8.17)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 00:26:38 +00: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] b476c962ce
build(deps): bump solana-cli-config from 1.5.6 to 1.5.8 (#1260)
Bumps [solana-cli-config](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:23:27 +00:00
dependabot[bot] cfe1cac2aa
build(deps): bump log from 0.4.13 to 0.4.14 (#1259)
Bumps [log](https://github.com/rust-lang/log) from 0.4.13 to 0.4.14.
- [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.13...0.4.14)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-17 22:48:50 +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
Greg Fitzgerald b0f02e136c
Unbreak build (#1257)
* Unbreak build

I rewrote history in a dependency. Update to the latest.

* Attempt to remove program_ristretto from the build
2021-02-17 14:43:16 -07:00
Trent Nelson 2316b6092e chore: token - bump version to 3.1.0 2021-02-11 16:30:03 -07:00
Trent Nelson 188c03e9a1 chore: bump solana crates to 1.5.6 2021-02-11 16:30:03 -07:00
Jon Cinque beb4aa7e7f
spl-math: Add separate package to test instruction usage (#1205)
* Refactor to use spl-math

* Run cargo fmt

* Fixup fuzz

* Add spl math program

* Add u64-based approximation

* Cleanup

* Downgrade solana sdk for CI

* Move U256 impl to stable curve

* Remove generic newtonian, use traits

* Cargo fmt

* Move math/program -> libraries/math

* Revert Cargo.lock changes

* Add u128 instruction count tests

* cargo fmt
2021-02-10 17:40:54 +01:00
Jon Cinque b26491552f
token-swap: Add version to state (#985)
* Add version to token swap state

* Fix fuzz

* Cargo fmt

* Revert solana localnet version

* Update enum dispatch
2021-02-04 15:22:33 +01:00
Tyera Eulberg 190e664dd1
Add initial signed-memo program (#1135)
* Initial s-memo

* Populate readme

* Add signed-memo to spl docs

* Log less, fail faster

* Replace and bump memo

* Update memo id

* Add memo prefix and len

* Add test that demonstrates compute bounds

* Add logging and compute to memo docs
2021-01-28 12:21:21 -07:00
Trent Nelson 81e86172e1 Token: Remove program-v3 2021-01-26 00:23:07 +00: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] 977ac9c1e7
build(deps): bump futures from 0.3.9 to 0.3.11 (#1073)
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.9 to 0.3.11.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.9...0.3.11)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-14 22:44:58 +00:00
Jon Cinque fd24042815
Pin honggfuzz to 0.5.52 (#1072) 2021-01-14 23:07:07 +01:00
dependabot[bot] 68778f9548
build(deps): bump serde_yaml from 0.8.14 to 0.8.15 (#1069)
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.8.14 to 0.8.15.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.8.14...0.8.15)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-14 13:11:55 +00:00
dependabot[bot] c1d49de8b2
build(deps): bump solana-logger from 1.5.1 to 1.5.3 (#1066)
Bumps [solana-logger](https://github.com/solana-labs/solana) from 1.5.1 to 1.5.3.
- [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.1...v1.5.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-14 12:36:43 +00:00
dependabot[bot] 7e3b469fc3
build(deps): bump futures from 0.3.8 to 0.3.9 (#1052)
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.8 to 0.3.9.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.8...0.3.9)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-11 02:20:08 +00:00
dependabot[bot] 7e8c36ef78
build(deps): bump solana-cli-config from 1.5.1 to 1.5.2 (#1051)
Bumps [solana-cli-config](https://github.com/solana-labs/solana) from 1.5.1 to 1.5.2.
- [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.1...v1.5.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-11 01:32:56 +00:00
dependabot[bot] c1de655e4f
Bump console from 0.13.0 to 0.14.0 (#1005)
Bumps [console](https://github.com/mitsuhiko/console) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Changelog](https://github.com/mitsuhiko/console/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/console/compare/0.13.0...0.14.0)

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:38 +08: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
Jon Cinque ffe206357b
lending: Add owner and host fees (#965)
* lending: Add owner and host fees to layout and instructions

* Add fees math

* Run cargo fmt

* Assess fees only on borrow

* Fmt and clippy fix

* Fixup instruction comment numbering

* Add proptest and end-to-end tests for fees

* Address review feedback

* Add minimum tests

* Move host to the back of borrow

* Add error to borrow fee calculation
2021-01-06 22:35:43 +01: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
dependabot[bot] cdfefc195c
build(deps): bump thiserror from 1.0.22 to 1.0.23 (#1024)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.22 to 1.0.23.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.22...1.0.23)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-04 13:16:31 +00:00
dependabot[bot] b08ed21332
build(deps): bump solana-cli-config from 1.5.0 to 1.5.1 (#1023)
Bumps [solana-cli-config](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 12:39:08 +00:00
dependabot[bot] 3a4f9ca655
Bump cbindgen from 0.15.0 to 0.16.0 (#1007)
Bumps [cbindgen](https://github.com/eqrion/cbindgen) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/eqrion/cbindgen/releases)
- [Changelog](https://github.com/eqrion/cbindgen/blob/master/CHANGES)
- [Commits](https://github.com/eqrion/cbindgen/compare/v0.15.0...v0.16.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-04 02:48:05 +00:00
dependabot[bot] 489051c201
Bump serde_yaml from 0.8.13 to 0.8.14 (#1006)
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.8.13 to 0.8.14.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.8.13...0.8.14)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-04 02:09:23 +00:00
dependabot[bot] c64d43180a
Bump serde_json from 1.0.59 to 1.0.61 (#983)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.59 to 1.0.61.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.59...v1.0.61)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-04 01:33:47 +00:00
dependabot[bot] 1ba4d8f9c4
Bump futures from 0.3.5 to 0.3.8 (#850)
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.5 to 0.3.8.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.5...0.3.8)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-04 08:57:25 +08:00
dependabot[bot] f281424518
Bump solana_rbpf from 0.1.34 to 0.2.2 (#942)
Bumps [solana_rbpf](https://github.com/solana-labs/rbpf) from 0.1.34 to 0.2.2.
- [Release notes](https://github.com/solana-labs/rbpf/releases)
- [Commits](https://github.com/solana-labs/rbpf/compare/v0.1.34...v0.2.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-04 08:56:10 +08:00
Jon Cinque d14e403599
lending: Add test to generate and optionally dump genesis accounts (#967)
* Automate primordial accounts

* Add genesis account dumping as test

* Add test-dump-genesis-accounts feature flag to create state

* Run cargo fmt

* Delete gitignore

* Add test-bpf feature to genesis test

Co-authored-by: Justin Starry <justin@solana.com>
2020-12-28 19:15:50 +01:00
Justin Starry 891b6794f3
Introduce SPL Token Lending (#696)
* Add spl-token-lending

* lending-client

* cargo clippy

* Limit bpf tests

* Enable lending bpf tests

* Remove obligation signer requirement

* Fix token lending js cli test

* Fix
2020-12-19 08:17:07 +08:00
Jon Cinque 942bf77c90
token-swap: Add proptest for deposit draining (#959)
* Add deposit drain proptest

* Add special logic for constant price curve normalized value when close to u128

* Cargo fmt

* Fix bpf build
2020-12-18 13:32:34 +01:00
Michael Vines d0d2a22545 Disable tests that link directly with the BPF VM. 2020-12-17 21:24:30 -08:00
Michael Vines 8ae34d2137 Update to Solana 1.5.0 2020-12-17 21:24:30 -08:00