Commit Graph

38 Commits

Author SHA1 Message Date
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
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
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
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
Trent Nelson 81e86172e1 Token: Remove program-v3 2021-01-26 00:23:07 +00: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
Michael Vines d0d2a22545 Disable tests that link directly with the BPF VM. 2020-12-17 21:24:30 -08:00
Jon Cinque b40e0dd3fd
token-swap: Add fuzzer for swap / withdraw / deposit (#875)
* token-swap: Add fuzzer for swap / withdraw / deposit

* Run cargo fmt

* Make end-to-end testing work

* Fix test failures

* Cleanup for review

* Remove Clone trait for Initialize

* Fix building fuzz targets

* Fix fuzz withdraw logic to avoid ZeroTradingTokens error

* Cargo fmt

* Clippy / fmt again

* Integrate fuzzer in main workspace to share clippy / fmt

* Fix clippy

* Switch to stable honggfuzz that could work with BPF

* Update to most recent honggfuzz

* Add build / run requirements

* Add fuzz CI and cleanup for honggfuzz

* Revert to using fuzz feature to integrate with workspace

* Make fuzz script executable

* Refactor and cleanup

* Add nightly run

* Fix workflow typo

* Add runtime for pull request fuzz workflow

* Fix unrelated new clippy errors
2020-11-30 13:01:31 +01:00
Michael Vines 2ce4817ac3 Add spl-feature-proposal-cli 2020-11-18 19:59:23 +00:00
Michael Vines c4ec3b3120 Feature Proposal program 2020-11-14 05:08:31 +00:00
Jack May 7d4e51399a
Add Rust examples (#815) 2020-11-11 00:01:10 -08: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 e0a6292bd6 Employ test-bpf feature to make 'cargo test' pass 2020-11-06 21:29:04 -08:00
Michael Vines bd03af18b5 Exclude associated-token-account/program from workspace until cargo test works for it 2020-11-05 13:42:48 -08:00
Michael Vines 4da9cb3631 Add associated-token-account program 2020-11-03 04:13:36 +00:00
Michael Vines b0554c534a sort 2020-11-01 21:13:52 -08:00
Michael Vines 8dd09c7530 Add token-perf-mon into the workspace 2020-11-01 20:48:15 -08:00
Greg Fitzgerald 6906200174
Cleanup themis (#742)
* Cleanup themis

* Speed up seeding fee-payers
* Add utility functions

* Remove BN variant of themis
2020-10-27 16:57:09 -06:00
Michael Vines 80e29ef6b9 Port SPL to solana-program and `cargo build-bpf` 2020-10-24 19:21:38 -07:00
Michael Vines f9516badc2
Update Cargo.toml 2020-10-23 10:05:20 -07: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
Jack May 08d9999f99
add shared-memory program (#611)
* add shared-memory program

* add offset and reduce shared object size
2020-10-14 23:50:57 +00:00
Justin Starry a4f09fe05e
SPL token lending scaffolding (#582)
* Scaffolding for spl-token-lending program

* Scaffolding for TS client
2020-10-09 13:29:51 +08:00
Greg Fitzgerald b020dd29c1
Add Ristretto version of THEMIS (#566)
* Add Ristretto version of THEMIS

BN BPF instruction counts:
  CalculateAggregate:    83,511
  SubmitProofDecryption: 33,755,027

Ristretto BPF instruction counts:
  CalculateAggregate:    13,049,558
  SubmitProofDecryption: 13,149,232

* Fix CI script
2020-10-05 18:49:38 -06:00
Trent Nelson 0b995a293b Re-add spl-token-cli to workspace 2020-10-01 11:47:12 -06:00
Greg Fitzgerald acc0c62f9b
Add Themis using the BN curve (#549)
* Add THEMIS Policy Contract

* Add test with 128 ads

* Add instructions

* Allow clients to work concurrently

* pub(crate) utils to find unused code

* Remove serde_json dep

* Drop dependency on primitive_types

* Add a simpler inner_product

* Use elgamal for proof verification

* Migrate to Ristretto

Also, use Serde for instruction serialization

* Add remaining instructions to processor

* Remove rand 0.6 dependency

* Add instruction constructors

* Add e2e test

* Move client test out of BPF build

* Add BPF instruction count test

Shows us that serde makes too many recursive calls and causes
a very high instruction count (Vec<U256> becomes impractical).

* Use Borsh serialization and test calculate_aggregate()

Bump BPF instruction count limits after upgrading compiler

* Test SubmitProofDecryption BPF instruction count

* Remove CompressedRistretto

This drops SubmitProofDecryption instructions by ~2.5M.

Also, box up more RistrettoPoints, because they're huge (120 bytes) and
blow up the BPF stack.

* Add transaction size metrics and update BPF counts

* Switch back to BN

* Add benchmarking

* Use configured keypair path
* Make num_users configurable
* Make testnet benchmark an example, not a test

* Exclude themis client from CI build

Because of Travis failure on itertools dependency
2020-09-30 21:33:29 -06:00
Tyera Eulberg a8df113101
Add token/program2 for next changeset (#412)
* Add token/program2 for next changeset

* Use version number instead of index
2020-09-10 16:04:50 -06:00
Jack May 0637e358bc
Add back token perf monitor (#380) 2020-09-01 17:27:11 -07:00
Michael Vines 0a47a3127c Move c header generation out of build.rs 2020-08-27 23:32:07 -07:00
Michael Vines 73e2455d60 Relocate test-client 2020-08-27 23:32:07 -07:00
Michael Vines 2815165c14 Relocate program2 into program 2020-08-26 23:10:18 -07:00
Michael Vines e440466311 Add token program2 2020-08-14 22:50:18 +00:00
Michael Vines 50cd2956f8 Adjust path to account-decoder 2020-08-14 01:22:11 +00:00
Michael Vines 96f9b0cdc6 Adapt spl-token cli to Solana 1.3.2 2020-08-14 01:22:11 +00:00
Michael Vines 26ab9bb26a Reorganize crates based on program 2020-08-08 15:25:47 -07:00
Michael Vines 60a7174c6e Move patch section 2020-08-08 08:05:00 -07:00
Michael Vines bb39d50390 Add token-cli 2020-08-08 08:05:00 -07:00
Michael Vines c6042f68f7 Add top-level workspace 2020-08-08 08:05:00 -07:00