From 6314bd605597a951c57b3f1b2e297a4917d5104d Mon Sep 17 00:00:00 2001 From: Arrowana Date: Mon, 17 Jul 2023 14:17:09 +1000 Subject: [PATCH] Jupiter changes for jupiter-core compat --- Cargo.lock | 1616 +++++++++++++---- Cargo.toml | 19 +- common/Cargo.toml | 2 + common/src/base_amm.rs | 2 + common/src/consts.rs | 2 +- common/src/deposit_sol.rs | 13 + common/src/deposit_stake.rs | 6 + common/src/pool_pair.rs | 110 +- common/src/withdraw_stake.rs | 6 + .../stakedex_interface/src/instructions.rs | 102 +- libs/lido/Cargo.toml | 6 +- libs/lido/src/lib.rs | 2 +- libs/lido/src/stakedex_traits/base.rs | 6 +- .../src/stakedex_traits/withdraw_stake.rs | 16 +- libs/marinade/Cargo.toml | 2 +- libs/marinade/src/stakedex_traits/base.rs | 6 +- .../src/stakedex_traits/deposit_sol.rs | 8 +- .../src/stakedex_traits/deposit_stake.rs | 8 +- libs/socean_stake_pool/Cargo.toml | 5 +- libs/socean_stake_pool/src/lib.rs | 4 +- .../src/stakedex_traits/base.rs | 6 +- .../src/stakedex_traits/deposit_sol.rs | 5 + .../src/stakedex_traits/deposit_stake.rs | 5 + .../src/stakedex_traits/withdraw_stake.rs | 13 +- libs/spl_stake_pool/Cargo.toml | 7 +- libs/spl_stake_pool/src/lib.rs | 3 +- .../src/stakedex_traits/base.rs | 4 + .../src/stakedex_traits/deposit_sol.rs | 9 +- .../src/stakedex_traits/deposit_stake.rs | 14 +- .../src/stakedex_traits/withdraw_stake.rs | 22 +- libs/unstake_it/Cargo.toml | 4 +- libs/unstake_it/src/stakedex_traits/base.rs | 4 + .../src/stakedex_traits/deposit_stake.rs | 15 +- stakedex_sdk/Cargo.toml | 7 +- stakedex_sdk/src/lib.rs | 83 +- stakedex_sdk/tests/test_main.rs | 28 +- 36 files changed, 1592 insertions(+), 578 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b89aa6c..b754168 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,7 +43,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if", - "cipher 0.3.0", + "cipher", "cpufeatures", "opaque-debug", ] @@ -56,7 +56,7 @@ checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" dependencies = [ "aead", "aes", - "cipher 0.3.0", + "cipher", "ctr", "polyval", "subtle", @@ -81,6 +81,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", + "getrandom 0.2.11", "once_cell", "version_check", "zerocopy", @@ -140,6 +141,129 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint 0.4.4", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint 0.4.4", + "num-traits", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint 0.4.4", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "array-bytes" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" + [[package]] name = "arrayref" version = "0.3.7" @@ -152,6 +276,12 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + [[package]] name = "asn1-rs" version = "0.5.2" @@ -197,11 +327,22 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + [[package]] name = "async-compression" -version = "0.3.15" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" +checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" dependencies = [ "brotli", "flate2", @@ -331,9 +472,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.3.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec", @@ -713,16 +854,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - [[package]] name = "clap" version = "2.34.0" @@ -763,6 +894,28 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "console" version = "0.15.7" @@ -804,9 +957,9 @@ checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" [[package]] name = "constant_time_eq" -version = "0.1.5" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "core-foundation" @@ -916,7 +1069,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" dependencies = [ - "cipher 0.3.0", + "cipher", ] [[package]] @@ -933,6 +1086,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 1.0.70", + "quote 1.0.33", + "strsim 0.10.0", + "syn 2.0.41", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core", + "quote 1.0.33", + "syn 2.0.41", +] + [[package]] name = "data-encoding" version = "2.5.0" @@ -977,6 +1165,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 1.0.109", +] + [[package]] name = "dialoguer" version = "0.10.4" @@ -1009,27 +1208,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "displaydoc" version = "0.2.4" @@ -1128,31 +1306,19 @@ dependencies = [ [[package]] name = "enum-iterator" -version = "0.8.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2953d1df47ac0eb70086ccabf0275aa8da8591a28bd358ee2b52bd9f9e3ff9e9" +checksum = "9fd242f399be1da0a5354aa462d57b4ab2b4ee0683cc552f7c007d2d12d36e94" dependencies = [ "enum-iterator-derive", ] [[package]] name = "enum-iterator-derive" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" -dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 1.0.109", -] - -[[package]] -name = "enum_dispatch" -version = "0.3.12" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" +checksum = "03cdc46ec28bd728e67540c528013c6a10eb69a02eb31078a1bda695438cbfb8" dependencies = [ - "once_cell", "proc-macro2 1.0.70", "quote 1.0.33", "syn 2.0.41", @@ -1325,15 +1491,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -1387,6 +1544,17 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "goblin" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" +dependencies = [ + "log", + "plain", + "scroll", +] + [[package]] name = "h2" version = "0.3.22" @@ -1406,6 +1574,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + [[package]] name = "hashbrown" version = "0.11.2" @@ -1460,6 +1637,12 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "histogram" version = "0.6.9" @@ -1562,15 +1745,16 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ + "futures-util", "http", "hyper", - "rustls", + "rustls 0.21.10", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -1596,6 +1780,12 @@ dependencies = [ "cc", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.5.0" @@ -1644,23 +1834,24 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.16.2" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" dependencies = [ "console", - "lazy_static", + "instant", "number_prefix", - "regex", + "portable-atomic", + "unicode-width", ] [[package]] -name = "inout" -version = "0.1.3" +name = "instant" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "generic-array", + "cfg-if", ] [[package]] @@ -1753,27 +1944,6 @@ version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - -[[package]] -name = "libredox" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" -dependencies = [ - "bitflags 2.4.1", - "libc", - "redox_syscall", -] - [[package]] name = "libsecp256k1" version = "0.6.0" @@ -1825,24 +1995,18 @@ dependencies = [ [[package]] name = "lido" version = "1.3.6" -source = "git+https://github.com/igneous-labs/solido?branch=mod/2.0.0-loose-deps#a45f702331c5e5effdcc657ce0cee78bee433f15" +source = "git+https://github.com/jup-ag/solido.git?rev=2c85ddf7b50d8162d2b81d79d7fcbfd5e05dc967#2c85ddf7b50d8162d2b81d79d7fcbfd5e05dc967" dependencies = [ "arrayref", - "borsh 0.9.3", + "borsh 0.10.3", "num-derive 0.3.3", "num-traits", "serde", "serde_derive", "solana-program", - "spl-token", + "spl-token 3.5.0", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.4.12" @@ -1868,9 +2032,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "marinade_finance_interface" version = "0.0.0" -source = "git+https://github.com/igneous-labs/marinade_finance_interface?rev=d625979#d625979d145831f9261f76777501d0037e83fd9d" +source = "git+https://github.com/jup-ag/marinade_finance_interface?rev=5747b5350c5505fc2ea597c3f8ae1f8cf71c363d#5747b5350c5505fc2ea597c3f8ae1f8cf71c363d" dependencies = [ - "borsh 0.9.3", + "borsh 0.10.3", "solana-program", ] @@ -1891,9 +2055,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ "autocfg", ] @@ -1953,14 +2117,15 @@ dependencies = [ [[package]] name = "nix" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", - "memoffset 0.6.5", + "memoffset 0.7.1", + "pin-utils", ] [[package]] @@ -2099,7 +2264,25 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", +] + +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive 0.7.2", ] [[package]] @@ -2115,8 +2298,32 @@ dependencies = [ ] [[package]] -name = "number_prefix" -version = "0.4.0" +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.41", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate 2.0.1", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.41", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" @@ -2185,6 +2392,12 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "pbkdf2" version = "0.4.0" @@ -2256,6 +2469,12 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "polyval" version = "0.5.3" @@ -2268,6 +2487,12 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "powerfmt" version = "0.2.0" @@ -2381,17 +2606,16 @@ dependencies = [ [[package]] name = "quinn" -version = "0.8.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b435e71d9bfa0d8889927231970c51fb89c58fa63bffcab117c9c7a41e5ef8f" +checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e" dependencies = [ "bytes", - "futures-channel", - "futures-util", - "fxhash", + "pin-project-lite", "quinn-proto", "quinn-udp", - "rustls", + "rustc-hash", + "rustls 0.20.9", "thiserror", "tokio", "tracing", @@ -2400,17 +2624,16 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.8.4" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fce546b9688f767a57530652488420d419a8b1f44a478b451c3d1ab6d992a55" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" dependencies = [ "bytes", - "fxhash", "rand 0.8.5", "ring 0.16.20", - "rustls", + "rustc-hash", + "rustls 0.20.9", "rustls-native-certs", - "rustls-pemfile 0.2.1", "slab", "thiserror", "tinyvec", @@ -2420,16 +2643,15 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.1.4" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07946277141531aea269befd949ed16b2c85a780ba1043244eda0969e538e54" +checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" dependencies = [ - "futures-util", "libc", "quinn-proto", "socket2 0.4.10", - "tokio", "tracing", + "windows-sys 0.42.0", ] [[package]] @@ -2558,9 +2780,9 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", "ring 0.16.20", @@ -2577,17 +2799,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_users" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" -dependencies = [ - "getrandom 0.2.11", - "libredox", - "thiserror", -] - [[package]] name = "regex" version = "1.10.2" @@ -2628,12 +2839,12 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.11" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "async-compression", - "base64 0.13.1", + "base64 0.21.5", "bytes", "encoding_rs", "futures-core", @@ -2645,25 +2856,26 @@ dependencies = [ "hyper-rustls", "ipnet", "js-sys", - "lazy_static", "log", "mime", + "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-pemfile 1.0.4", + "rustls 0.21.10", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", + "webpki-roots 0.25.3", "winreg", ] @@ -2726,14 +2938,23 @@ dependencies = [ [[package]] name = "rpassword" -version = "6.0.1" +version = "7.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf099a1888612545b683d2661a1940089f6c2e5a8e38979b2159da876bfd956" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" dependencies = [ "libc", - "serde", - "serde_json", - "winapi", + "rtoolbox", + "windows-sys 0.48.0", +] + +[[package]] +name = "rtoolbox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" +dependencies = [ + "libc", + "windows-sys 0.48.0", ] [[package]] @@ -2813,6 +3034,18 @@ dependencies = [ "webpki", ] +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring 0.17.7", + "rustls-webpki", + "sct", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -2820,27 +3053,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.4", + "rustls-pemfile", "schannel", "security-framework", ] [[package]] name = "rustls-pemfile" -version = "0.2.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.13.1", + "base64 0.21.5", ] [[package]] -name = "rustls-pemfile" -version = "1.0.4" +name = "rustls-webpki" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "base64 0.21.5", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] @@ -2883,6 +3117,26 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.41", +] + [[package]] name = "sct" version = "0.7.1" @@ -2981,15 +3235,25 @@ dependencies = [ ] [[package]] -name = "serde_yaml" -version = "0.8.26" +name = "serde_with" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" dependencies = [ - "indexmap 1.9.3", - "ryu", "serde", - "yaml-rust", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling", + "proc-macro2 1.0.70", + "quote 1.0.33", + "syn 2.0.41", ] [[package]] @@ -3123,12 +3387,12 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec508f4e850660671b731ce98f2178db93ce194176fb6be6b87d059612b93649" +checksum = "b5763ba7519b166b152ca2c6f8defa22cd07d3aea42a3a86b74519857fc3d464" dependencies = [ "Inflector", - "base64 0.13.1", + "base64 0.21.5", "bincode", "bs58", "bv", @@ -3139,18 +3403,18 @@ dependencies = [ "solana-address-lookup-table-program", "solana-config-program", "solana-sdk", - "solana-vote-program", - "spl-token", - "spl-token-2022", + "spl-token 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-2022 0.9.0", + "spl-token-metadata-interface 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", "zstd", ] [[package]] name = "solana-address-lookup-table-program" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e5db47bee67c11d12b19c8c47799c567bc4acf587336d11f5f476a86bae7d4" +checksum = "18a216474b9d25153d629aa7f4fb2246bc875ebe90e1155380e0436c209e62d5" dependencies = [ "bincode", "bytemuck", @@ -3169,9 +3433,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3261cc6ea60cc94a37fa30ba3ddd9dd0250bdef48f8848fcd6dd9e505f780bb7" +checksum = "2bef7e2234cf1179b8ceadfae922d38d79f82932a762ff62b0051e0b3205984f" dependencies = [ "chrono", "clap 2.34.0", @@ -3185,81 +3449,44 @@ dependencies = [ "url", ] -[[package]] -name = "solana-cli-config" -version = "1.14.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0c995a86c637d1b7be272e53cc9ac31b73537b9b20f0435dda14c3c6cd4530" -dependencies = [ - "dirs-next", - "lazy_static", - "serde", - "serde_derive", - "serde_yaml", - "solana-clap-utils", - "solana-sdk", - "url", -] - [[package]] name = "solana-client" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c09424bf56b4546b6a47789cc499d91443d5e30bf880c599653dc4ed8570b010" +checksum = "2644f5a0c91f8c44db175d35d52bf772799597dbedf6a5d9f138d61e2b52b826" dependencies = [ - "async-mutex", "async-trait", - "base64 0.13.1", "bincode", - "bs58", - "bytes", - "clap 2.34.0", - "crossbeam-channel", - "enum_dispatch", "futures", "futures-util", "indexmap 1.9.3", "indicatif", - "itertools", - "jsonrpc-core", - "lazy_static", "log", "quinn", - "quinn-proto", "rand 0.7.3", - "rand_chacha 0.2.2", "rayon", - "reqwest", - "rustls", - "semver", - "serde", - "serde_derive", - "serde_json", - "solana-account-decoder", - "solana-clap-utils", - "solana-faucet", + "solana-connection-cache", "solana-measure", "solana-metrics", - "solana-net-utils", + "solana-pubsub-client", + "solana-quic-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-rpc-client-nonce-utils", "solana-sdk", "solana-streamer", - "solana-transaction-status", - "solana-version", - "solana-vote-program", - "spl-token-2022", + "solana-thin-client", + "solana-tpu-client", + "solana-udp-client", "thiserror", "tokio", - "tokio-stream", - "tokio-tungstenite", - "tungstenite", - "url", ] [[package]] name = "solana-config-program" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b7a6c34cc91ed15785c7c48b06d6d20cf7332d7151793fc28203648ecc1ba7" +checksum = "3bb9b6d2c575e1eecd85380cb6442525a0d2639afa627552264eaa7050f47fb3" dependencies = [ "bincode", "chrono", @@ -3270,38 +3497,35 @@ dependencies = [ ] [[package]] -name = "solana-faucet" -version = "1.14.29" +name = "solana-connection-cache" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a99af8c43ce00d9c5dd5a141f4e1098717a6464e1a434615435fa73c87bced11" +checksum = "dcd27f413c3702ee20bbf1152e928f9adff0a37fef0f36b956d4eb34aae2be71" dependencies = [ + "async-trait", "bincode", - "byteorder", - "clap 2.34.0", - "crossbeam-channel", + "futures-util", + "indexmap 1.9.3", "log", - "serde", - "serde_derive", - "solana-clap-utils", - "solana-cli-config", - "solana-logger", + "rand 0.7.3", + "rayon", + "rcgen", + "solana-measure", "solana-metrics", "solana-sdk", - "solana-version", - "spl-memo", "thiserror", "tokio", ] [[package]] name = "solana-frozen-abi" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2623f65dae901566617eaf9255697c0fea8c012282e85ad86dd79c7133dff767" +checksum = "a7077f6495ccc313dff49c3e3f3ed03e49058258bae7fee77ac29ba0a474ba82" dependencies = [ - "ahash 0.7.7", + "ahash 0.8.6", "blake3", - "block-buffer 0.9.0", + "block-buffer 0.10.4", "bs58", "bv", "byteorder", @@ -3309,7 +3533,6 @@ dependencies = [ "either", "generic-array", "getrandom 0.1.16", - "hashbrown 0.12.3", "im", "lazy_static", "log", @@ -3329,21 +3552,21 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f90f630bb756af28f703c217fd5e14661dd5ec33cf2471276d0279130feba74" +checksum = "f516f992211a2ab70de5c367190575c97e02d156f9f1d8b76886d673f30e88a2" dependencies = [ "proc-macro2 1.0.70", "quote 1.0.33", "rustc_version", - "syn 1.0.109", + "syn 2.0.41", ] [[package]] name = "solana-logger" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cadbbc900718637b8d0df476d71f3164d758058871007be52b94378db6025c0" +checksum = "7b64def674bfaa4a3f8be7ba19c03c9caec4ec028ba62b9a427ec1bf608a2486" dependencies = [ "env_logger", "lazy_static", @@ -3352,9 +3575,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7508f3c00c603e74ef3c4f5573eb16c95346abd5ecacd4f8a39ad067759c0d" +checksum = "932db6604bcf8ba3bba68e80564d7eaa0dd7b9667407e15c3557caa83203aee7" dependencies = [ "log", "solana-sdk", @@ -3362,9 +3585,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290e46753130565328f3a29579d4e66500246cfc588baad0049d7f64b1c2b5fe" +checksum = "5d81931f224798c0e52062b0683a07eebe1c1904954c8765773c9802a28fbd0c" dependencies = [ "crossbeam-channel", "gethostname", @@ -3376,9 +3599,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71b008373d85ed080912b9d79b6ae5f763333ac95e54376abcc37a6142f8ab01" +checksum = "7ea3420fa9da3789548f31b3c68e6a090bfd1320c735289851b711546d38e3b0" dependencies = [ "bincode", "clap 3.2.25", @@ -3398,11 +3621,11 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6bddec7064948e31bdef8229ceaef2e7fa62bcc4bd63d4b39f62d6b38fc733" +checksum = "5859de708bd12fb189f3c161cda03fdd341ffcf6be4fe787c7d730a30d589ac6" dependencies = [ - "ahash 0.7.7", + "ahash 0.8.6", "bincode", "bv", "caps", @@ -3425,16 +3648,21 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19350699312e8c6f92d56c899cb40e45e86d97815b26608ea9bde69648548e44" +checksum = "3e92350aa5b42564681655331e7e0b9d5c99a442de317ceeb4741efbbe9a6c05" dependencies = [ - "base64 0.13.1", + "ark-bn254", + "ark-ec", + "ark-ff", + "ark-serialize", + "array-bytes", + "base64 0.21.5", "bincode", "bitflags 1.3.2", "blake3", + "borsh 0.10.3", "borsh 0.9.3", - "borsh-derive 0.9.3", "bs58", "bv", "bytemuck", @@ -3449,7 +3677,8 @@ dependencies = [ "libc", "libsecp256k1", "log", - "memoffset 0.6.5", + "memoffset 0.9.0", + "num-bigint 0.4.4", "num-derive 0.3.3", "num-traits", "parking_lot", @@ -3474,20 +3703,20 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2500588aecf80caac49748a78c394bf5b3ca35fba1c290bade952447837f4e87" +checksum = "3da0e9dd63326ded2055b42e54aa37baa6aeb8adaea658a0059c234af6d05c02" dependencies = [ - "base64 0.13.1", + "base64 0.21.5", "bincode", "eager", "enum-iterator", "itertools", "libc", - "libloading", "log", "num-derive 0.3.3", "num-traits", + "percentage", "rand 0.7.3", "rustc_version", "serde", @@ -3496,14 +3725,68 @@ dependencies = [ "solana-measure", "solana-metrics", "solana-sdk", + "solana_rbpf", + "thiserror", +] + +[[package]] +name = "solana-pubsub-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d1ad6fa8f0e154b91e67969fdf5478e74b75a87d5e3dce14ab83f4cb2f60f1" +dependencies = [ + "crossbeam-channel", + "futures-util", + "log", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tungstenite", + "url", +] + +[[package]] +name = "solana-quic-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de9426ee9c0f98522242d6656db18175a022959af0b8ed3f170729e29933cf08" +dependencies = [ + "async-mutex", + "async-trait", + "futures", + "itertools", + "lazy_static", + "log", + "quinn", + "quinn-proto", + "quinn-udp", + "rcgen", + "rustls 0.20.9", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-net-utils", + "solana-rpc-client-api", + "solana-sdk", + "solana-streamer", "thiserror", + "tokio", ] [[package]] name = "solana-rayon-threadlimit" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f28aba2b77cc7330ba963277ac4a2338c2560ddb46023b1a825ffd43dd5f4e6" +checksum = "c3e6c7a43e34d7db0ad158690b331df15b92f6996e3b9b03629591a54fc3e97f" dependencies = [ "lazy_static", "num_cpus", @@ -3511,9 +3794,9 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "178522ee999b97a45e42dc2ebc8f1f112337774d24438fba7f54b489ba03af62" +checksum = "ed87a28ede1536be71352e13965b1fe7a2cf205e3e4fae2eef8a3407219ba1cd" dependencies = [ "console", "dialoguer", @@ -3529,34 +3812,96 @@ dependencies = [ ] [[package]] -name = "solana-sdk" -version = "1.14.29" +name = "solana-rpc-client" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdde2c0b0e210fb013cbc0ecb73967ab77333e4304ce816a73cb258d4a2e1176" +checksum = "f273acbce4493bc1de8174b94cfaee112b72263ae1684a6e13890f5004be53fb" dependencies = [ - "assert_matches", - "base64 0.13.1", + "async-trait", + "base64 0.21.5", "bincode", - "bitflags 1.3.2", - "borsh 0.9.3", "bs58", - "bytemuck", - "byteorder", - "chrono", - "derivation-path", - "digest 0.10.7", - "ed25519-dalek", - "ed25519-dalek-bip32", - "generic-array", - "hmac 0.12.1", - "itertools", - "js-sys", - "lazy_static", - "libsecp256k1", + "indicatif", "log", - "memmap2", - "num-derive 0.3.3", - "num-traits", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk", + "solana-transaction-status", + "solana-version", + "solana-vote-program", + "tokio", +] + +[[package]] +name = "solana-rpc-client-api" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4462198830687b83870985db945c5d49c720d83abf516c8206fefba12cca689d" +dependencies = [ + "base64 0.21.5", + "bs58", + "jsonrpc-core", + "reqwest", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-sdk", + "solana-transaction-status", + "solana-version", + "spl-token-2022 0.9.0", + "thiserror", +] + +[[package]] +name = "solana-rpc-client-nonce-utils" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91b3abad7b1ffd4b29d33b7525ebbc2ec8d0ca5928e4d8f28e364928d68a8dd9" +dependencies = [ + "clap 2.34.0", + "solana-clap-utils", + "solana-rpc-client", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-sdk" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2087e15c92d4d6b3f085dc12fbe9614141c811f90a54cc418240ac30b608133f" +dependencies = [ + "assert_matches", + "base64 0.21.5", + "bincode", + "bitflags 1.3.2", + "borsh 0.10.3", + "bs58", + "bytemuck", + "byteorder", + "chrono", + "derivation-path", + "digest 0.10.7", + "ed25519-dalek", + "ed25519-dalek-bip32", + "generic-array", + "hmac 0.12.1", + "itertools", + "js-sys", + "lazy_static", + "libsecp256k1", + "log", + "memmap2", + "num-derive 0.3.3", + "num-traits", + "num_enum 0.6.1", "pbkdf2 0.11.0", "qstring", "rand 0.7.3", @@ -3567,6 +3912,7 @@ dependencies = [ "serde_bytes", "serde_derive", "serde_json", + "serde_with", "sha2 0.10.8", "sha3 0.10.8", "solana-frozen-abi", @@ -3581,23 +3927,25 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42288b67d0f503ee6606777b3fb8ceeee7087ed7a8b3a0317edb1cd20d3d206b" +checksum = "2e0e0e7ee984b0f9179a1d4f4e9e67ce675de2324b5a98b61d2bdb61be3c19bb" dependencies = [ "bs58", "proc-macro2 1.0.70", "quote 1.0.33", "rustversion", - "syn 1.0.109", + "syn 2.0.41", ] [[package]] name = "solana-streamer" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a1e560c22a5705d3bc29d7e4fcc80b863db5fe7e23b4dba9caa7ccda69780d" +checksum = "a868a782cab696677cd12deacda1862dbeeba903a4a8d8404a4d6bf45e8a556c" dependencies = [ + "async-channel", + "bytes", "crossbeam-channel", "futures-util", "histogram", @@ -3610,9 +3958,11 @@ dependencies = [ "percentage", "pkcs8", "quinn", + "quinn-proto", + "quinn-udp", "rand 0.7.3", "rcgen", - "rustls", + "rustls 0.20.9", "solana-metrics", "solana-perf", "solana-sdk", @@ -3621,16 +3971,56 @@ dependencies = [ "x509-parser", ] +[[package]] +name = "solana-thin-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222f5539a4b01a5374c919e78aca5d4472fa5af6e551bf9f4ddd97ca59374f6d" +dependencies = [ + "bincode", + "log", + "rayon", + "solana-connection-cache", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", +] + +[[package]] +name = "solana-tpu-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c0f954b48dda0a907dbdb54387459c8eb7e9c702f278bf70a2caf3ebc417c88" +dependencies = [ + "async-trait", + "bincode", + "futures-util", + "indexmap 1.9.3", + "indicatif", + "log", + "rand 0.7.3", + "rayon", + "solana-connection-cache", + "solana-measure", + "solana-metrics", + "solana-pubsub-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk", + "thiserror", + "tokio", +] + [[package]] name = "solana-transaction-status" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "724b7a2f40494a64ca4dfb409475293d1a4a0d21d907b0a00cd5267a5c01d8c8" +checksum = "7992d9605a65967b5e40e6ef8e285a953888e4789f0f5e3fb7339bf018cbb677" dependencies = [ "Inflector", - "base64 0.13.1", + "base64 0.21.5", "bincode", - "borsh 0.9.3", + "borsh 0.10.3", "bs58", "lazy_static", "log", @@ -3639,22 +4029,34 @@ dependencies = [ "serde_json", "solana-account-decoder", "solana-address-lookup-table-program", - "solana-measure", - "solana-metrics", "solana-sdk", - "solana-vote-program", - "spl-associated-token-account", - "spl-memo", - "spl-token", - "spl-token-2022", + "spl-associated-token-account 2.2.0", + "spl-memo 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-2022 0.9.0", + "thiserror", +] + +[[package]] +name = "solana-udp-client" +version = "1.16.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4329dfe364cb276c7137b459e3737a27d6ae180f60d0aa2274d8be86cac3472c" +dependencies = [ + "async-trait", + "solana-connection-cache", + "solana-net-utils", + "solana-sdk", + "solana-streamer", "thiserror", + "tokio", ] [[package]] name = "solana-version" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81e7b27783d74f75eb5a232b87de693b8c9ce4717f42e455c3cb544266a2a4b6" +checksum = "1931390daf0938c072c167611a263a8b95c13476d7fff7c8eb12789a981685b3" dependencies = [ "log", "rustc_version", @@ -3668,9 +4070,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d2ba3c43c2af6439c4da844f1ea76e426e1306624cc747c1e6b777d0d66c42" +checksum = "25669860e2c5e821a8caa5372589289fbb6ac3084096133fdd1c6af6546536a2" dependencies = [ "bincode", "log", @@ -3682,6 +4084,7 @@ dependencies = [ "solana-frozen-abi", "solana-frozen-abi-macro", "solana-metrics", + "solana-program", "solana-program-runtime", "solana-sdk", "thiserror", @@ -3689,17 +4092,15 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.14.29" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af14aa817cf4aadef7488d6e3df9403f4ea0cb91c83b60bc0bb20d34a68d05f2" +checksum = "1457c85ab70a518438b9ac2b0c56037b9f6693060dfb617bbb93c7116e4f0c22" dependencies = [ "aes-gcm-siv", - "arrayref", - "base64 0.13.1", + "base64 0.21.5", "bincode", "bytemuck", "byteorder", - "cipher 0.4.4", "curve25519-dalek", "getrandom 0.1.16", "itertools", @@ -3718,6 +4119,25 @@ dependencies = [ "zeroize", ] +[[package]] +name = "solana_rbpf" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17d4ba1e58947346e360fabde0697029d36ba83c42f669199b16a8931313cf29" +dependencies = [ + "byteorder", + "combine", + "goblin", + "hash32", + "libc", + "log", + "rand 0.8.5", + "rustc-demangle", + "scroll", + "thiserror", + "winapi", +] + [[package]] name = "spin" version = "0.5.2" @@ -3751,8 +4171,91 @@ dependencies = [ "num-derive 0.3.3", "num-traits", "solana-program", - "spl-token", - "spl-token-2022", + "spl-token 3.5.0", + "spl-token-2022 0.6.1", + "thiserror", +] + +[[package]] +name = "spl-associated-token-account" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385e31c29981488f2820b2022d8e731aae3b02e6e18e2fd854e4c9a94dc44fc3" +dependencies = [ + "assert_matches", + "borsh 0.10.3", + "num-derive 0.4.1", + "num-traits", + "solana-program", + "spl-token 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-2022 0.9.0", + "thiserror", +] + +[[package]] +name = "spl-discriminator" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cce5d563b58ef1bb2cdbbfe0dfb9ffdc24903b10ae6a4df2d8f425ece375033f" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator-derive 0.1.1", +] + +[[package]] +name = "spl-discriminator" +version = "0.1.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator-derive 0.1.0", +] + +[[package]] +name = "spl-discriminator-derive" +version = "0.1.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "quote 1.0.33", + "spl-discriminator-syn 0.1.0", + "syn 2.0.41", +] + +[[package]] +name = "spl-discriminator-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadbefec4f3c678215ca72bd71862697bb06b41fd77c0088902dd3203354387b" +dependencies = [ + "quote 1.0.33", + "spl-discriminator-syn 0.1.1", + "syn 2.0.41", +] + +[[package]] +name = "spl-discriminator-syn" +version = "0.1.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "solana-program", + "syn 2.0.41", + "thiserror", +] + +[[package]] +name = "spl-discriminator-syn" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e5f2044ca42c8938d54d1255ce599c79a1ffd86b677dfab695caa20f9ffc3f2" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "sha2 0.10.8", + "syn 2.0.41", "thiserror", ] @@ -3768,7 +4271,20 @@ dependencies = [ "num-traits", "solana-program", "thiserror", - "uint", + "uint 0.8.5", +] + +[[package]] +name = "spl-math" +version = "0.2.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "borsh 0.10.3", + "num-derive 0.4.1", + "num-traits", + "solana-program", + "thiserror", + "uint 0.9.5", ] [[package]] @@ -3781,25 +4297,142 @@ dependencies = [ ] [[package]] -name = "spl-stake-pool" -version = "0.6.4" +name = "spl-memo" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-memo" +version = "4.0.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-pod" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "027ca58e3b61c000dcc264878d4b6fd98f6f89ad363d91e972c11abf167168c5" +checksum = "2881dddfca792737c0706fa0175345ab282b1b0879c7d877bad129645737c079" +dependencies = [ + "borsh 0.10.3", + "bytemuck", + "solana-program", + "solana-zk-token-sdk", + "spl-program-error 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "spl-pod" +version = "0.1.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "borsh 0.10.3", + "bytemuck", + "solana-program", + "solana-zk-token-sdk", + "spl-program-error 0.3.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", +] + +[[package]] +name = "spl-program-error" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "249e0318493b6bcf27ae9902600566c689b7dfba9f1bdff5893e92253374e78c" +dependencies = [ + "num-derive 0.4.1", + "num-traits", + "solana-program", + "spl-program-error-derive 0.3.1", + "thiserror", +] + +[[package]] +name = "spl-program-error" +version = "0.3.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "num-derive 0.4.1", + "num-traits", + "solana-program", + "spl-program-error-derive 0.3.0", + "thiserror", +] + +[[package]] +name = "spl-program-error-derive" +version = "0.3.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "solana-program", + "syn 2.0.41", +] + +[[package]] +name = "spl-program-error-derive" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5269c8e868da17b6552ef35a51355a017bd8e0eae269c201fef830d35fa52c" +dependencies = [ + "proc-macro2 1.0.70", + "quote 1.0.33", + "sha2 0.10.8", + "syn 2.0.41", +] + +[[package]] +name = "spl-stake-pool" +version = "0.7.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" dependencies = [ "arrayref", "bincode", - "borsh 0.9.3", - "num-derive 0.3.3", + "borsh 0.10.3", + "num-derive 0.4.1", "num-traits", - "num_enum", + "num_enum 0.7.2", "serde", "serde_derive", "solana-program", - "spl-math", - "spl-token", + "spl-math 0.2.0", + "spl-pod 0.1.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-token-2022 0.8.0", "thiserror", ] +[[package]] +name = "spl-tlv-account-resolution" +version = "0.3.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator 0.1.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-pod 0.1.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-program-error 0.3.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-type-length-value 0.3.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", +] + +[[package]] +name = "spl-tlv-account-resolution" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-pod 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-program-error 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-type-length-value 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "spl-token" version = "3.5.0" @@ -3810,7 +4443,36 @@ dependencies = [ "bytemuck", "num-derive 0.3.3", "num-traits", - "num_enum", + "num_enum 0.5.11", + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-token" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08459ba1b8f7c1020b4582c4edf0f5c7511a5e099a7a97570c9698d4f2337060" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.3.3", + "num-traits", + "num_enum 0.6.1", + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-token" +version = "4.0.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.4.1", + "num-traits", + "num_enum 0.7.2", "solana-program", "thiserror", ] @@ -3825,19 +4487,145 @@ dependencies = [ "bytemuck", "num-derive 0.3.3", "num-traits", - "num_enum", + "num_enum 0.5.11", + "solana-program", + "solana-zk-token-sdk", + "spl-memo 3.0.1", + "spl-token 3.5.0", + "thiserror", +] + +[[package]] +name = "spl-token-2022" +version = "0.8.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.4.1", + "num-traits", + "num_enum 0.7.2", + "solana-program", + "solana-zk-token-sdk", + "spl-memo 4.0.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-pod 0.1.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-token 4.0.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-token-metadata-interface 0.2.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-transfer-hook-interface 0.2.0", + "spl-type-length-value 0.3.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "thiserror", +] + +[[package]] +name = "spl-token-2022" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive 0.4.1", + "num-traits", + "num_enum 0.7.2", "solana-program", "solana-zk-token-sdk", - "spl-memo", - "spl-token", + "spl-memo 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-pod 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-metadata-interface 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-transfer-hook-interface 0.3.0", + "spl-type-length-value 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", ] +[[package]] +name = "spl-token-metadata-interface" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" +dependencies = [ + "borsh 0.10.3", + "solana-program", + "spl-discriminator 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-pod 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-program-error 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-type-length-value 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "spl-token-metadata-interface" +version = "0.2.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "borsh 0.10.3", + "solana-program", + "spl-discriminator 0.1.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-pod 0.1.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-program-error 0.3.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-type-length-value 0.3.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.2.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "arrayref", + "bytemuck", + "solana-program", + "spl-discriminator 0.1.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-pod 0.1.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-program-error 0.3.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-tlv-account-resolution 0.3.0", + "spl-type-length-value 0.3.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +dependencies = [ + "arrayref", + "bytemuck", + "solana-program", + "spl-discriminator 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-pod 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-program-error 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-tlv-account-resolution 0.4.0", + "spl-type-length-value 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "spl-type-length-value" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a468e6f6371f9c69aae760186ea9f1a01c2908351b06a5e0026d21cfc4d7ecac" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-pod 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-program-error 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "spl-type-length-value" +version = "0.3.0" +source = "git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9#a3996814cb44eab2834f72113b742c875ac7b1b9" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator 0.1.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-pod 0.1.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", + "spl-program-error 0.3.0 (git+https://github.com/solana-labs/solana-program-library.git?rev=a3996814cb44eab2834f72113b742c875ac7b1b9)", +] + [[package]] name = "stakedex_deposit_sol_interface" version = "0.1.0" dependencies = [ - "borsh 0.9.3", + "borsh 0.10.3", "serde", "solana-program", ] @@ -3846,7 +4634,7 @@ dependencies = [ name = "stakedex_deposit_stake_interface" version = "0.1.0" dependencies = [ - "borsh 0.9.3", + "borsh 0.10.3", "serde", "solana-program", ] @@ -3855,7 +4643,7 @@ dependencies = [ name = "stakedex_interface" version = "0.1.0" dependencies = [ - "borsh 0.9.3", + "borsh 0.10.3", "num-derive 0.4.1", "num-traits", "serde", @@ -3869,11 +4657,11 @@ version = "0.1.0" dependencies = [ "anyhow", "bincode", - "borsh 0.9.3", + "borsh 0.10.3", "lido", "solana-client", "solana-program", - "spl-token", + "spl-token 3.5.0", "stakedex_deposit_sol_interface", "stakedex_sdk_common", "stakedex_withdraw_stake_interface", @@ -3884,10 +4672,10 @@ name = "stakedex_marinade" version = "0.1.0" dependencies = [ "anyhow", - "borsh 0.9.3", + "borsh 0.10.3", "marinade_finance_interface", "solana-program", - "spl-token", + "spl-token 3.5.0", "stakedex_deposit_sol_interface", "stakedex_deposit_stake_interface", "stakedex_sdk_common", @@ -3904,8 +4692,8 @@ dependencies = [ "solana-account-decoder", "solana-client", "solana-sdk", - "spl-associated-token-account", - "spl-token", + "spl-associated-token-account 1.1.3", + "spl-token 3.5.0", "stakedex_interface", "stakedex_lido", "stakedex_marinade", @@ -3922,11 +4710,12 @@ dependencies = [ "anyhow", "bincode", "jupiter-amm-interface", + "rand 0.8.5", "rust_decimal", "sanctum-macros", "solana-program", "solana-sdk", - "spl-token", + "spl-token 3.5.0", "stakedex_deposit_sol_interface", "stakedex_interface", "thiserror", @@ -3938,10 +4727,10 @@ version = "0.1.0" dependencies = [ "anyhow", "bincode", - "borsh 0.9.3", + "borsh 0.10.3", "solana-program", "spl-stake-pool", - "spl-token", + "spl-token 3.5.0", "stakedex_deposit_sol_interface", "stakedex_deposit_stake_interface", "stakedex_sdk_common", @@ -3954,11 +4743,11 @@ version = "0.1.0" dependencies = [ "anyhow", "bincode", - "borsh 0.9.3", + "borsh 0.10.3", "lazy_static", "solana-program", "spl-stake-pool", - "spl-token", + "spl-token 3.5.0", "stakedex_deposit_sol_interface", "stakedex_deposit_stake_interface", "stakedex_sdk_common", @@ -3971,8 +4760,8 @@ version = "0.1.0" dependencies = [ "anyhow", "solana-program", - "spl-math", - "spl-token", + "spl-math 0.1.0", + "spl-token 3.5.0", "stakedex_deposit_stake_interface", "stakedex_sdk_common", "unstake_it_interface", @@ -3982,7 +4771,7 @@ dependencies = [ name = "stakedex_withdraw_stake_interface" version = "0.1.0" dependencies = [ - "borsh 0.9.3", + "borsh 0.10.3", "serde", "solana-program", ] @@ -4068,6 +4857,27 @@ dependencies = [ "unicode-xid 0.2.4", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tap" version = "1.0.1" @@ -4230,11 +5040,21 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls", + "rustls 0.20.9", "tokio", "webpki", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.10", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.14" @@ -4254,12 +5074,12 @@ checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" dependencies = [ "futures-util", "log", - "rustls", + "rustls 0.20.9", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", "tungstenite", "webpki", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] @@ -4369,13 +5189,13 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls", + "rustls 0.20.9", "sha-1", "thiserror", "url", "utf-8", "webpki", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] @@ -4396,6 +5216,18 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + [[package]] name = "unicode-bidi" version = "0.3.14" @@ -4445,12 +5277,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + [[package]] name = "unstake_it_interface" version = "0.1.0" -source = "git+https://github.com/igneous-labs/unstake_it_interface?rev=8819194#881919454ae7b0a846d0cbfa3345f12962f6cf5b" +source = "git+https://github.com/jup-ag/unstake_it_interface?rev=c0b6e9742f7f4fd345c57e2fe3edf8fa0f0b858b#c0b6e9742f7f4fd345c57e2fe3edf8fa0f0b858b" dependencies = [ - "borsh 0.9.3", + "borsh 0.10.3", "num-derive 0.3.3", "num-traits", "solana-program", @@ -4514,6 +5355,12 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + [[package]] name = "want" version = "0.3.1" @@ -4630,6 +5477,12 @@ dependencies = [ "webpki", ] +[[package]] +name = "webpki-roots" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" + [[package]] name = "winapi" version = "0.3.9" @@ -4670,6 +5523,21 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -4879,11 +5747,12 @@ dependencies = [ [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -4913,15 +5782,6 @@ dependencies = [ "time", ] -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "yasna" version = "0.5.2" diff --git a/Cargo.toml b/Cargo.toml index 215697e..857e90f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,27 +1,22 @@ [workspace] resolver = "2" -members = [ - "stakedex_sdk", - "common", - "libs/*", - "interfaces/*" -] +members = ["stakedex_sdk", "common", "libs/*", "interfaces/*"] [workspace.dependencies] anyhow = "^1.0" bincode = "^1.0" -borsh = "^0.9" -jupiter-amm-interface = "~0.3.2" -lazy_static = "^1.0" num-derive = ">=0.1" num-traits = ">=0.1" rust_decimal = "^1.0" sanctum-macros = "^1.2" serde = "^1" -solana-client = "^1.9" -solana-program = "^1.9" -solana-sdk = "^1.9" +borsh = "^0.10" +jupiter-amm-interface = "~0.3.0" +lazy_static = "^1.0" +solana-client = "~1.16" +solana-program = "~1.16" +solana-sdk = "~1.16" spl-token = "^3.0" thiserror = "^1.0" diff --git a/common/Cargo.toml b/common/Cargo.toml index ddf057b..d3fd6e0 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -15,3 +15,5 @@ spl-token = { workspace = true } stakedex_deposit_sol_interface = { workspace = true } stakedex_interface = { workspace = true } thiserror = { workspace = true } + +rand = "0.8.5" diff --git a/common/src/base_amm.rs b/common/src/base_amm.rs index a10ddb6..4473eac 100644 --- a/common/src/base_amm.rs +++ b/common/src/base_amm.rs @@ -4,6 +4,8 @@ use jupiter_amm_interface::AccountMap; use solana_program::pubkey::Pubkey; pub trait BaseStakePoolAmm { + fn program_id(&self) -> Pubkey; + fn stake_pool_label(&self) -> &'static str; /// For ID purposes diff --git a/common/src/consts.rs b/common/src/consts.rs index 2fe28b7..a5ea22f 100644 --- a/common/src/consts.rs +++ b/common/src/consts.rs @@ -10,4 +10,4 @@ pub const SWAP_VIA_STAKE_SRC_TOKEN_MINT_ACCOUNT_INDEX: usize = 5; pub const SWAP_VIA_STAKE_DST_TOKEN_MINT_ACCOUNT_INDEX: usize = 6; -pub const TEMPORARY_JUP_AMM_LABEL: &str = "unstake.it"; +pub const TEMPORARY_JUP_AMM_LABEL: &str = "Sanctum"; diff --git a/common/src/deposit_sol.rs b/common/src/deposit_sol.rs index d26085e..f75b493 100644 --- a/common/src/deposit_sol.rs +++ b/common/src/deposit_sol.rs @@ -70,6 +70,8 @@ pub trait DepositSol: BaseStakePoolAmm { ..Quote::default() } } + + fn accounts_len(&self) -> usize; } // newtype pattern in order to impl external trait on internal generic @@ -157,4 +159,15 @@ where fn unidirectional(&self) -> bool { true } + + fn get_accounts_len(&self) -> usize { + 1 + STAKE_WRAPPED_SOL_IX_ACCOUNTS_LEN + self.0.accounts_len() + } + + fn program_dependencies(&self) -> Vec<(Pubkey, String)> { + vec![( + self.0.program_id(), + self.0.stake_pool_label().to_lowercase(), + )] + } } diff --git a/common/src/deposit_stake.rs b/common/src/deposit_stake.rs index f2c46ac..60245c4 100644 --- a/common/src/deposit_stake.rs +++ b/common/src/deposit_stake.rs @@ -84,4 +84,10 @@ pub trait DepositStake: BaseStakePoolAmm { ..Quote::default() } } + + fn underlying_liquidity(&self) -> Option<&Pubkey> { + None + } + + fn accounts_len(&self) -> usize; } diff --git a/common/src/pool_pair.rs b/common/src/pool_pair.rs index 56218b1..a147ab5 100644 --- a/common/src/pool_pair.rs +++ b/common/src/pool_pair.rs @@ -1,3 +1,5 @@ +use std::collections::HashSet; + use anyhow::{anyhow, Result}; use jupiter_amm_interface::{ AccountMap, Amm, KeyedAccount, Quote, QuoteParams, SwapAndAccountMetas, SwapParams, @@ -126,6 +128,21 @@ pub fn get_account_metas( Ok(metas) } +fn prepare_underlying_liquidities( + underlying_liquidities: &[Option<&Pubkey>], +) -> Option> { + let uls = HashSet::from_iter( + underlying_liquidities + .into_iter() + .filter_map(|ul| ul.cloned()), + ); + if uls.len() > 0 { + Some(uls) + } else { + None + } +} + #[derive(Clone)] pub struct OneWayPoolPair< W: WithdrawStake + Clone + Send + Sync + 'static, @@ -133,7 +150,27 @@ pub struct OneWayPoolPair< > { pub withdraw: W, pub deposit: D, - pub clock: Clock, + clock: Clock, + underlying_liquidities: Option>, +} + +impl OneWayPoolPair +where + W: WithdrawStake + Clone + Send + Sync, + D: DepositStake + Clone + Send + Sync, +{ + pub fn new(withdraw: W, deposit: D) -> Self { + let underlying_liquidities = prepare_underlying_liquidities(&[ + withdraw.underlying_liquidity(), + deposit.underlying_liquidity(), + ]); + Self { + withdraw, + deposit, + clock: Clock::default(), + underlying_liquidities, + } + } } impl Amm for OneWayPoolPair @@ -200,7 +237,7 @@ where } fn get_swap_and_account_metas(&self, swap_params: &SwapParams) -> Result { - let bridge_stake_seed = (self.clock.slot % u64::from(u32::MAX)).try_into().unwrap(); + let bridge_stake_seed = rand::random(); let mut account_metas = vec![STAKEDEX_ACCOUNT_META.clone()]; account_metas.extend(get_account_metas( swap_params, @@ -226,6 +263,27 @@ where fn unidirectional(&self) -> bool { true } + + fn get_accounts_len(&self) -> usize { + 1 + self.withdraw.accounts_len() + self.deposit.accounts_len() + } + + fn underlying_liquidities(&self) -> Option> { + self.underlying_liquidities.clone() + } + + fn program_dependencies(&self) -> Vec<(Pubkey, String)> { + vec![ + ( + self.withdraw.program_id(), + self.withdraw.stake_pool_label().to_lowercase(), + ), + ( + self.deposit.program_id(), + self.deposit.stake_pool_label().to_lowercase(), + ), + ] + } } #[derive(Clone)] @@ -235,7 +293,29 @@ pub struct TwoWayPoolPair< > { pub p1: P1, pub p2: P2, - pub clock: Clock, + clock: Clock, + underlying_liquidities: Option>, +} + +impl TwoWayPoolPair +where + P1: DepositStake + WithdrawStake + Clone + Send + Sync, + P2: DepositStake + WithdrawStake + Clone + Send + Sync, +{ + pub fn new(p1: P1, p2: P2) -> Self { + let underlying_liquidities = prepare_underlying_liquidities(&[ + DepositStake::underlying_liquidity(&p1), + ::underlying_liquidity(&p1), + DepositStake::underlying_liquidity(&p2), + ::underlying_liquidity(&p2), + ]); + Self { + p1, + p2, + clock: Clock::default(), + underlying_liquidities, + } + } } impl Amm for TwoWayPoolPair @@ -299,7 +379,7 @@ where } fn get_swap_and_account_metas(&self, swap_params: &SwapParams) -> Result { - let bridge_stake_seed = (self.clock.slot % u64::from(u32::MAX)).try_into().unwrap(); + let bridge_stake_seed = rand::random(); let mut account_metas = vec![STAKEDEX_ACCOUNT_META.clone()]; let other_account_metas = if swap_params.source_mint == self.p1.staked_sol_mint() && swap_params.destination_mint == self.p2.staked_sol_mint() @@ -331,4 +411,26 @@ where fn program_id(&self) -> Pubkey { stakedex_interface::ID } + + fn get_accounts_len(&self) -> usize { + // Pick a single direction + 1 + ::accounts_len(&self.p1) + DepositStake::accounts_len(&self.p2) + 1 + } + + fn underlying_liquidities(&self) -> Option> { + self.underlying_liquidities.clone() + } + + fn program_dependencies(&self) -> Vec<(Pubkey, String)> { + vec![ + ( + self.p1.program_id(), + self.p1.stake_pool_label().to_lowercase(), + ), + ( + self.p2.program_id(), + self.p2.stake_pool_label().to_lowercase(), + ), + ] + } } diff --git a/common/src/withdraw_stake.rs b/common/src/withdraw_stake.rs index 20cdfd5..7c45a7f 100644 --- a/common/src/withdraw_stake.rs +++ b/common/src/withdraw_stake.rs @@ -97,6 +97,12 @@ pub trait WithdrawStakeBase { fn can_accept_stake_withdrawals(&self) -> bool; fn virtual_ix(&self, quote: &WithdrawStakeQuote) -> Result; + + fn underlying_liquidity(&self) -> Option<&Pubkey> { + None + } + + fn accounts_len(&self) -> usize; } pub trait WithdrawStake: BaseStakePoolAmm + WithdrawStakeBase { diff --git a/interfaces/stakedex_interface/src/instructions.rs b/interfaces/stakedex_interface/src/instructions.rs index a901d73..a0380e5 100644 --- a/interfaces/stakedex_interface/src/instructions.rs +++ b/interfaces/stakedex_interface/src/instructions.rs @@ -158,56 +158,16 @@ impl From> for StakeWrappedSolKeys { impl From for [AccountMeta; STAKE_WRAPPED_SOL_IX_ACCOUNTS_LEN] { fn from(keys: StakeWrappedSolKeys) -> Self { [ - AccountMeta { - pubkey: keys.user, - is_signer: true, - is_writable: false, - }, - AccountMeta { - pubkey: keys.wsol_from, - is_signer: false, - is_writable: true, - }, - AccountMeta { - pubkey: keys.dest_token_to, - is_signer: false, - is_writable: true, - }, - AccountMeta { - pubkey: keys.wsol_bridge_in, - is_signer: false, - is_writable: true, - }, - AccountMeta { - pubkey: keys.sol_bridge_out, - is_signer: false, - is_writable: true, - }, - AccountMeta { - pubkey: keys.dest_token_fee_token_account, - is_signer: false, - is_writable: true, - }, - AccountMeta { - pubkey: keys.dest_token_mint, - is_signer: false, - is_writable: true, - }, - AccountMeta { - pubkey: keys.wsol_mint, - is_signer: false, - is_writable: false, - }, - AccountMeta { - pubkey: keys.token_program, - is_signer: false, - is_writable: false, - }, - AccountMeta { - pubkey: keys.system_program, - is_signer: false, - is_writable: false, - }, + AccountMeta::new_readonly(keys.user, false), + AccountMeta::new(keys.wsol_from, false), + AccountMeta::new(keys.dest_token_to, false), + AccountMeta::new(keys.wsol_bridge_in, false), + AccountMeta::new(keys.sol_bridge_out, false), + AccountMeta::new(keys.dest_token_fee_token_account, false), + AccountMeta::new(keys.dest_token_mint, false), + AccountMeta::new_readonly(keys.wsol_mint, false), + AccountMeta::new_readonly(keys.token_program, false), + AccountMeta::new_readonly(keys.system_program, false), ] } } @@ -464,41 +424,13 @@ impl From> for SwapViaStakeKeys { impl From for [AccountMeta; SWAP_VIA_STAKE_IX_ACCOUNTS_LEN] { fn from(keys: SwapViaStakeKeys) -> Self { [ - AccountMeta { - pubkey: keys.user, - is_signer: true, - is_writable: true, - }, - AccountMeta { - pubkey: keys.src_token_from, - is_signer: false, - is_writable: true, - }, - AccountMeta { - pubkey: keys.dest_token_to, - is_signer: false, - is_writable: true, - }, - AccountMeta { - pubkey: keys.bridge_stake, - is_signer: false, - is_writable: true, - }, - AccountMeta { - pubkey: keys.dest_token_fee_token_account, - is_signer: false, - is_writable: true, - }, - AccountMeta { - pubkey: keys.src_token_mint, - is_signer: false, - is_writable: true, - }, - AccountMeta { - pubkey: keys.dest_token_mint, - is_signer: false, - is_writable: true, - }, + AccountMeta::new(keys.user, false), + AccountMeta::new(keys.src_token_from, false), + AccountMeta::new(keys.dest_token_to, false), + AccountMeta::new(keys.bridge_stake, false), + AccountMeta::new(keys.dest_token_fee_token_account, false), + AccountMeta::new(keys.src_token_mint, false), + AccountMeta::new(keys.dest_token_mint, false), ] } } diff --git a/libs/lido/Cargo.toml b/libs/lido/Cargo.toml index d40343d..d9ac772 100644 --- a/libs/lido/Cargo.toml +++ b/libs/lido/Cargo.toml @@ -9,7 +9,9 @@ edition = "2021" anyhow = { workspace = true } bincode = { workspace = true } borsh = { workspace = true } -lido = { git = "https://github.com/igneous-labs/solido", branch = "mod/2.0.0-loose-deps", features = ["no-entrypoint"] } +lido = { git = "https://github.com/jup-ag/solido.git", rev = "2c85ddf7b50d8162d2b81d79d7fcbfd5e05dc967", features = [ + "no-entrypoint", +] } solana-program = { workspace = true } spl-token = { workspace = true } stakedex_deposit_sol_interface = { workspace = true } @@ -17,4 +19,4 @@ stakedex_withdraw_stake_interface = { workspace = true } stakedex_sdk_common = { workspace = true } [dev-dependencies] -solana-client = "^1.9" \ No newline at end of file +solana-client = { workspace = true } diff --git a/libs/lido/src/lib.rs b/libs/lido/src/lib.rs index 7842137..c34a24e 100644 --- a/libs/lido/src/lib.rs +++ b/libs/lido/src/lib.rs @@ -4,7 +4,7 @@ use lido::state::{AccountType, Lido, Validator}; mod stakedex_traits; use solana_program::{ - borsh::try_from_slice_unchecked, clock::Clock, program_pack::Pack, stake_history::Epoch, + borsh0_10::try_from_slice_unchecked, clock::Clock, program_pack::Pack, stake_history::Epoch, }; pub use stakedex_traits::*; diff --git a/libs/lido/src/stakedex_traits/base.rs b/libs/lido/src/stakedex_traits/base.rs index f750433..697d934 100644 --- a/libs/lido/src/stakedex_traits/base.rs +++ b/libs/lido/src/stakedex_traits/base.rs @@ -3,7 +3,7 @@ use solana_program::{pubkey::Pubkey, sysvar}; use stakedex_sdk_common::{ account_missing_err, jupiter_stakedex_interface::{AccountMap, KeyedAccount}, - lido_state, stsol, BaseStakePoolAmm, InitFromKeyedAccount, + lido_program, lido_state, stsol, BaseStakePoolAmm, InitFromKeyedAccount, }; use crate::{LidoStakedex, LIDO_LABEL}; @@ -20,6 +20,10 @@ impl InitFromKeyedAccount for LidoStakedex { } impl BaseStakePoolAmm for LidoStakedex { + fn program_id(&self) -> Pubkey { + lido_program::ID + } + fn stake_pool_label(&self) -> &'static str { LIDO_LABEL } diff --git a/libs/lido/src/stakedex_traits/withdraw_stake.rs b/libs/lido/src/stakedex_traits/withdraw_stake.rs index bd5667b..80176db 100644 --- a/libs/lido/src/stakedex_traits/withdraw_stake.rs +++ b/libs/lido/src/stakedex_traits/withdraw_stake.rs @@ -5,13 +5,17 @@ use lido::{ MINIMUM_STAKE_ACCOUNT_BALANCE, }; use solana_program::{ - instruction::Instruction, native_token::LAMPORTS_PER_SOL, stake, system_program, sysvar, + instruction::Instruction, native_token::LAMPORTS_PER_SOL, pubkey::Pubkey, stake, + system_program, sysvar, }; + use stakedex_sdk_common::{ lido_program, lido_state, WithdrawStakeBase, WithdrawStakeIter, WithdrawStakeQuote, STAKE_ACCOUNT_RENT_EXEMPT_LAMPORTS, }; -use stakedex_withdraw_stake_interface::{lido_withdraw_stake_ix, LidoWithdrawStakeKeys}; +use stakedex_withdraw_stake_interface::{ + lido_withdraw_stake_ix, LidoWithdrawStakeKeys, LIDO_WITHDRAW_STAKE_IX_ACCOUNTS_LEN, +}; use std::ops::Add; use crate::LidoStakedex; @@ -156,4 +160,12 @@ impl WithdrawStakeBase for LidoStakedex { token_program: spl_token::ID, })?) } + + fn accounts_len(&self) -> usize { + LIDO_WITHDRAW_STAKE_IX_ACCOUNTS_LEN + } + + fn underlying_liquidity(&self) -> Option<&Pubkey> { + Some(&lido_state::ID) + } } diff --git a/libs/marinade/Cargo.toml b/libs/marinade/Cargo.toml index d30560c..753c1e1 100644 --- a/libs/marinade/Cargo.toml +++ b/libs/marinade/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] anyhow = { workspace = true } borsh = { workspace = true } -marinade_finance_interface = { git = "https://github.com/igneous-labs/marinade_finance_interface", rev = "d625979" } +marinade_finance_interface = { git = "https://github.com/jup-ag/marinade_finance_interface", rev = "5747b5350c5505fc2ea597c3f8ae1f8cf71c363d" } solana-program = { workspace = true } spl-token = { workspace = true } stakedex_deposit_sol_interface = { workspace = true } diff --git a/libs/marinade/src/stakedex_traits/base.rs b/libs/marinade/src/stakedex_traits/base.rs index 1688430..1fa9a39 100644 --- a/libs/marinade/src/stakedex_traits/base.rs +++ b/libs/marinade/src/stakedex_traits/base.rs @@ -3,7 +3,7 @@ use solana_program::pubkey::Pubkey; use stakedex_sdk_common::{ account_missing_err, jupiter_stakedex_interface::{AccountMap, KeyedAccount}, - marinade_state, msol, BaseStakePoolAmm, InitFromKeyedAccount, + marinade_program, marinade_state, msol, BaseStakePoolAmm, InitFromKeyedAccount, }; use crate::{MarinadeStakedex, MARINADE_LABEL}; @@ -20,6 +20,10 @@ impl InitFromKeyedAccount for MarinadeStakedex { } impl BaseStakePoolAmm for MarinadeStakedex { + fn program_id(&self) -> Pubkey { + marinade_program::ID + } + fn stake_pool_label(&self) -> &'static str { MARINADE_LABEL } diff --git a/libs/marinade/src/stakedex_traits/deposit_sol.rs b/libs/marinade/src/stakedex_traits/deposit_sol.rs index 225fc6b..e7ab8ed 100644 --- a/libs/marinade/src/stakedex_traits/deposit_sol.rs +++ b/libs/marinade/src/stakedex_traits/deposit_sol.rs @@ -1,6 +1,8 @@ use anyhow::Result; use solana_program::instruction::Instruction; -use stakedex_deposit_sol_interface::{marinade_deposit_sol_ix, MarinadeDepositSolKeys}; +use stakedex_deposit_sol_interface::{ + marinade_deposit_sol_ix, MarinadeDepositSolKeys, MARINADE_DEPOSIT_SOL_IX_ACCOUNTS_LEN, +}; use stakedex_sdk_common::{marinade_program, marinade_state, DepositSol, DepositSolQuote}; use crate::{state::StateWrapper, MarinadeStakedex}; @@ -32,4 +34,8 @@ impl DepositSol for MarinadeStakedex { marinade_liq_pool_sol_leg: marinade_program::LIQ_POOL_SOL_LEG_ID, })?) } + + fn accounts_len(&self) -> usize { + MARINADE_DEPOSIT_SOL_IX_ACCOUNTS_LEN + } } diff --git a/libs/marinade/src/stakedex_traits/deposit_stake.rs b/libs/marinade/src/stakedex_traits/deposit_stake.rs index e3bc80e..d2b90cf 100644 --- a/libs/marinade/src/stakedex_traits/deposit_stake.rs +++ b/libs/marinade/src/stakedex_traits/deposit_stake.rs @@ -1,6 +1,8 @@ use anyhow::Result; use solana_program::{instruction::Instruction, stake, system_program, sysvar}; -use stakedex_deposit_stake_interface::{marinade_deposit_stake_ix, MarinadeDepositStakeKeys}; +use stakedex_deposit_stake_interface::{ + marinade_deposit_stake_ix, MarinadeDepositStakeKeys, MARINADE_DEPOSIT_STAKE_IX_ACCOUNTS_LEN, +}; use stakedex_sdk_common::{ marinade_program, marinade_state, DepositStake, DepositStakeInfo, DepositStakeQuote, WithdrawStakeQuote, @@ -78,4 +80,8 @@ impl DepositStake for MarinadeStakedex { stake_program: stake::program::ID, })?) } + + fn accounts_len(&self) -> usize { + MARINADE_DEPOSIT_STAKE_IX_ACCOUNTS_LEN + } } diff --git a/libs/socean_stake_pool/Cargo.toml b/libs/socean_stake_pool/Cargo.toml index e78356d..edb862a 100644 --- a/libs/socean_stake_pool/Cargo.toml +++ b/libs/socean_stake_pool/Cargo.toml @@ -10,8 +10,11 @@ anyhow = { workspace = true } bincode = { workspace = true } borsh = { workspace = true } solana-program = { workspace = true } +# spl-stake-pool = "^0.6.4" -spl-stake-pool = "^0.6.4" +spl-stake-pool = { git = "https://github.com/solana-labs/solana-program-library.git", rev = "a3996814cb44eab2834f72113b742c875ac7b1b9", features = [ + "no-entrypoint", +] } # { git = "https://github.com/igneous-labs/solana-program-library", branch = "release/v0.1"} incompatible with solana-program ^1.9 spl-token = { workspace = true } diff --git a/libs/socean_stake_pool/src/lib.rs b/libs/socean_stake_pool/src/lib.rs index 845214e..524d9d9 100644 --- a/libs/socean_stake_pool/src/lib.rs +++ b/libs/socean_stake_pool/src/lib.rs @@ -38,7 +38,7 @@ impl SoceanStakePoolStakedex { /// Find and return validator stake account pub fn vsa(voter: &Pubkey) -> Pubkey { - find_stake_program_address(&socean_program::ID, voter, &socean_stake_pool::ID).0 + find_stake_program_address(&socean_program::ID, voter, &socean_stake_pool::ID, None).0 } pub fn is_updated_this_epoch(&self) -> bool { @@ -83,7 +83,7 @@ impl SoceanStakePoolStakedex { // according to https://github.com/solana-labs/solana-program-library/blob/58c1226a513d3d8bb2de8ec67586a679be7fd2d4/stake-pool/program/src/state.rs#L536C1-L542 // `active_stake_lamports` = delegation.stake - MIN_ACTIVE_STAKE_LAMPORTS. // Withdrawals must leave at least MIN_ACTIVE_STAKE_LAMPORTS active stake in vsa - if withdraw_lamports > validator_list_entry.active_stake_lamports { + if withdraw_lamports > u64::from(validator_list_entry.active_stake_lamports) { return Err(StakePoolError::InvalidState); } let lamports_staked = withdraw_lamports diff --git a/libs/socean_stake_pool/src/stakedex_traits/base.rs b/libs/socean_stake_pool/src/stakedex_traits/base.rs index 099be45..8efdfc6 100644 --- a/libs/socean_stake_pool/src/stakedex_traits/base.rs +++ b/libs/socean_stake_pool/src/stakedex_traits/base.rs @@ -3,7 +3,7 @@ use solana_program::{clock::Clock, pubkey::Pubkey, sysvar}; use stakedex_sdk_common::{ account_missing_err, jupiter_stakedex_interface::{AccountMap, KeyedAccount}, - scnsol, socean_stake_pool, BaseStakePoolAmm, InitFromKeyedAccount, + scnsol, socean_program, socean_stake_pool, BaseStakePoolAmm, InitFromKeyedAccount, }; use crate::{SoceanStakePoolStakedex, SOCEAN_STAKE_POOL_LABEL}; @@ -20,6 +20,10 @@ impl InitFromKeyedAccount for SoceanStakePoolStakedex { } impl BaseStakePoolAmm for SoceanStakePoolStakedex { + fn program_id(&self) -> Pubkey { + socean_program::ID + } + fn stake_pool_label(&self) -> &'static str { SOCEAN_STAKE_POOL_LABEL } diff --git a/libs/socean_stake_pool/src/stakedex_traits/deposit_sol.rs b/libs/socean_stake_pool/src/stakedex_traits/deposit_sol.rs index cd5220b..3c158cd 100644 --- a/libs/socean_stake_pool/src/stakedex_traits/deposit_sol.rs +++ b/libs/socean_stake_pool/src/stakedex_traits/deposit_sol.rs @@ -3,6 +3,7 @@ use solana_program::{instruction::Instruction, sysvar}; use spl_stake_pool::error::StakePoolError; use stakedex_deposit_sol_interface::{ socean_stake_pool_deposit_sol_ix, SoceanStakePoolDepositSolKeys, + SOCEAN_STAKE_POOL_DEPOSIT_SOL_IX_ACCOUNTS_LEN, }; use stakedex_sdk_common::{socean_program, socean_stake_pool, DepositSol, DepositSolQuote}; @@ -56,4 +57,8 @@ impl DepositSol for SoceanStakePoolStakedex { }, )?) } + + fn accounts_len(&self) -> usize { + SOCEAN_STAKE_POOL_DEPOSIT_SOL_IX_ACCOUNTS_LEN + } } diff --git a/libs/socean_stake_pool/src/stakedex_traits/deposit_stake.rs b/libs/socean_stake_pool/src/stakedex_traits/deposit_stake.rs index 85c0aaa..5619ac5 100644 --- a/libs/socean_stake_pool/src/stakedex_traits/deposit_stake.rs +++ b/libs/socean_stake_pool/src/stakedex_traits/deposit_stake.rs @@ -3,6 +3,7 @@ use solana_program::{instruction::Instruction, stake, sysvar}; use spl_stake_pool::state::StakeStatus; use stakedex_deposit_stake_interface::{ socean_stake_pool_deposit_stake_ix, SoceanStakePoolDepositStakeKeys, + SOCEAN_STAKE_POOL_DEPOSIT_STAKE_IX_ACCOUNTS_LEN, }; use stakedex_sdk_common::{ socean_program, socean_stake_pool, DepositStake, DepositStakeInfo, DepositStakeQuote, @@ -127,4 +128,8 @@ impl DepositStake for SoceanStakePoolStakedex { }, )?) } + + fn accounts_len(&self) -> usize { + SOCEAN_STAKE_POOL_DEPOSIT_STAKE_IX_ACCOUNTS_LEN + } } diff --git a/libs/socean_stake_pool/src/stakedex_traits/withdraw_stake.rs b/libs/socean_stake_pool/src/stakedex_traits/withdraw_stake.rs index c2270f4..4733486 100644 --- a/libs/socean_stake_pool/src/stakedex_traits/withdraw_stake.rs +++ b/libs/socean_stake_pool/src/stakedex_traits/withdraw_stake.rs @@ -1,11 +1,12 @@ use anyhow::Result; -use solana_program::{instruction::Instruction, stake, system_program, sysvar}; +use solana_program::{instruction::Instruction, pubkey::Pubkey, stake, system_program, sysvar}; use spl_stake_pool::MINIMUM_ACTIVE_STAKE; use stakedex_sdk_common::{ socean_program, socean_stake_pool, WithdrawStakeBase, WithdrawStakeIter, WithdrawStakeQuote, }; use stakedex_withdraw_stake_interface::{ socean_stake_pool_withdraw_stake_ix, SoceanStakePoolWithdrawStakeKeys, + SOCEAN_STAKE_POOL_WITHDRAW_STAKE_IX_ACCOUNTS_LEN, }; use crate::SoceanStakePoolStakedex; @@ -54,7 +55,7 @@ impl<'a> WithdrawStakeQuoteIter<'a> { .enumerate() .find(|(_, vsi)| vsi.vote_account_address == preferred_voter)?; // preferred cant service withdrawals, fallback to normal - if vsi.active_stake_lamports <= MINIMUM_ACTIVE_STAKE { + if u64::from(vsi.active_stake_lamports) <= MINIMUM_ACTIVE_STAKE { return Some(( WithdrawStakeQuote::default(), WithdrawStakeQuoteIterState::Normal(0), @@ -120,4 +121,12 @@ impl WithdrawStakeBase for SoceanStakePoolStakedex { }, )?) } + + fn accounts_len(&self) -> usize { + SOCEAN_STAKE_POOL_WITHDRAW_STAKE_IX_ACCOUNTS_LEN + } + + fn underlying_liquidity(&self) -> Option<&Pubkey> { + Some(&socean_stake_pool::ID) + } } diff --git a/libs/spl_stake_pool/Cargo.toml b/libs/spl_stake_pool/Cargo.toml index 23f1475..04f190b 100644 --- a/libs/spl_stake_pool/Cargo.toml +++ b/libs/spl_stake_pool/Cargo.toml @@ -11,9 +11,12 @@ bincode = { workspace = true } borsh = { workspace = true } lazy_static = "^1.0" solana-program = { workspace = true } -spl-stake-pool = "^0.6.4" +spl-stake-pool = { git = "https://github.com/solana-labs/solana-program-library.git", rev = "a3996814cb44eab2834f72113b742c875ac7b1b9", features = [ + "no-entrypoint", +] } +# spl-stake-pool = "^0.6.4" spl-token = { workspace = true } stakedex_deposit_sol_interface = { workspace = true } stakedex_deposit_stake_interface = { workspace = true } stakedex_sdk_common = { workspace = true } -stakedex_withdraw_stake_interface = { workspace = true } \ No newline at end of file +stakedex_withdraw_stake_interface = { workspace = true } diff --git a/libs/spl_stake_pool/src/lib.rs b/libs/spl_stake_pool/src/lib.rs index aa88d2c..d4afc18 100644 --- a/libs/spl_stake_pool/src/lib.rs +++ b/libs/spl_stake_pool/src/lib.rs @@ -13,6 +13,7 @@ use stakedex_sdk_common::{ use std::collections::HashMap; mod stakedex_traits; +pub use spl_stake_pool::ID; pub use stakedex_traits::*; lazy_static! { @@ -90,7 +91,7 @@ impl SplStakePoolStakedex { // according to https://github.com/solana-labs/solana-program-library/blob/58c1226a513d3d8bb2de8ec67586a679be7fd2d4/stake-pool/program/src/state.rs#L536C1-L542 // `active_stake_lamports` = delegation.stake - MIN_ACTIVE_STAKE_LAMPORTS. // Withdrawals must leave at least MIN_ACTIVE_STAKE_LAMPORTS active stake in vsa - if withdraw_lamports > validator_list_entry.active_stake_lamports { + if withdraw_lamports > u64::from(validator_list_entry.active_stake_lamports) { return Err(StakePoolError::InvalidState); } let lamports_staked = withdraw_lamports diff --git a/libs/spl_stake_pool/src/stakedex_traits/base.rs b/libs/spl_stake_pool/src/stakedex_traits/base.rs index caa8e86..5b217c5 100644 --- a/libs/spl_stake_pool/src/stakedex_traits/base.rs +++ b/libs/spl_stake_pool/src/stakedex_traits/base.rs @@ -28,6 +28,10 @@ impl InitFromKeyedAccount for SplStakePoolStakedex { } impl BaseStakePoolAmm for SplStakePoolStakedex { + fn program_id(&self) -> Pubkey { + spl_stake_pool::ID + } + fn stake_pool_label(&self) -> &'static str { self.stake_pool_label } diff --git a/libs/spl_stake_pool/src/stakedex_traits/deposit_sol.rs b/libs/spl_stake_pool/src/stakedex_traits/deposit_sol.rs index cf80e17..4914825 100644 --- a/libs/spl_stake_pool/src/stakedex_traits/deposit_sol.rs +++ b/libs/spl_stake_pool/src/stakedex_traits/deposit_sol.rs @@ -1,7 +1,10 @@ use anyhow::Result; use solana_program::instruction::Instruction; use spl_stake_pool::error::StakePoolError; -use stakedex_deposit_sol_interface::{spl_stake_pool_deposit_sol_ix, SplStakePoolDepositSolKeys}; +use stakedex_deposit_sol_interface::{ + spl_stake_pool_deposit_sol_ix, SplStakePoolDepositSolKeys, + SPL_STAKE_POOL_DEPOSIT_SOL_IX_ACCOUNTS_LEN, +}; use stakedex_sdk_common::{DepositSol, DepositSolQuote}; use crate::SplStakePoolStakedex; @@ -54,4 +57,8 @@ impl DepositSol for SplStakePoolStakedex { stake_pool_reserve_stake: self.stake_pool.reserve_stake, })?) } + + fn accounts_len(&self) -> usize { + SPL_STAKE_POOL_DEPOSIT_SOL_IX_ACCOUNTS_LEN + } } diff --git a/libs/spl_stake_pool/src/stakedex_traits/deposit_stake.rs b/libs/spl_stake_pool/src/stakedex_traits/deposit_stake.rs index 4c129eb..ec171df 100644 --- a/libs/spl_stake_pool/src/stakedex_traits/deposit_stake.rs +++ b/libs/spl_stake_pool/src/stakedex_traits/deposit_stake.rs @@ -5,6 +5,7 @@ use spl_stake_pool::{ }; use stakedex_deposit_stake_interface::{ spl_stake_pool_deposit_stake_ix, SplStakePoolDepositStakeKeys, + SPL_STAKE_POOL_DEPOSIT_STAKE_IX_ACCOUNTS_LEN, }; use stakedex_sdk_common::{DepositStake, DepositStakeInfo, DepositStakeQuote, WithdrawStakeQuote}; @@ -113,8 +114,13 @@ impl DepositStake for SplStakePoolStakedex { quote: &DepositStakeQuote, _deposit_stake_info: &DepositStakeInfo, ) -> Result { - let deposit_stake_validator_stake = - find_stake_program_address(&spl_stake_pool::ID, "e.voter, &self.stake_pool_addr).0; + let deposit_stake_validator_stake = find_stake_program_address( + &spl_stake_pool::ID, + "e.voter, + &self.stake_pool_addr, + None, + ) + .0; Ok(spl_stake_pool_deposit_stake_ix( SplStakePoolDepositStakeKeys { spl_stake_pool_program: spl_stake_pool::ID, @@ -132,4 +138,8 @@ impl DepositStake for SplStakePoolStakedex { }, )?) } + + fn accounts_len(&self) -> usize { + SPL_STAKE_POOL_DEPOSIT_STAKE_IX_ACCOUNTS_LEN + } } diff --git a/libs/spl_stake_pool/src/stakedex_traits/withdraw_stake.rs b/libs/spl_stake_pool/src/stakedex_traits/withdraw_stake.rs index 5df427a..bfb7e9d 100644 --- a/libs/spl_stake_pool/src/stakedex_traits/withdraw_stake.rs +++ b/libs/spl_stake_pool/src/stakedex_traits/withdraw_stake.rs @@ -1,9 +1,10 @@ use anyhow::Result; -use solana_program::{instruction::Instruction, stake, system_program, sysvar}; +use solana_program::{instruction::Instruction, pubkey::Pubkey, stake, system_program, sysvar}; use spl_stake_pool::{find_stake_program_address, MINIMUM_ACTIVE_STAKE}; use stakedex_sdk_common::{WithdrawStakeBase, WithdrawStakeIter, WithdrawStakeQuote}; use stakedex_withdraw_stake_interface::{ spl_stake_pool_withdraw_stake_ix, SplStakePoolWithdrawStakeKeys, + SPL_STAKE_POOL_WITHDRAW_STAKE_IX_ACCOUNTS_LEN, }; use crate::SplStakePoolStakedex; @@ -52,7 +53,7 @@ impl<'a> WithdrawStakeQuoteIter<'a> { .enumerate() .find(|(_, vsi)| vsi.vote_account_address == preferred_voter)?; // preferred cant service withdrawals, fallback to normal - if vsi.active_stake_lamports <= MINIMUM_ACTIVE_STAKE { + if u64::from(vsi.active_stake_lamports) <= MINIMUM_ACTIVE_STAKE { return Some(( WithdrawStakeQuote::default(), WithdrawStakeQuoteIterState::Normal(0), @@ -103,8 +104,13 @@ impl WithdrawStakeBase for SplStakePoolStakedex { } fn virtual_ix(&self, quote: &WithdrawStakeQuote) -> Result { - let withdraw_stake_stake_to_split = - find_stake_program_address(&spl_stake_pool::ID, "e.voter, &self.stake_pool_addr).0; + let withdraw_stake_stake_to_split = find_stake_program_address( + &spl_stake_pool::ID, + "e.voter, + &self.stake_pool_addr, + None, + ) + .0; Ok(spl_stake_pool_withdraw_stake_ix( SplStakePoolWithdrawStakeKeys { spl_stake_pool_program: spl_stake_pool::ID, @@ -120,4 +126,12 @@ impl WithdrawStakeBase for SplStakePoolStakedex { }, )?) } + + fn accounts_len(&self) -> usize { + SPL_STAKE_POOL_WITHDRAW_STAKE_IX_ACCOUNTS_LEN + } + + fn underlying_liquidity(&self) -> Option<&Pubkey> { + Some(&self.stake_pool_addr) + } } diff --git a/libs/unstake_it/Cargo.toml b/libs/unstake_it/Cargo.toml index 77643af..60ac12b 100644 --- a/libs/unstake_it/Cargo.toml +++ b/libs/unstake_it/Cargo.toml @@ -8,8 +8,8 @@ edition = "2021" [dependencies] anyhow = { workspace = true } solana-program = { workspace = true } -spl-math = { version = "0.1.0", features = ["no-entrypoint"]} +spl-math = { version = "0.1.0", features = ["no-entrypoint"] } spl-token = { workspace = true } stakedex_deposit_stake_interface = { workspace = true } stakedex_sdk_common = { workspace = true } -unstake_it_interface = { git = "https://github.com/igneous-labs/unstake_it_interface", rev = "8819194" } # TODO: change to main program crate once we open source unstake.it +unstake_it_interface = { git = "https://github.com/jup-ag/unstake_it_interface", rev = "c0b6e9742f7f4fd345c57e2fe3edf8fa0f0b858b" } # TODO: change to main program crate once we open source unstake.it diff --git a/libs/unstake_it/src/stakedex_traits/base.rs b/libs/unstake_it/src/stakedex_traits/base.rs index 2f01fde..8638d0a 100644 --- a/libs/unstake_it/src/stakedex_traits/base.rs +++ b/libs/unstake_it/src/stakedex_traits/base.rs @@ -15,6 +15,10 @@ impl InitFromKeyedAccount for UnstakeItStakedex { } impl BaseStakePoolAmm for UnstakeItStakedex { + fn program_id(&self) -> Pubkey { + unstake_it_program::ID + } + fn stake_pool_label(&self) -> &'static str { UNSTAKE_IT_LABEL } diff --git a/libs/unstake_it/src/stakedex_traits/deposit_stake.rs b/libs/unstake_it/src/stakedex_traits/deposit_stake.rs index cd1b9ad..0acca2f 100644 --- a/libs/unstake_it/src/stakedex_traits/deposit_stake.rs +++ b/libs/unstake_it/src/stakedex_traits/deposit_stake.rs @@ -1,6 +1,9 @@ use anyhow::Result; -use solana_program::{instruction::Instruction, stake, system_program, sysvar}; -use stakedex_deposit_stake_interface::{unstake_it_deposit_stake_ix, UnstakeItDepositStakeKeys}; +use solana_program::{instruction::Instruction, pubkey::Pubkey, stake, system_program, sysvar}; +use stakedex_deposit_stake_interface::{ + unstake_it_deposit_stake_ix, UnstakeItDepositStakeKeys, + UNSTAKE_IT_DEPOSIT_STAKE_IX_ACCOUNTS_LEN, +}; use stakedex_sdk_common::{ unstake_it_pool, unstake_it_program, DepositStake, DepositStakeInfo, DepositStakeQuote, WithdrawStakeQuote, ZERO_DATA_ACC_RENT_EXEMPT_LAMPORTS, @@ -65,4 +68,12 @@ impl DepositStake for UnstakeItStakedex { system_program: system_program::ID, })?) } + + fn underlying_liquidity(&self) -> Option<&Pubkey> { + Some(&unstake_it_pool::ID) + } + + fn accounts_len(&self) -> usize { + UNSTAKE_IT_DEPOSIT_STAKE_IX_ACCOUNTS_LEN + } } diff --git a/stakedex_sdk/Cargo.toml b/stakedex_sdk/Cargo.toml index 2174982..4c292b7 100644 --- a/stakedex_sdk/Cargo.toml +++ b/stakedex_sdk/Cargo.toml @@ -3,6 +3,9 @@ name = "stakedex_sdk" version = "0.1.0" edition = "2021" +[features] +test-utils = [] + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -23,5 +26,5 @@ stakedex_unstake_it = { workspace = true } itertools = "0.10.5" [dev-dependencies] -solana-client.workspace = true -lazy_static.workspace = true +solana-client = { workspace = true } +lazy_static = { workspace = true } diff --git a/stakedex_sdk/src/lib.rs b/stakedex_sdk/src/lib.rs index 5293bb4..fcd5acb 100644 --- a/stakedex_sdk/src/lib.rs +++ b/stakedex_sdk/src/lib.rs @@ -3,9 +3,7 @@ use std::collections::HashMap; use anyhow::{anyhow, Result}; use itertools::Itertools; use jupiter_amm_interface::{AccountMap, Amm, KeyedAccount, Quote, QuoteParams, SwapParams}; -use solana_sdk::{ - account::Account, clock::Clock, instruction::Instruction, pubkey::Pubkey, system_program, -}; +use solana_sdk::{account::Account, instruction::Instruction, pubkey::Pubkey, system_program}; use spl_token::native_mint; pub use stakedex_interface::ID as stakedex_program_id; use stakedex_interface::{ @@ -541,74 +539,34 @@ impl Stakedex { for (first_stakedex, second_stakedex) in stakedexes.into_iter().tuple_combinations() { match (first_stakedex, second_stakedex) { (Stakedex::SplStakePool(p1), Stakedex::SplStakePool(p2)) => { - amms.push(Box::new(TwoWayPoolPair { - p1, - p2, - clock: Clock::default(), - })); + amms.push(Box::new(TwoWayPoolPair::new(p1, p2))); } match_stakedexes!(SplStakePool, Socean, p1, p2) => { - amms.push(Box::new(TwoWayPoolPair { - p1, - p2, - clock: Clock::default(), - })); + amms.push(Box::new(TwoWayPoolPair::new(p1, p2))); } match_stakedexes!(SplStakePool, Marinade, withdraw, deposit) => { - amms.push(Box::new(OneWayPoolPair { - withdraw, - deposit, - clock: Clock::default(), - })); + amms.push(Box::new(OneWayPoolPair::new(withdraw, deposit))); } match_stakedexes!(SplStakePool, UnstakeIt, withdraw, deposit) => { - amms.push(Box::new(OneWayPoolPair { - withdraw, - deposit, - clock: Clock::default(), - })); + amms.push(Box::new(OneWayPoolPair::new(withdraw, deposit))); } match_stakedexes!(Socean, UnstakeIt, withdraw, deposit) => { - amms.push(Box::new(OneWayPoolPair { - withdraw, - deposit, - clock: Clock::default(), - })); + amms.push(Box::new(OneWayPoolPair::new(withdraw, deposit))); } match_stakedexes!(Socean, Marinade, withdraw, deposit) => { - amms.push(Box::new(OneWayPoolPair { - withdraw, - deposit, - clock: Clock::default(), - })); + amms.push(Box::new(OneWayPoolPair::new(withdraw, deposit))); } match_stakedexes!(Lido, SplStakePool, withdraw, deposit) => { - amms.push(Box::new(OneWayPoolPair { - withdraw, - deposit, - clock: Clock::default(), - })); + amms.push(Box::new(OneWayPoolPair::new(withdraw, deposit))); } match_stakedexes!(Lido, Socean, withdraw, deposit) => { - amms.push(Box::new(OneWayPoolPair { - withdraw, - deposit, - clock: Clock::default(), - })); + amms.push(Box::new(OneWayPoolPair::new(withdraw, deposit))); } match_stakedexes!(Lido, UnstakeIt, withdraw, deposit) => { - amms.push(Box::new(OneWayPoolPair { - withdraw, - deposit, - clock: Clock::default(), - })); + amms.push(Box::new(OneWayPoolPair::new(withdraw, deposit))); } match_stakedexes!(Lido, Marinade, withdraw, deposit) => { - amms.push(Box::new(OneWayPoolPair { - withdraw, - deposit, - clock: Clock::default(), - })); + amms.push(Box::new(OneWayPoolPair::new(withdraw, deposit))); } match_stakedexes!(Marinade, UnstakeIt, _, _) => (), // Cannot do anything with those two match_same_stakedex!(Socean) @@ -618,11 +576,20 @@ impl Stakedex { } } - println!( - "StakeDex amms: {:?}", - amms.iter().map(|amm| amm.label()).collect::>() - ); - amms } } + +pub mod test_utils { + pub use stakedex_lido::LidoStakedex; + pub use stakedex_marinade::MarinadeStakedex; + pub use stakedex_sdk_common::DepositSolWrapper; + pub use stakedex_sdk_common::{ + jito_stake_pool, lido_program, lido_state, marinade_program, marinade_state, + socean_program, socean_stake_pool, unstake_it_pool, + }; + pub use stakedex_socean_stake_pool::SoceanStakePoolStakedex; + pub use stakedex_spl_stake_pool as spl_stake_pool; + pub use stakedex_spl_stake_pool::SplStakePoolStakedex; + pub use stakedex_unstake_it::UnstakeItStakedex; +} diff --git a/stakedex_sdk/tests/test_main.rs b/stakedex_sdk/tests/test_main.rs index 77f9f20..d9fd8fb 100644 --- a/stakedex_sdk/tests/test_main.rs +++ b/stakedex_sdk/tests/test_main.rs @@ -59,13 +59,25 @@ fn fetch_accounts(accounts_pubkeys: &[Pubkey]) -> HashMap { } #[test] -fn test_swap_via_stake_unknown_token() { +fn test_quote_swap_via_stake_jitosol_bsol() { + STAKEDEX + .quote_swap_via_stake(&QuoteParams { + amount: 1_000_000_000, + input_mint: jitosol::ID, + output_mint: bsol::ID, + swap_mode: jupiter_amm_interface::SwapMode::ExactIn, + }) + .unwrap(); +} + +#[test] +fn test_quote_swap_via_stake_unknown_token() { let unknown_token = Pubkey::new_unique(); let res = STAKEDEX.quote_swap_via_stake(&QuoteParams { amount: 1_000_000_000, input_mint: unknown_token, output_mint: bsol::ID, - swap_mode: SwapMode::default(), + swap_mode: jupiter_amm_interface::SwapMode::ExactIn, }); assert!(res.is_err()); } @@ -731,13 +743,13 @@ fn test_jsol_drain_vsa_edge_case() { .validator_list .validators .iter() - .max_by_key(|v| v.active_stake_lamports) + .max_by_key(|v| u64::from(v.active_stake_lamports)) .unwrap(); let max_withdraw_lamports = largest_active_stake_vsi.active_stake_lamports; let parts_after_fees = (STAKEDEX.jpool.stake_pool.stake_withdrawal_fee.denominator - STAKEDEX.jpool.stake_pool.stake_withdrawal_fee.numerator) as u128; - let max_withdraw_lamports_bef_fees = ((max_withdraw_lamports as u128) + let max_withdraw_lamports_bef_fees = (u128::from(u64::from(max_withdraw_lamports)) * (STAKEDEX.jpool.stake_pool.stake_withdrawal_fee.denominator as u128) + parts_after_fees - 1) @@ -749,17 +761,17 @@ fn test_jsol_drain_vsa_edge_case() { .unwrap(); let max_possible_quote = STAKEDEX .quote_swap_via_stake(&QuoteParams { - amount: max_withdraw_jsol, - input_mint: jsol::ID, + amount: 100_000_000_000, + input_mint: stsol::ID, output_mint: msol::ID, - swap_mode: SwapMode::default(), + swap_mode: jupiter_amm_interface::SwapMode::ExactIn, }) .unwrap(); let should_fail = STAKEDEX.quote_swap_via_stake(&QuoteParams { amount: max_withdraw_jsol + 1, input_mint: jsol::ID, output_mint: msol::ID, - swap_mode: SwapMode::default(), + swap_mode: SwapMode::ExactIn, }); assert!(should_fail.is_err());