diff --git a/.gitignore b/.gitignore index 2e04041..575a451 100755 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,6 @@ id.json **/target target/ -private/ \ No newline at end of file +private/ + +solend-liquidator.tar.gz diff --git a/pack.sh b/pack.sh new file mode 100644 index 0000000..da56431 --- /dev/null +++ b/pack.sh @@ -0,0 +1,17 @@ +#!/bin/bash + + +tar -zcvf ./solend-liquidator.tar.gz \ + --exclude="./solend-liquidator/target" \ + --exclude="./solend-liquidator/private" \ + --exclude="./solend-liquidator-benchmarking/target" \ + --exclude="./solend-liquidator.tar.gz" \ + --exclude="./solana-program-library/target" \ + --exclude="./node_modules" \ + --exclude="./overriden/anchor/target" \ + --exclude="./overriden/anchor/tests" \ + --exclude="./overriden/switchboard-program-0.2.1/target" \ + --exclude="./overriden/switchboard-program-0.2.1/tests" \ + --exclude="./overriden/switchboard-v2-0.1.10/target" \ + --exclude="./overriden/switchboard-v2-0.1.10/tests" \ + --exclude="./.git" . diff --git a/solend-liquidator-benchmarking/Cargo.lock b/solend-liquidator-benchmarking/Cargo.lock new file mode 100644 index 0000000..a186f15 --- /dev/null +++ b/solend-liquidator-benchmarking/Cargo.lock @@ -0,0 +1,4821 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher 0.3.0", + "cpufeatures", + "opaque-debug", +] + +[[package]] +name = "aes-gcm-siv" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" +dependencies = [ + "aead", + "aes", + "cipher 0.3.0", + "ctr", + "polyval", + "subtle", + "zeroize", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.7", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + +[[package]] +name = "anchor-attribute-access-control" +version = "0.24.2" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2 1.0.40", + "quote 1.0.20", + "regex", + "syn 1.0.98", +] + +[[package]] +name = "anchor-attribute-account" +version = "0.24.2" +dependencies = [ + "anchor-syn", + "anyhow", + "bs58 0.4.0", + "proc-macro2 1.0.40", + "quote 1.0.20", + "rustversion", + "syn 1.0.98", +] + +[[package]] +name = "anchor-attribute-constant" +version = "0.24.2" +dependencies = [ + "anchor-syn", + "proc-macro2 1.0.40", + "syn 1.0.98", +] + +[[package]] +name = "anchor-attribute-error" +version = "0.24.2" +dependencies = [ + "anchor-syn", + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "anchor-attribute-event" +version = "0.24.2" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "anchor-attribute-interface" +version = "0.24.2" +dependencies = [ + "anchor-syn", + "anyhow", + "heck 0.3.3", + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "anchor-attribute-program" +version = "0.24.2" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "anchor-attribute-state" +version = "0.24.2" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "anchor-derive-accounts" +version = "0.24.2" +dependencies = [ + "anchor-syn", + "anyhow", + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "anchor-lang" +version = "0.24.2" +dependencies = [ + "anchor-attribute-access-control", + "anchor-attribute-account", + "anchor-attribute-constant", + "anchor-attribute-error", + "anchor-attribute-event", + "anchor-attribute-interface", + "anchor-attribute-program", + "anchor-attribute-state", + "anchor-derive-accounts", + "arrayref", + "base64 0.13.0", + "bincode", + "borsh", + "bytemuck", + "solana-program", + "thiserror", +] + +[[package]] +name = "anchor-spl" +version = "0.24.2" +dependencies = [ + "anchor-lang", + "solana-program", + "spl-associated-token-account", + "spl-token", +] + +[[package]] +name = "anchor-syn" +version = "0.24.2" +dependencies = [ + "anyhow", + "bs58 0.3.1", + "heck 0.3.3", + "proc-macro2 1.0.40", + "proc-macro2-diagnostics", + "quote 1.0.20", + "serde", + "serde_json", + "sha2 0.9.9", + "syn 1.0.98", + "thiserror", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-trait" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "base64ct" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bdca834647821e0b13d9539a8634eb62d3501b6b6c2cec1722786ee6671b851" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + +[[package]] +name = "blake3" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "digest 0.10.3", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "borsh" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive", + "hashbrown 0.11.2", +] + +[[package]] +name = "borsh-derive" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate 0.1.5", + "proc-macro2 1.0.40", + "syn 1.0.98", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "bs58" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb" + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" + +[[package]] +name = "bv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" +dependencies = [ + "feature-probe", + "serde", +] + +[[package]] +name = "bytemuck" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5377c8865e74a160d21f29c2d40669f53286db6eab59b88540cbb12ffc8b835" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd2f4180c5721da6335cc9e9061cce522b87a35e51cc57636d28d22a9863c80" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e" + +[[package]] +name = "bzip2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "caps" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61bf7211aad104ce2769ec05efcdfabf85ee84ac92461d142f22cf8badd0e54c" +dependencies = [ + "errno", + "libc", + "thiserror", +] + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "serde", + "time 0.1.44", + "winapi", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", +] + +[[package]] +name = "cipher" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags", + "strsim 0.8.0", + "textwrap 0.11.0", + "unicode-width", + "vec_map", +] + +[[package]] +name = "clap" +version = "3.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54635806b078b7925d6e36810b1755f2a4b5b4d57560432c1ecf60bcbe10602b" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "once_cell", + "strsim 0.10.0", + "termcolor", + "textwrap 0.15.0", +] + +[[package]] +name = "clap_derive" +version = "3.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759bf187376e1afa7b85b959e6a664a3e7a95203415dba952ad19139e798f902" +dependencies = [ + "heck 0.4.0", + "proc-macro-error", + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "console" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "regex", + "terminal_size", + "unicode-width", + "winapi", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494" +dependencies = [ + "log", + "web-sys", +] + +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "criterion" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" +dependencies = [ + "atty", + "cast", + "clap 2.34.0", + "criterion-plot", + "csv", + "itertools", + "lazy_static", + "num-traits", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_cbor", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" +dependencies = [ + "cast", + "itertools", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "once_cell", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "csv" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" +dependencies = [ + "bstr", + "csv-core", + "itoa 0.4.8", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +dependencies = [ + "memchr", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher 0.3.0", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "serde", + "subtle", + "zeroize", +] + +[[package]] +name = "dashmap" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" +dependencies = [ + "cfg-if", + "num_cpus", + "rayon", +] + +[[package]] +name = "dashmap" +version = "5.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3495912c9c1ccf2e18976439f4443f3fee0fd61f424ff99fde6a66b15ecb448f" +dependencies = [ + "cfg-if", + "hashbrown 0.12.3", + "lock_api", + "parking_lot_core 0.9.3", +] + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + +[[package]] +name = "derivation-path" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" + +[[package]] +name = "dialoguer" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8c8ae48e400addc32a8710c8d62d55cb84249a7d58ac4cd959daecfbaddc545" +dependencies = [ + "console", + "tempfile", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer 0.10.2", + "crypto-common", + "subtle", +] + +[[package]] +name = "dir-diff" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2860407d7d7e2e004bb2128510ad9e8d669e76fa005ccf567977b5d71b8b4a0b" +dependencies = [ + "walkdir", +] + +[[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 = "dlopen" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937" +dependencies = [ + "dlopen_derive", + "lazy_static", + "libc", + "winapi", +] + +[[package]] +name = "dlopen_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581" +dependencies = [ + "libc", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "dyn-clone" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d07a982d1fb29db01e5a59b1918e03da4df7297eaeee7686ac45542fd4e59c8" + +[[package]] +name = "ed25519" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519-dalek-bip32" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d2be62a4061b872c8c0873ee4fc6f101ce7b889d039f019c5fa2af471a59908" +dependencies = [ + "derivation-path", + "ed25519-dalek", + "hmac 0.12.1", + "sha2 0.10.2", +] + +[[package]] +name = "either" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enum-iterator" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "enum_dispatch" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eb359f1476bf611266ac1f5355bc14aeca37b299d0ebccc038ee7058891c9cb" +dependencies = [ + "once_cell", + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "event-listener" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "feature-probe" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" + +[[package]] +name = "filetime" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "windows-sys", +] + +[[package]] +name = "flate2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" + +[[package]] +name = "futures-executor" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" + +[[package]] +name = "futures-macro" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "futures-retry" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde5a672a61f96552aa5ed9fd9c81c3fbdae4be9b1e205d6eaf17c83705adc0f" +dependencies = [ + "futures", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "futures-sink" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" + +[[package]] +name = "futures-task" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" + +[[package]] +name = "futures-util" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +dependencies = [ + "serde", + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "h2" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "histogram" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cb882ccb290b8646e554b157ab0b71e64e8d5bef775cd66b6531e52d302669" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.3", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac 0.8.1", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa 1.0.2", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa 1.0.2", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" +dependencies = [ + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "im" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +dependencies = [ + "bitmaps", + "rand_core 0.6.3", + "rand_xoshiro", + "rayon", + "serde", + "sized-chunks", + "typenum", + "version_check", +] + +[[package]] +name = "index_list" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9d968042a4902e08810946fc7cd5851eb75e80301342305af755ca06cb82ce" + +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indicatif" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" +dependencies = [ + "console", + "lazy_static", + "number_prefix", + "regex", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" + +[[package]] +name = "jobserver" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonrpc-core" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" +dependencies = [ + "futures", + "futures-executor", + "futures-util", + "log", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "keccak" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" + +[[package]] +name = "libloading" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "lock_api" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "lru" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +dependencies = [ + "hashbrown 0.12.3", +] + +[[package]] +name = "lz4" +version = "1.23.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4edcb94251b1c375c459e5abe9fb0168c1c826c3370172684844f8f3f8d1a885" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7be8908e2ed6f31c02db8a9fa962f03e36c53fbfde437363eae3306b85d7e17" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memmap2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a79b39c93a7a5a27eeaf9a23b5ff43f1b9e0ad6b1cdd441140ae53c35613fc7" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.3", + "zeroize", +] + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "miniz_oxide" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +dependencies = [ + "libc", + "log", + "miow", + "ntapi", + "winapi", +] + +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi", +] + +[[package]] +name = "modular-bitfield" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" +dependencies = [ + "modular-bitfield-impl", + "static_assertions", +] + +[[package]] +name = "modular-bitfield-impl" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "native-tls" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nix" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" +dependencies = [ + "bitflags", + "cc", + "cfg-if", + "libc", + "memoffset", +] + +[[package]] +name = "ntapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" +dependencies = [ + "winapi", +] + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +dependencies = [ + "proc-macro-crate 1.1.3", + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "once_cell" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" + +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl" +version = "0.10.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_str_bytes" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4" + +[[package]] +name = "ouroboros" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71643f290d126e18ac2598876d01e1d57aed164afc78fdb6e2a0c6589a1f6662" +dependencies = [ + "aliasable", + "ouroboros_macro", + "stable_deref_trait", +] + +[[package]] +name = "ouroboros_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9a247206016d424fe8497bc611e510887af5c261fbbf977877c4bb55ca4d82" +dependencies = [ + "Inflector", + "proc-macro-error", + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.5", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.3", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac", +] + +[[package]] +name = "pbkdf2" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" +dependencies = [ + "digest 0.10.3", +] + +[[package]] +name = "pem" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c64931a1a212348ec4f3b4362585eca7159d0d09cbdf4a7f74f02173596fd4" +dependencies = [ + "base64 0.13.0", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + +[[package]] +name = "pkg-config" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" + +[[package]] +name = "plotters" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9428003b84df1496fb9d6eeee9c5f8145cb41ca375eb0dad204328888832811f" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" + +[[package]] +name = "plotters-svg" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0918736323d1baff32ee0eade54984f6f201ad7e97d5cfb5d6ab4a358529615" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "polyval" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid 0.1.0", +] + +[[package]] +name = "proc-macro2" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proc-macro2-diagnostics" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", + "version_check", + "yansi", +] + +[[package]] +name = "pyth-sdk" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f262b88557d8f152a247e1be786a8359d63112fac0a6e49fa41082a8ef789e8d" +dependencies = [ + "borsh", + "borsh-derive", + "hex", + "schemars", + "serde", +] + +[[package]] +name = "pyth-sdk-solana" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aed1a0b714f91cb104cc025eb806782e30aa63c23259724e79efd609294a2c9" +dependencies = [ + "borsh", + "borsh-derive", + "bytemuck", + "num-derive", + "num-traits", + "pyth-sdk", + "serde", + "solana-program", + "thiserror", +] + +[[package]] +name = "qstring" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "quick-protobuf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ca6639207ac869e31cca06b8adbc7676278f22b321e51115766009b4f192dbb" +dependencies = [ + "byteorder", +] + +[[package]] +name = "quinn" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7542006acd6e057ff632307d219954c44048f818898da03113d6c0086bfddd9" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "fxhash", + "quinn-proto", + "quinn-udp", + "rustls", + "thiserror", + "tokio", + "tracing", + "webpki", +] + +[[package]] +name = "quinn-proto" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a13a5c0a674c1ce7150c9df7bc4a1e46c2fbbe7c710f56c0dc78b1a810e779e" +dependencies = [ + "bytes", + "fxhash", + "rand 0.8.5", + "ring", + "rustls", + "rustls-native-certs", + "rustls-pemfile 0.2.1", + "slab", + "thiserror", + "tinyvec", + "tracing", + "webpki", +] + +[[package]] +name = "quinn-udp" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3149f7237331015f1a6adf065c397d1be71e032fcf110ba41da52e7926b882f" +dependencies = [ + "futures-util", + "libc", + "quinn-proto", + "socket2", + "tokio", + "tracing", +] + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", +] + +[[package]] +name = "quote" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +dependencies = [ + "proc-macro2 1.0.40", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.7", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core 0.6.3", +] + +[[package]] +name = "rayon" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +dependencies = [ + "autocfg", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "rcgen" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" +dependencies = [ + "pem", + "ring", + "time 0.3.11", + "yasna", +] + +[[package]] +name = "redox_syscall" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534cfe58d6a18cc17120fbf4635d53d14691c1fe4d951064df9bd326178d7d5a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.7", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" + +[[package]] +name = "regex-syntax" +version = "0.6.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "reqwest" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" +dependencies = [ + "base64 0.13.0", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "lazy_static", + "log", + "mime", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile 1.0.0", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rpassword" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf099a1888612545b683d2661a1940089f6c2e5a8e38979b2159da876bfd956" +dependencies = [ + "libc", + "serde", + "serde_json", + "winapi", +] + +[[package]] +name = "rust_decimal" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34a3bb58e85333f1ab191bf979104b586ebd77475bc6681882825f4532dfe87c" +dependencies = [ + "arrayvec", + "num-traits", + "serde", +] + +[[package]] +name = "rust_decimal_macros" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1467556c7c115165aa0346bcf45bc947203bcc880efad85a09ba24ea17926c4" +dependencies = [ + "quote 1.0.20", + "rust_decimal", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.20.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile 1.0.0", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +dependencies = [ + "base64 0.13.0", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" +dependencies = [ + "base64 0.13.0", +] + +[[package]] +name = "rustversion" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8" + +[[package]] +name = "ryu" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys", +] + +[[package]] +name = "schemars" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1847b767a3d62d95cbf3d8a9f0e421cf57a0d8aa4f411d4b16525afb0284d4ed" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af4d7e1b012cb3d9129567661a63755ea4b8a7386d339dc945ae187e403c6743" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "serde_derive_internals", + "syn 1.0.98", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" + +[[package]] +name = "serde" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212e73464ebcde48d723aa02eb270ba62eff38a9b732df31f33f1b4e145f3a54" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "serde_json" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +dependencies = [ + "itoa 1.0.2", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa 1.0.2", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +dependencies = [ + "indexmap", + "ryu", + "serde", + "yaml-rust", +] + +[[package]] +name = "sha-1" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug", +] + +[[package]] +name = "sha3" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881bf8156c87b6301fc5ca6b27f11eeb2761224c7081e69b409d5a1951a70c86" +dependencies = [ + "digest 0.10.3", + "keccak", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" + +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" + +[[package]] +name = "socket2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "solana-account-decoder" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5566de2c1dfc1d2cd98ac4f1da0002f07afe8739eebf98b675db776ec1154bf" +dependencies = [ + "Inflector", + "base64 0.13.0", + "bincode", + "bs58 0.4.0", + "bv", + "lazy_static", + "serde", + "serde_derive", + "serde_json", + "solana-config-program", + "solana-sdk", + "solana-vote-program", + "spl-token", + "spl-token-2022", + "thiserror", + "zstd", +] + +[[package]] +name = "solana-address-lookup-table-program" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b33a3a5244ceb01016fa5454e7cf3bdfb0ef1a0233e2180faeab23e9de2e20" +dependencies = [ + "bincode", + "bytemuck", + "log", + "num-derive", + "num-traits", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-program", + "solana-program-runtime", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-bucket-map" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "867f63e6ddbc85cc67d8aeab3652cbadc2166a243d7b699b59c360b7365bea09" +dependencies = [ + "log", + "memmap2", + "modular-bitfield", + "rand 0.7.3", + "solana-measure", + "solana-sdk", + "tempfile", +] + +[[package]] +name = "solana-clap-utils" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffac283e5971d8020ab1f4270547a9c7b1fce7334bceb36b51dbe8f50d15d1" +dependencies = [ + "chrono", + "clap 2.34.0", + "rpassword", + "solana-perf", + "solana-remote-wallet", + "solana-sdk", + "thiserror", + "tiny-bip39", + "uriparse", + "url", +] + +[[package]] +name = "solana-cli-config" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b8a02275b51f2eba3e591f03e22670f3a9037c2f85df1569957798a70db1de8" +dependencies = [ + "dirs-next", + "lazy_static", + "serde", + "serde_derive", + "serde_yaml", + "solana-clap-utils", + "solana-sdk", + "url", +] + +[[package]] +name = "solana-client" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4116c3bac3cd5bdf057c56edd2cae31b343a7209c5f1c787c1d6855b876a60" +dependencies = [ + "async-mutex", + "async-trait", + "base64 0.13.0", + "bincode", + "bs58 0.4.0", + "bytes", + "clap 2.34.0", + "crossbeam-channel", + "enum_dispatch", + "futures", + "futures-util", + "indexmap", + "indicatif", + "itertools", + "jsonrpc-core", + "lazy_static", + "log", + "lru", + "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-measure", + "solana-metrics", + "solana-net-utils", + "solana-sdk", + "solana-streamer", + "solana-transaction-status", + "solana-version", + "solana-vote-program", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tungstenite", + "url", +] + +[[package]] +name = "solana-compute-budget-program" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9fc32f1573c8c5f6152e5d3e1fde8154a10521aad31961af334e4aef2ebd1b5" +dependencies = [ + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-config-program" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19436078e3a4ac6738bef13c443d6d9e4ef6b0dc0b9114698105869e297a7a30" +dependencies = [ + "bincode", + "chrono", + "serde", + "serde_derive", + "solana-program-runtime", + "solana-sdk", +] + +[[package]] +name = "solana-faucet" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faef37886c062baf0d09cb4080f4ec562f004c2d26171729f2cfe5658a45ab18" +dependencies = [ + "bincode", + "byteorder", + "clap 2.34.0", + "crossbeam-channel", + "log", + "serde", + "serde_derive", + "solana-clap-utils", + "solana-cli-config", + "solana-logger", + "solana-metrics", + "solana-sdk", + "solana-version", + "spl-memo", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-frozen-abi" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89766db2ccf57f6f30f18160c654468ac46de3f767eb12c844db62a36e19a5b" +dependencies = [ + "bs58 0.4.0", + "bv", + "generic-array", + "im", + "lazy_static", + "log", + "memmap2", + "rustc_version", + "serde", + "serde_bytes", + "serde_derive", + "sha2 0.10.2", + "solana-frozen-abi-macro", + "thiserror", +] + +[[package]] +name = "solana-frozen-abi-macro" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17791a9ce9b35729825df9aeac503b9e98c4b9fb8e0ef9dddd1c0aced4634bff" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "rustc_version", + "syn 1.0.98", +] + +[[package]] +name = "solana-logger" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f1ce105bc6fe61e9d7da689bdaf6e8ee9bb4e02cf6021cff9885bf4794a8d5" +dependencies = [ + "env_logger", + "lazy_static", + "log", +] + +[[package]] +name = "solana-measure" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05a82b6eb297cb5eb7e92581426257b656a7e5fbbb5f6a069d6808f4fb16b08" +dependencies = [ + "log", + "solana-sdk", +] + +[[package]] +name = "solana-metrics" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53ef0cc43317d0840feb00e00fbaae1038225c4608b95c9381d7a716c8cda2d7" +dependencies = [ + "crossbeam-channel", + "gethostname", + "lazy_static", + "log", + "reqwest", + "solana-sdk", +] + +[[package]] +name = "solana-net-utils" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216beba525773ad177af18c8c495aca687d6e5ae2344396597c3f0da802769a4" +dependencies = [ + "bincode", + "clap 2.34.0", + "crossbeam-channel", + "log", + "nix", + "rand 0.7.3", + "serde", + "serde_derive", + "socket2", + "solana-logger", + "solana-sdk", + "solana-version", + "tokio", + "url", +] + +[[package]] +name = "solana-perf" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dac62e2f42dce6836075eff7b1524c09862e7952d279c15c7939d387396a60a1" +dependencies = [ + "ahash", + "bincode", + "bv", + "caps", + "curve25519-dalek", + "dlopen", + "dlopen_derive", + "fnv", + "lazy_static", + "libc", + "log", + "nix", + "rand 0.7.3", + "rayon", + "serde", + "solana-metrics", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-vote-program", +] + +[[package]] +name = "solana-program" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf76064ff17622a8bb16fd95993a08d4dbcb8d6fd788e1915f2f5ba14becb879" +dependencies = [ + "base64 0.13.0", + "bincode", + "bitflags", + "blake3", + "borsh", + "borsh-derive", + "bs58 0.4.0", + "bv", + "bytemuck", + "console_error_panic_hook", + "console_log", + "curve25519-dalek", + "getrandom 0.1.16", + "itertools", + "js-sys", + "lazy_static", + "libsecp256k1", + "log", + "num-derive", + "num-traits", + "parking_lot 0.12.1", + "rand 0.7.3", + "rustc_version", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "sha2 0.10.2", + "sha3 0.10.1", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk-macro", + "thiserror", + "wasm-bindgen", +] + +[[package]] +name = "solana-program-runtime" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f6b7e612b01611accd855748ba6abd71701e89ee06bc8b692ebae293dea1bda" +dependencies = [ + "base64 0.13.0", + "bincode", + "enum-iterator", + "itertools", + "libc", + "libloading", + "log", + "num-derive", + "num-traits", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-measure", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-rayon-threadlimit" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "847c905e5c6e8e745b710ef496a62989cd2a64f0fad3de4dbd524db6fd009448" +dependencies = [ + "lazy_static", + "num_cpus", +] + +[[package]] +name = "solana-remote-wallet" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f01d790c0f44399bfa810726edbf2b0a51024ae7fa81b477d919c16c181972b" +dependencies = [ + "console", + "dialoguer", + "log", + "num-derive", + "num-traits", + "parking_lot 0.12.1", + "qstring", + "semver", + "solana-sdk", + "thiserror", + "uriparse", +] + +[[package]] +name = "solana-runtime" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb01f8721b3d754f600b45671f8ad66d1a27f59f348767a2e4727a712c2595b" +dependencies = [ + "arrayref", + "bincode", + "blake3", + "bv", + "bytemuck", + "byteorder", + "bzip2", + "crossbeam-channel", + "dashmap 4.0.2", + "dir-diff", + "flate2", + "fnv", + "im", + "index_list", + "itertools", + "lazy_static", + "log", + "lz4", + "memmap2", + "num-derive", + "num-traits", + "num_cpus", + "ouroboros", + "rand 0.7.3", + "rayon", + "regex", + "rustc_version", + "serde", + "serde_derive", + "solana-address-lookup-table-program", + "solana-bucket-map", + "solana-compute-budget-program", + "solana-config-program", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-measure", + "solana-metrics", + "solana-program-runtime", + "solana-rayon-threadlimit", + "solana-sdk", + "solana-stake-program", + "solana-vote-program", + "solana-zk-token-proof-program", + "solana-zk-token-sdk 1.10.26", + "strum", + "strum_macros", + "symlink", + "tar", + "tempfile", + "thiserror", + "zstd", +] + +[[package]] +name = "solana-sdk" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f100bacac45686395871054f96a62e74d0b3200d0c5f38d92b80946f397cdc0" +dependencies = [ + "assert_matches", + "base64 0.13.0", + "bincode", + "bitflags", + "borsh", + "bs58 0.4.0", + "bytemuck", + "byteorder", + "chrono", + "derivation-path", + "digest 0.10.3", + "ed25519-dalek", + "ed25519-dalek-bip32", + "generic-array", + "hmac 0.12.1", + "itertools", + "js-sys", + "lazy_static", + "libsecp256k1", + "log", + "memmap2", + "num-derive", + "num-traits", + "pbkdf2 0.10.1", + "qstring", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rustc_version", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.2", + "sha3 0.10.1", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-logger", + "solana-program", + "solana-sdk-macro", + "thiserror", + "uriparse", + "wasm-bindgen", +] + +[[package]] +name = "solana-sdk-macro" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03abd6f550ed3bae28c28cd14c1bc883205e5a1d881ad73e89347a40ff753468" +dependencies = [ + "bs58 0.4.0", + "proc-macro2 1.0.40", + "quote 1.0.20", + "rustversion", + "syn 1.0.98", +] + +[[package]] +name = "solana-stake-program" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb65212da8ad318ac2048ea07de452d437ba425b79122228785350f147bb1d7a" +dependencies = [ + "bincode", + "log", + "num-derive", + "num-traits", + "rustc_version", + "serde", + "serde_derive", + "solana-config-program", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-metrics", + "solana-program-runtime", + "solana-sdk", + "solana-vote-program", + "thiserror", +] + +[[package]] +name = "solana-streamer" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64f25ef1160609ec4b4ea35308c34c411c3fb1bd3f360c5cc802a6c62bfc992c" +dependencies = [ + "crossbeam-channel", + "futures-util", + "histogram", + "itertools", + "libc", + "log", + "nix", + "pem", + "pkcs8", + "quinn", + "rand 0.7.3", + "rcgen", + "rustls", + "solana-metrics", + "solana-perf", + "solana-sdk", + "thiserror", + "tokio", +] + +[[package]] +name = "solana-transaction-status" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b370035a9081e70e811f22bc519ba333fa7599a66865f1ec94188e1ce5e0537" +dependencies = [ + "Inflector", + "base64 0.13.0", + "bincode", + "borsh", + "bs58 0.4.0", + "lazy_static", + "log", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-measure", + "solana-metrics", + "solana-runtime", + "solana-sdk", + "solana-vote-program", + "spl-associated-token-account", + "spl-memo", + "spl-token", + "spl-token-2022", + "thiserror", +] + +[[package]] +name = "solana-version" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae36e17588b88162ddcaa53f380d7b733b01bf6a61f97894eb07e48ea6dfd1b1" +dependencies = [ + "log", + "rustc_version", + "semver", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk", +] + +[[package]] +name = "solana-vote-program" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a025c0850b12f1155dd06677a4c29f1fa6a20c1969c2c02b3efc0497096486" +dependencies = [ + "bincode", + "log", + "num-derive", + "num-traits", + "rustc_version", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-metrics", + "solana-program-runtime", + "solana-sdk", + "thiserror", +] + +[[package]] +name = "solana-zk-token-proof-program" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0cb69fd843cce77e057cdac05385efec8e4849c7ed3c9419c3329448f12e8d" +dependencies = [ + "bytemuck", + "getrandom 0.1.16", + "num-derive", + "num-traits", + "solana-program-runtime", + "solana-sdk", + "solana-zk-token-sdk 1.10.26", +] + +[[package]] +name = "solana-zk-token-sdk" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74b149253f9ed1afb68b3161b53b62b637d0dd7a3b328dffdc8bb5878d48358e" +dependencies = [ + "aes-gcm-siv", + "arrayref", + "base64 0.13.0", + "bincode", + "bytemuck", + "byteorder", + "cipher 0.3.0", + "curve25519-dalek", + "getrandom 0.1.16", + "lazy_static", + "merlin", + "num-derive", + "num-traits", + "rand 0.7.3", + "serde", + "serde_json", + "sha3 0.9.1", + "solana-program", + "solana-sdk", + "subtle", + "thiserror", + "zeroize", +] + +[[package]] +name = "solana-zk-token-sdk" +version = "1.10.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180cd887c9b9da4695b8112dc992ffc128cdbc0f6fb6376b04c88c4b6333b39b" +dependencies = [ + "aes-gcm-siv", + "arrayref", + "base64 0.13.0", + "bincode", + "bytemuck", + "byteorder", + "cipher 0.4.3", + "curve25519-dalek", + "getrandom 0.1.16", + "lazy_static", + "merlin", + "num-derive", + "num-traits", + "rand 0.7.3", + "serde", + "serde_json", + "sha3 0.9.1", + "solana-program", + "solana-sdk", + "subtle", + "thiserror", + "zeroize", +] + +[[package]] +name = "solend-liquidator" +version = "0.1.0" +dependencies = [ + "async-trait", + "base64 0.13.0", + "borsh", + "bytes", + "clap 3.2.14", + "criterion", + "dashmap 5.3.4", + "either", + "futures", + "futures-retry", + "http", + "hyper", + "hyper-tls", + "lazy_static", + "log", + "parking_lot 0.12.1", + "pyth-sdk-solana", + "rayon", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-cli-config", + "solana-client", + "solana-program", + "solana-sdk", + "solend-program", + "spl-associated-token-account", + "spl-token", + "switchboard-program", + "switchboard-v2", + "thiserror", + "tokio", + "uint", +] + +[[package]] +name = "solend-liquidator-benchmarking" +version = "0.1.0" +dependencies = [ + "criterion", + "solend-liquidator", + "tokio", +] + +[[package]] +name = "solend-program" +version = "0.1.0" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "solana-program", + "spl-token", + "switchboard-program", + "switchboard-v2", + "thiserror", + "uint", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "spl-associated-token-account" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b013067447a1396303ddfc294f36e3d260a32f8a16c501c295bcdc7de39b490" +dependencies = [ + "borsh", + "solana-program", + "spl-token", +] + +[[package]] +name = "spl-memo" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325" +dependencies = [ + "solana-program", +] + +[[package]] +name = "spl-token" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc67166ef99d10c18cb5e9c208901e6d8255c6513bb1f877977eba48e6cc4fb" +dependencies = [ + "arrayref", + "num-derive", + "num-traits", + "num_enum", + "solana-program", + "thiserror", +] + +[[package]] +name = "spl-token-2022" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce48c69350134e8678de5c0956a531b7de586b28eebdddc03211ceec0660983" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-program", + "solana-zk-token-sdk 0.8.1", + "spl-memo", + "spl-token", + "thiserror", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4faebde00e8ff94316c01800f9054fd2ba77d30d9e922541913051d1d978918b" +dependencies = [ + "heck 0.4.0", + "proc-macro2 1.0.40", + "quote 1.0.20", + "rustversion", + "syn 1.0.98", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "superslice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab16ced94dbd8a46c82fd81e3ed9a8727dac2977ea869d217bcc4ea1f122e81f" + +[[package]] +name = "switchboard-program" +version = "0.2.1" +dependencies = [ + "bincode", + "borsh", + "bytemuck", + "byteorder", + "quick-protobuf", + "solana-program", + "switchboard-protos", + "switchboard-utils", +] + +[[package]] +name = "switchboard-protos" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e2d89875ff72d12ea7918d6ccd82d1ac5eab54b3a9d1bd7356fa6905801aa72" +dependencies = [ + "bincode", + "borsh", + "byteorder", + "quick-protobuf", +] + +[[package]] +name = "switchboard-utils" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ac1d68193aa1669e34d16087db0f96e6597d2f78868378aabc1387b8b29172e" +dependencies = [ + "bincode", + "borsh", + "bytemuck", + "byteorder", + "quick-protobuf", + "rust_decimal", + "rust_decimal_macros", + "solana-program", + "switchboard-protos", +] + +[[package]] +name = "switchboard-v2" +version = "0.1.10" +dependencies = [ + "anchor-lang", + "anchor-spl", + "bytemuck", + "rust_decimal", + "solana-program", + "superslice", +] + +[[package]] +name = "symlink" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" + +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid 0.1.0", +] + +[[package]] +name = "syn" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", + "unicode-xid 0.2.3", +] + +[[package]] +name = "tar" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "textwrap" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" + +[[package]] +name = "thiserror" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +dependencies = [ + "libc", + "num_threads", +] + +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2 0.4.0", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d0183f6f6001549ab68f8c7585093bb732beefbcf6d23a10b9b95c73a1dd49" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "once_cell", + "parking_lot 0.11.2", + "pin-project-lite", + "signal-hook-registry", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-stream" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" +dependencies = [ + "futures-util", + "log", + "rustls", + "tokio", + "tokio-rustls", + "tungstenite", + "webpki", + "webpki-roots", +] + +[[package]] +name = "tokio-util" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", +] + +[[package]] +name = "tracing-core" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "tungstenite" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" +dependencies = [ + "base64 0.13.0", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand 0.8.5", + "rustls", + "sha-1", + "thiserror", + "url", + "utf-8", + "webpki", + "webpki-roots", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "uint" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" + +[[package]] +name = "unicode-normalization" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" + +[[package]] +name = "unicode-width" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" + +[[package]] +name = "unicode-xid" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "uriparse" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" +dependencies = [ + "fnv", + "lazy_static", +] + +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +dependencies = [ + "quote 1.0.20", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" + +[[package]] +name = "web-sys" +version = "0.3.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" +dependencies = [ + "webpki", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "xattr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +dependencies = [ + "libc", +] + +[[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 = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "yasna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346d34a236c9d3e5f3b9b74563f238f955bbd05fa0b8b4efa53c130c43982f4c" +dependencies = [ + "time 0.3.11", +] + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" +dependencies = [ + "proc-macro2 1.0.40", + "quote 1.0.20", + "syn 1.0.98", + "synstructure", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.1+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" +dependencies = [ + "cc", + "libc", +] diff --git a/solend-liquidator-benchmarking/Cargo.toml b/solend-liquidator-benchmarking/Cargo.toml new file mode 100644 index 0000000..b9b0ffb --- /dev/null +++ b/solend-liquidator-benchmarking/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "solend-liquidator-benchmarking" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +tokio = { version = "1.14.1", features = ["full"] } + +[dev-dependencies] +criterion = "0.3" +solend-liquidator = { path = "../solend-liquidator" } + +[[bench]] +name = "liquidate" +harness = false \ No newline at end of file diff --git a/solend-liquidator-benchmarking/benches/liquidate.rs b/solend-liquidator-benchmarking/benches/liquidate.rs new file mode 100644 index 0000000..5c6c3a9 --- /dev/null +++ b/solend-liquidator-benchmarking/benches/liquidate.rs @@ -0,0 +1,64 @@ +use criterion::{black_box, criterion_group, criterion_main, BenchmarkGroup, Criterion}; + +fn liquidate(_n: u64) { + let runtime = tokio::runtime::Runtime::new().unwrap(); + + runtime.block_on(async move { + // solend_liquidator::client::run_liquidator_iter(String::from( + // "../solend-liquidator/private/liquidator_main.json", + // )) + // .await; + + // let obligation_path = String::from("./fixtures/calculate_refreshed_obligation_9fGaP5fHsCAt7J1PK97kbXTPYjG6UiDGBw1VT6FSCnr3"); + + // let data = tokio::fs::read(obligation_path).await.unwrap(); + // let obligation_fixture: client::fixtures::CalculateRefreshedObligationFixture = + // serde_json::from_slice(&data).unwrap(); + + // // println!("obligation_fixture: {:?}", obligation_fixture); + + // let arguments = obligation_fixture.decode(); + // let refreshed_obligation = calculate_refreshed_obligation( + // &Enhanced { + // inner: arguments.0, + // pubkey: Pubkey::from_str("9fGaP5fHsCAt7J1PK97kbXTPYjG6UiDGBw1VT6FSCnr3").unwrap(), + // }, + // &arguments.1, + // &arguments.2, + // ) + // .await + // .unwrap(); + + // let decimals = 1e8 as f64; + // println!("refreshed_obligation: {:?}", refreshed_obligation); + // println!("refreshed_obligation.borrowed_value: {:?}", refreshed_obligation.borrowed_value.as_u128() as f64 / decimals); + // println!("refreshed_obligation.liquidation_limit: {:?}", refreshed_obligation.unhealthy_borrow_value.as_u128() as f64 / decimals); + + // // let borrowed_value_real = 749209978243u128; + // // let unhealthy_borrow_real = 849493781460u128; + // // println!("unhealthy_borrow_real: {:?}", unhealthy_borrow_real); + + // // assert_eq!(refreshed_obligation.borrowed_value.as_u128(), borrowed_value_real); + // // assert_eq!(refreshed_obligation.unhealthy_borrow_value.as_u128(), unhealthy_borrow_real); + }) +} + +fn criterion_benchmark(c: &mut Criterion) { + // c.bench_function("liquidate iter", |b| b.iter(|| liquidate(black_box(1)))); + + // let b = c.sample_size(10); + c.bench_function( + "liquidate iter", + BenchmarkGroup::new("routine_1", |b| b.iter(|| liquidate(1))).sample_size(10), + ); + + // c.bench( + // / "routines", + // / Benchmark::new("routine_1", |b| b.iter(|| routine_1())) + // / .with_function("routine_2", |b| b.iter(|| routine_2())) + // / .sample_size(50) + // / ); +} + +criterion_group!(benches, criterion_benchmark); +criterion_main!(benches); diff --git a/solend-liquidator-benchmarking/src/main.rs b/solend-liquidator-benchmarking/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/solend-liquidator-benchmarking/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/solend-liquidator/Cargo.lock b/solend-liquidator/Cargo.lock index 6230e13..a306cc1 100755 --- a/solend-liquidator/Cargo.lock +++ b/solend-liquidator/Cargo.lock @@ -757,6 +757,20 @@ dependencies = [ "itertools", ] +[[package]] +name = "crossbeam" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" +dependencies = [ + "cfg-if", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + [[package]] name = "crossbeam-channel" version = "0.5.5" @@ -792,6 +806,16 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.10" @@ -884,6 +908,18 @@ dependencies = [ "rayon", ] +[[package]] +name = "dashmap" +version = "5.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3495912c9c1ccf2e18976439f4443f3fee0fd61f424ff99fde6a66b15ecb448f" +dependencies = [ + "cfg-if", + "hashbrown 0.12.1", + "lock_api", + "parking_lot_core 0.9.3", +] + [[package]] name = "der" version = "0.5.1" @@ -3483,7 +3519,7 @@ dependencies = [ "byteorder", "bzip2", "crossbeam-channel", - "dashmap", + "dashmap 4.0.2", "dir-diff", "flate2", "fnv", @@ -3786,11 +3822,14 @@ dependencies = [ name = "solend-liquidator" version = "0.1.0" dependencies = [ + "async-trait", "base64 0.13.0", "borsh", "bytes", "clap 3.2.14", "criterion", + "crossbeam", + "dashmap 5.3.4", "either", "futures", "futures-retry", @@ -3801,6 +3840,7 @@ dependencies = [ "log", "parking_lot 0.12.1", "pyth-sdk-solana", + "rayon", "serde", "serde_derive", "serde_json", diff --git a/solend-liquidator/Cargo.toml b/solend-liquidator/Cargo.toml index 82be090..f75a684 100755 --- a/solend-liquidator/Cargo.toml +++ b/solend-liquidator/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +async-trait = "0.1.56" tokio = { version = "1.14.1", features = ["full"] } hyper = { version = "0.14.17", features = ["full"] } hyper-tls = "0.5.0" @@ -36,10 +37,6 @@ futures-retry = "0.6.0" log = "0.4.17" clap = { version = "3.2.14", features = ["derive"] } parking_lot = "0.12.1" - -[dev-dependencies] -criterion = "0.3" - -[[bench]] -name = "liquidation" -harness = false +dashmap = "5.3.4" +crossbeam = "0.8.2" +rayon = "1.5.3" \ No newline at end of file diff --git a/solend-liquidator/benches/liquidation.rs b/solend-liquidator/benches/liquidation.rs deleted file mode 100755 index 2f614ac..0000000 --- a/solend-liquidator/benches/liquidation.rs +++ /dev/null @@ -1,16 +0,0 @@ -use criterion::{black_box, criterion_group, criterion_main, Criterion}; - -fn fibonacci(n: u64) -> u64 { - match n { - 0 => 1, - 1 => 1, - n => fibonacci(n - 1) + fibonacci(n - 2), - } -} - -fn criterion_benchmark(c: &mut Criterion) { - c.bench_function("fib 20", |b| b.iter(|| fibonacci(black_box(20)))); -} - -criterion_group!(benches, criterion_benchmark); -criterion_main!(benches); diff --git a/solend-liquidator/src/binding.rs b/solend-liquidator/src/binding.rs new file mode 100644 index 0000000..5c959a9 --- /dev/null +++ b/solend-liquidator/src/binding.rs @@ -0,0 +1,139 @@ +use std::collections::HashMap; +use std::{ + cmp::{max, min}, + time::SystemTime, +}; + +use solana_program::pubkey::Pubkey; + +use futures_retry::FutureFactory; + +use solend_program::math::{Decimal, Rate}; +use solend_program::state::{Obligation, Reserve}; + +use solend_program::{ + error::LendingError, + math::{TryAdd, TryDiv, TryMul, TrySub}, +}; + +use crate::client_model::*; + +pub fn refresh_obligation( + enhanced_obligation: &Enhanced, + all_reserves: &HashMap>, + tokens_oracle: &HashMap, +) -> Result<(Obligation, Vec, Vec), Box> { + let mut obligation = enhanced_obligation.inner.clone(); + + let mut deposited_value = Decimal::zero(); + let mut borrowed_value = Decimal::zero(); + let mut allowed_borrow_value = Decimal::zero(); + let mut unhealthy_borrow_value = Decimal::zero(); + + let mut deposits = vec![]; + let mut borrows = vec![]; + + for (_index, collateral) in obligation.deposits.iter_mut().enumerate() { + let deposit_reserve = all_reserves.get(&collateral.deposit_reserve); + + if deposit_reserve.is_none() { + // println!("DEPOSIT: oracle price not discovered for: {:?}", collateral); + return Err(LendingError::InvalidAccountInput.into()); + } + + let deposit_reserve = deposit_reserve.unwrap(); + + let token_oracle = tokens_oracle.get(&collateral.deposit_reserve); + + if token_oracle.is_none() { + return Err(LendingError::InvalidAccountInput.into()); + } + + let token_oracle = token_oracle.unwrap(); + + // @TODO: add lookup table https://git.io/JOCYq + let decimals = 10u64 + .checked_pow(deposit_reserve.inner.liquidity.mint_decimals as u32) + .ok_or(LendingError::MathOverflow)?; + + let market_value = deposit_reserve + .inner + .collateral_exchange_rate()? + .decimal_collateral_to_liquidity(collateral.deposited_amount.into())? + .try_mul(deposit_reserve.inner.liquidity.market_price)? + .try_div(decimals)?; + collateral.market_value = market_value; + + let loan_to_value_rate = + Rate::from_percent(deposit_reserve.inner.config.loan_to_value_ratio); + let liquidation_threshold_rate = + Rate::from_percent(deposit_reserve.inner.config.liquidation_threshold); + + deposited_value = deposited_value.try_add(market_value)?; + allowed_borrow_value = + allowed_borrow_value.try_add(market_value.try_mul(loan_to_value_rate)?)?; + unhealthy_borrow_value = + unhealthy_borrow_value.try_add(market_value.try_mul(liquidation_threshold_rate)?)?; + + let casted_depo = Deposit { + deposit_reserve: collateral.deposit_reserve, + deposit_amount: collateral.deposited_amount, + market_value, + symbol: token_oracle.symbol.clone(), + }; + + deposits.push(casted_depo); + } + + for (_index, liquidity) in obligation.borrows.iter_mut().enumerate() { + let reserve = all_reserves.get(&liquidity.borrow_reserve); + + let token_oracle = tokens_oracle.get(&liquidity.borrow_reserve); + + if token_oracle.is_none() { + return Err(LendingError::InvalidAccountInput.into()); + } + + let token_oracle = token_oracle.unwrap(); + + if reserve.is_none() { + return Err(LendingError::InvalidAccountInput.into()); + } + let reserve = reserve.unwrap(); + let borrow_reserve = &reserve.inner; + + liquidity.accrue_interest(borrow_reserve.liquidity.cumulative_borrow_rate_wads)?; + + // @TODO: add lookup table https://git.io/JOCYq + let decimals = 10u64 + .checked_pow(borrow_reserve.liquidity.mint_decimals as u32) + .ok_or(LendingError::MathOverflow)?; + + let market_value = liquidity + .borrowed_amount_wads + .try_mul(borrow_reserve.liquidity.market_price)? + .try_div(decimals)?; + liquidity.market_value = market_value; + + borrowed_value = borrowed_value.try_add(market_value)?; + + let casted_borrow = Borrow { + borrow_reserve: liquidity.borrow_reserve, + borrow_amount_wads: liquidity.borrowed_amount_wads, + mint_address: token_oracle.mint_address, + market_value, + symbol: token_oracle.symbol.clone(), + }; + + borrows.push(casted_borrow); + } + + obligation.deposited_value = deposited_value; + obligation.borrowed_value = borrowed_value; + + + obligation.allowed_borrow_value = allowed_borrow_value; + obligation.unhealthy_borrow_value = unhealthy_borrow_value; + + Ok((obligation, deposits, borrows)) +} diff --git a/solend-liquidator/src/client.rs b/solend-liquidator/src/client.rs index 3528927..44948a8 100755 --- a/solend-liquidator/src/client.rs +++ b/solend-liquidator/src/client.rs @@ -1,5 +1,6 @@ use std::collections::{HashMap, HashSet}; -use std::ops::{Add, Div, Mul}; +use std::ops::{Deref, DerefMut}; +use std::ops::{Div, Mul}; use std::sync::Arc; use hyper::Body; @@ -7,6 +8,7 @@ use hyper::Body; use hyper::{Client as HyperClient, Method, Request}; use hyper_tls::HttpsConnector; +use async_trait::async_trait; use borsh::BorshDeserialize; use { @@ -21,47 +23,37 @@ use { std::str::FromStr, }; -use futures_retry::{FutureFactory, FutureRetry, RetryPolicy}; use either::Either; -use parking_lot::RwLock; +use futures_retry::FutureRetry; +use parking_lot::{FairMutex, Mutex, RwLock}; -use log::Log; use pyth_sdk_solana; use solana_account_decoder::UiAccountEncoding; use solana_client::rpc_config::{RpcProgramAccountsConfig, RpcSendTransactionConfig}; use solana_client::rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType}; -use solana_client::rpc_request::RpcError; use solana_program::instruction::Instruction; use solana_sdk::account::create_is_signer_account_infos; use solana_sdk::commitment_config::CommitmentLevel; -use solend_program::math::{Decimal, Rate}; +use solend_program::math::Decimal; use solend_program::state::{Obligation, Reserve}; use spl_associated_token_account::get_associated_token_address; use switchboard_program::AggregatorState; -use uint::construct_uint; -use crate::log::Logger; +use crate::client_model::*; +use crate::constants::*; +use crate::helpers::*; use crate::model::{self, Market, SolendConfig}; +// use crate::performance::{PerformanceMeter, Setting}; use crate::utils::body_to_string; -construct_uint! { - pub struct U256(4); -} - -fn handle_error(e: E) -> RetryPolicy { - RetryPolicy::WaitRetry(std::time::Duration::from_millis(150)) - // RetryPolicy::ForwardError(e) -} - pub struct Client { client: HyperClient>, config: Config, solend_cfg: Option<&'static SolendConfig>, - logger: Arc>, } pub struct Config { @@ -75,7 +67,7 @@ pub fn get_config(keypair_path: String) -> Config { ..solana_cli_config::Config::default() }; - let json_rpc_url = String::from("https://polished-patient-brook.solana-mainnet.quiknode.pro/57a057b48182876ac38c7fb2131d8418e0a92f43/"); + let json_rpc_url = String::from("https://broken-dawn-field.solana-mainnet.quiknode.pro/52908360084c7e0666532c96647b9b239ec5cadf/"); let signer = solana_sdk::signer::keypair::read_keypair_file(cli_config.keypair_path).unwrap(); @@ -85,40 +77,23 @@ pub fn get_config(keypair_path: String) -> Config { CommitmentConfig::confirmed(), ))), signer: Box::new(signer), - // lending_program_id, - // verbose, - // dry_run, } } -#[derive(Debug, Clone)] -pub struct OracleData { - pub symbol: String, - pub reserve_address: Pubkey, - pub mint_address: Pubkey, - pub decimals: i64, - pub price: U256, // pub price: pyth_sdk_solana::state::PriceFeed, -} +impl Client { + const CFG_PRESET: &'static str = "production"; -#[derive(Debug, Clone)] -pub struct Enhanced { - pub inner: T, - pub pubkey: Pubkey, -} + pub fn signer(&self) -> &Box { + &self.config.signer + } -lazy_static::lazy_static! { - static ref SWITCHBOARD_V1_ADDRESS: Pubkey = - Pubkey::from_str("DtmE9D2CSB4L5D6A15mraeEjrGMm6auWVzgaD8hK2tZM").unwrap(); - static ref SWITCHBOARD_V2_ADDRESS: Pubkey = - Pubkey::from_str("SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f").unwrap(); - static ref NULL_ORACLE: Pubkey = - Pubkey::from_str("nu11111111111111111111111111111111111111111").unwrap(); - static ref SOLEND_PROGRAM_ID: Pubkey = - Pubkey::from_str("So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo").unwrap(); -} + pub fn rpc_client(&self) -> &Arc> { + &self.config.rpc_client + } -impl Client { - const CFG_PRESET: &'static str = "production"; + pub fn solend_config(&self) -> Option<&'static SolendConfig> { + self.solend_cfg + } pub fn new(keypair_path: String) -> Self { let client = HyperClient::builder().build::<_, Body>(HttpsConnector::new()); @@ -128,7 +103,6 @@ impl Client { client, config, solend_cfg: None, - logger: Arc::new(Box::new(Logger::new())), } } @@ -144,10 +118,8 @@ impl Client { .unwrap(); let res = self.client.request(request).await.unwrap(); - let body = res.into_body(); let body_str = body_to_string(body).await; - // println!("body_str: {:?}", body_str); let solend_cfg: SolendConfig = serde_json::from_str(&body_str).unwrap(); @@ -157,20 +129,22 @@ impl Client { pub async fn get_token_oracle_data( &self, market_reserves: &Vec, - ) -> Vec { + ) -> HashMap { let rpc = &self.config.rpc_client; - let mut oracle_data_list = vec![]; + + let result: Arc>> = Arc::new(Mutex::new(HashMap::new())); let mut handles = vec![]; for market_reserve in market_reserves { let c_rpc = Arc::clone(&rpc); let market_reserve = market_reserve.clone(); + let c_result = Arc::clone(&result); + let h = tokio::spawn(async move { if let Some(oracle_data) = Self::get_oracle_data(&c_rpc, &market_reserve).await { - Some(oracle_data) - } else { - None + let mut w = c_result.lock(); + w.insert(oracle_data.reserve_address, oracle_data); } }); @@ -178,56 +152,33 @@ impl Client { } for h in handles { - match h.await.unwrap() { - Some(v) => { - oracle_data_list.push(v); - } - None => { - continue; - } - } + h.await.unwrap(); } - oracle_data_list + Arc::try_unwrap(result).unwrap().into_inner() } - // const NULL_ORACLE: &'static str = "nu11111111111111111111111111111111111111111"; - // const SWITCHBOARD_V1_ADDRESS: &'static str = "DtmE9D2CSB4L5D6A15mraeEjrGMm6auWVzgaD8hK2tZM"; - // const SWITCHBOARD_V2_ADDRESS: &'static str = "SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f"; - async fn get_oracle_data( rpc: &Arc>, reserve: &model::Resef, ) -> Option { - // let oracle = { - // let mut v = Default::default(); - // for oracle_asset in &reserve { - // if oracle_asset.address == reserve.address { - // v = oracle_asset.clone(); - // break; - // } - // } - // v - // }; - - // let rpc: &RpcClient = &self.config.rpc_client; - // let price = - - let price = if !reserve.pyth_oracle.is_empty() - && Pubkey::from_str(reserve.pyth_oracle.as_str()).unwrap() != *NULL_ORACLE - { - let price_public_key = Pubkey::from_str(reserve.pyth_oracle.as_str()).unwrap(); + let oracle = FormedOracle { + price_address: Pubkey::from_str(reserve.pyth_oracle.as_str()).unwrap(), + switchboard_feed_address: Pubkey::from_str(reserve.switchboard_oracle.as_str()) + .unwrap(), + }; + + let decimals = 10i64.pow(reserve.liquidity_token.decimals as u32); + let precision = 1e9 as f64; + + let price = if oracle.price_address != *NULL_ORACLE { + let price_public_key = &oracle.price_address; let mut result = rpc.get_account(&price_public_key).await.unwrap(); let result = pyth_sdk_solana::load_price_feed_from_account(&price_public_key, &mut result) .unwrap(); - // println!( - // "🎱 oracle: 1st case: {:?}", - // result.get_current_price_unchecked().price - // ); - // logger Some(U256::from(result.get_current_price_unchecked().price)) } else { let price_public_key = Pubkey::from_str(reserve.switchboard_oracle.as_str()).unwrap(); @@ -235,11 +186,6 @@ impl Client { let owner = info.owner.clone(); if owner == *SWITCHBOARD_V1_ADDRESS { - // println!("byte len: {:?}", info.data.len()); - // println!("bytes[0]: {:?}", info.data[0]); - // println!("bytes[1]: {:?}", info.data[1]); - // println!("AggregatorState::LEN : {:?}", AggregatorState); - let result = AggregatorState::try_from_slice(&info.data); if result.is_err() { @@ -247,14 +193,19 @@ impl Client { } let result = result.unwrap(); - // println!( - // "🎱 oracle: 2nd case: {:?}", - // result.last_round_result.as_ref().unwrap().result.unwrap() as i64 - // ); - - Some(U256::from( - result.last_round_result.unwrap().result.unwrap() as i64, - )) + let result = *result + .last_round_result + .as_ref() + .unwrap() + .result + .as_ref() + .unwrap(); + let result = result * precision; + let result = U256::from(result as u64) + .mul(decimals) + .div(precision as u64); + + Some(result) } else if owner == *SWITCHBOARD_V2_ADDRESS { let mut info = info.clone(); let inner_accs = vec![(&price_public_key, false, &mut info)]; @@ -265,64 +216,92 @@ impl Client { let retrieved = result.get_result().unwrap(); let retrieved: f64 = retrieved.try_into().unwrap(); - // println!("🎱 oracle: 3rd case: {:?}", retrieved); - - Some(U256::from(retrieved as i64)) - // Some(retrieved.to_f64()) - // match retrieved { - // Ok(v) => { - // println!("🎱 oracle: 3rd case: {:?}", v.result.as_ref().unwrap()); - // Some(U256::from(v.result.unwrap() as i64)) - // } - - // Err(_) => None, - // } + let result = retrieved * precision; + let result = U256::from(result as u64) + .mul(decimals) + .div(precision as u64); + + Some(result) } else { - // println!( - // "🎱 oracle: unrecognized switchboard owner address: {:}", - // owner - // ); None } }; - // let solend_cfg = self.solend_cfg.unwrap(); - match price { - Some(price) => { - Some(OracleData { - // pub symbol: String, - // pub reserve_address: Pubkey, - // pub mint_address: Pubkey, - // pub decimals: u8, - // pub price: pyth_sdk_solana::state::Price - symbol: reserve.liquidity_token.symbol.clone(), - reserve_address: Pubkey::from_str(reserve.address.as_str()).unwrap(), - mint_address: Pubkey::from_str(reserve.liquidity_token.mint.as_str()).unwrap(), - decimals: 10i64.pow(reserve.liquidity_token.decimals as u32), - price, - }) - } + Some(price) => Some(OracleData { + symbol: reserve.liquidity_token.symbol.clone(), + reserve_address: Pubkey::from_str(reserve.address.as_str()).unwrap(), + mint_address: Pubkey::from_str(reserve.liquidity_token.mint.as_str()).unwrap(), + decimals, + price: price.as_u64(), + }), None => None, } } - pub async fn get_obligation(&self, data_account: Either<&str, Pubkey>) -> Option> { + pub async fn get_obligation( + &self, + data_account: Either<&str, Pubkey>, + ) -> Option> { let data_pubkey = match data_account { Either::Left(v) => Pubkey::from_str(v).unwrap(), - Either::Right(v) => v + Either::Right(v) => v, }; match self.config.rpc_client.get_account_data(&data_pubkey).await { Ok(data_account) => { let obligation = Obligation::unpack(&data_account).unwrap(); - Some(Enhanced { inner: obligation, pubkey: data_pubkey }) - }, - _ => None + Some(Enhanced { + inner: obligation, + pubkey: data_pubkey, + }) + } + _ => None, + } + } + + pub async fn update_obligations( + &'static self, + obligations: Vec, + ) -> HashMap>>> { + let result: Arc>>>>> = + Arc::new(Mutex::new(HashMap::new())); + + let mut handles = vec![]; + + println!("obligations: {:?}", obligations.len()); + for obligation_pubkey in obligations { + let c_rpc = Arc::clone(&self.config.rpc_client); + let obligation_pubkey = obligation_pubkey.clone(); + let result = Arc::clone(&result); + + let h = tokio::spawn(async move { + let obl_account = c_rpc.get_account(&obligation_pubkey).await.unwrap(); + let obligation = Obligation::unpack(&obl_account.data).unwrap(); + + let obl = Arc::new(RwLock::new(Enhanced { + inner: obligation, + pubkey: obligation_pubkey.clone(), + })); + + let mut w = result.lock(); + w.insert(obligation_pubkey.clone(), obl); + }); + + handles.push(h) + } + + for h in handles { + h.await.unwrap(); } + + Arc::try_unwrap(result).unwrap().into_inner() } - pub async fn get_obligations(&self, market_address: &str) -> HashMap>>> { + pub async fn get_obligations( + &self, + market_address: &str, + ) -> HashMap>>> { let rpc: &RpcClient = &self.config.rpc_client; let _solend_cfg = self.solend_cfg.unwrap(); @@ -339,12 +318,7 @@ impl Client { .get_program_accounts_with_config( &program_id, RpcProgramAccountsConfig { - filters: Some(vec![ - // RpcFilterType::DataSize(128), - memcmp, - // export const OBLIGATION_LEN = 1300; - RpcFilterType::DataSize(1300), - ]), + filters: Some(vec![memcmp, RpcFilterType::DataSize(1300)]), account_config: RpcAccountInfoConfig { encoding: Some(UiAccountEncoding::Base64), commitment: Some(rpc.commitment()), @@ -363,17 +337,11 @@ impl Client { } let obligations_encoded = obligations_encoded.unwrap(); - // let mut obligations_list = vec![]; for obligation_encoded in &obligations_encoded { let &(obl_pubkey, ref obl_account) = obligation_encoded; let obligation = Obligation::unpack(&obl_account.data).unwrap(); - // obligations_list.push(Enhanced { - // inner: obligation, - // pubkey: obl_pubkey, - // }); - let obl = Arc::new(RwLock::new(Enhanced { inner: obligation, pubkey: obl_pubkey, @@ -384,9 +352,8 @@ impl Client { obligations } - pub async fn get_reserves(&self, market_address: &str) -> Vec> { + pub async fn get_reserves(&self, market_address: &str) -> HashMap> { let rpc: &RpcClient = &self.config.rpc_client; - let _solend_cfg = self.solend_cfg.unwrap(); let program_id = SOLEND_PROGRAM_ID.clone(); let market_address = Pubkey::from_str(market_address).unwrap(); @@ -401,12 +368,7 @@ impl Client { .get_program_accounts_with_config( &program_id, RpcProgramAccountsConfig { - filters: Some(vec![ - // RpcFilterType::DataSize(128), - memcmp, - // export const RESERVE_LEN = 619; - RpcFilterType::DataSize(619), - ]), + filters: Some(vec![memcmp, RpcFilterType::DataSize(619)]), account_config: RpcAccountInfoConfig { encoding: Some(UiAccountEncoding::Base64), commitment: Some(rpc.commitment()), @@ -419,32 +381,44 @@ impl Client { .await; if reserves_encoded.is_err() { - // panic!("none got"); - return vec![]; + return HashMap::new(); } - let reserves_encoded = reserves_encoded.unwrap(); - let mut reserves_list = vec![]; + let reserves_encoded = reserves_encoded.unwrap(); + let result: Arc>>> = + Arc::new(Mutex::new(HashMap::new())); + let mut handles = vec![]; for reserve_item in &reserves_encoded { - let &(reserve_pubkey, ref reserve_account) = reserve_item; - let reserve_unpacked = Reserve::unpack(&reserve_account.data).unwrap(); + let reserve_item = reserve_item.clone(); + let c_result = Arc::clone(&result); - reserves_list.push(Enhanced { - inner: reserve_unpacked, - pubkey: reserve_pubkey, + let h = tokio::spawn(async move { + let mut w = c_result.lock(); + + let (reserve_pubkey, reserve_account) = reserve_item; + let reserve_unpacked = Reserve::unpack(&reserve_account.data).unwrap(); + + w.insert( + reserve_pubkey, + Enhanced { + inner: reserve_unpacked, + pubkey: reserve_pubkey, + }, + ); }); + + handles.push(h); } - reserves_list - } + for h in handles { + h.await.unwrap(); + } - // pub fn get_token_info(assets: &Vec, symbol: &str) -> Asset { - // let idx = assets.iter().position(|a| a.symbol == symbol).unwrap(); - // assets[idx].clone() - // } + Arc::try_unwrap(result).unwrap().into_inner() + } - async fn get_or_create_account_data( + pub async fn get_or_create_account_data( funding_address: &Pubkey, wallet_address: &Pubkey, spl_token_mint_address: &Pubkey, @@ -458,8 +432,8 @@ impl Client { match rpc_client.get_account_data(&associated_token_address).await { Err(_) => { - println!("account {:?} is empty. creating...", associated_token_address.to_string()); - + // println!("account {:?} is empty. creating...", associated_token_address.to_string()); + let ix = spl_associated_token_account::instruction::create_associated_token_account( funding_address, wallet_address, @@ -473,7 +447,7 @@ impl Client { let transaction: &'static _ = Box::leak(Box::new(transaction.clone())); - let r = rpc_client + let _r = rpc_client .send_transaction_with_config( transaction, RpcSendTransactionConfig { @@ -485,12 +459,12 @@ impl Client { .await .unwrap(); - println!("created account {:}! tx: {:?}", associated_token_address.to_string(), r); + // println!("created account {:}! tx: {:?}", associated_token_address.to_string(), r); associated_token_address - }, + } _ => { - println!("account {:?} is not empty", associated_token_address.to_string()); + // println!("account {:?} is not empty", associated_token_address.to_string()); associated_token_address } @@ -518,20 +492,17 @@ impl Client { ); (associated_token_address, Some(ix)) - }, - _ => (associated_token_address, None) + } + _ => (associated_token_address, None), } - } pub async fn liquidate_and_redeem( &self, - retrieved_wallet_data: &WalletBalanceData, - // selected_borrow_symbol: String, - // selected_deposit_symbol: String, + liqudity_amount: u64, selected_borrow: &Borrow, selected_deposit: &Deposit, - lending_market: Market, + lending_market: &Market, obligation: &Enhanced, ) -> Result<(), Box> { let payer_pubkey = self.config.signer.pubkey(); @@ -594,7 +565,7 @@ impl Client { // reserve_pubkeys *SOLEND_PROGRAM_ID, obligation.pubkey, - total_reserves + total_reserves, ); ixs.push(refresh_obligation_ix); @@ -602,17 +573,11 @@ impl Client { x.liquidity_token.symbol == *repay_token_symbol }); - // get account that will be repaying the reserve liquidity let repay_account = spl_associated_token_account::get_associated_token_address( - // wallet_address, - // spl_token_mint_address &payer_pubkey, &Pubkey::from_str(repay_token_info.liquidity_token.mint.as_str()).unwrap(), ); - // const reserveSymbolToReserveMap = new Map( - // lendingMarket.reserves.map((reserve) => [reserve.liquidityToken.symbol, reserve]), - // ); let mut reserve_symbol_to_reserve_map: HashMap = HashMap::new(); for r in &lending_market.reserves { reserve_symbol_to_reserve_map.insert(r.liquidity_token.symbol.clone(), r.clone()); @@ -625,9 +590,6 @@ impl Client { x.liquidity_token.symbol == *withdraw_token_symbol }); - // if (!withdrawReserve || !repayReserve) { - // throw new Error('reserves are not identified'); - // } if withdraw_reserve.is_none() || repay_reserve.is_none() { return Err(Box::new( LiquidationAndRedeemError::ReservesAreNotIdentified, @@ -637,19 +599,6 @@ impl Client { let withdraw_reserve = withdraw_reserve.unwrap(); let repay_reserve = repay_reserve.unwrap(); - // let rewarded_withdrawal_collateral_account = - // spl_associated_token_account::get_associated_token_address( - // // wallet_address, - // // spl_token_mint_address - // &payer_pubkey, - // &Pubkey::from_str(withdraw_reserve.collateral_mint_address.as_str()).unwrap(), - // ); - // let rewarded_withdrawal_collateral_account_info = self - // .config - // .rpc_client - // .get_account(&rewarded_withdrawal_collateral_account) - // .await - // .unwrap(); let (rewarded_withdrawal_collateral_account, rewarded_withdrawal_collateral_account_ix) = Self::get_or_substitute_account_data( &payer_pubkey, @@ -681,7 +630,7 @@ impl Client { // program_id, SOLEND_PROGRAM_ID.clone(), // liquidity_amount, - retrieved_wallet_data.balance.as_u64(), + liqudity_amount, // source_liquidity_pubkey, repay_account, // destination_collateral_pubkey, @@ -716,16 +665,14 @@ impl Client { let r = FutureRetry::new( move || { - self.config - .rpc_client - .send_transaction_with_config( - transaction, - RpcSendTransactionConfig { - skip_preflight: true, - preflight_commitment: Some(CommitmentLevel::Confirmed), - ..RpcSendTransactionConfig::default() - }, - ) + self.config.rpc_client.send_transaction_with_config( + transaction, + RpcSendTransactionConfig { + skip_preflight: true, + preflight_commitment: Some(CommitmentLevel::Confirmed), + ..RpcSendTransactionConfig::default() + }, + ) }, handle_error, ) @@ -752,291 +699,6 @@ impl Client { } } -#[derive(thiserror::Error, Debug)] -pub enum LiquidationAndRedeemError { - #[error("reserves are not identified")] - ReservesAreNotIdentified, -} - -// type Borrow = { -// borrowReserve: PublicKey; -// borrowAmountWads: BN; -// marketValue: BigNumber; -// mintAddress: string, -// symbol: string; -// }; -#[derive(Debug, Clone)] -pub struct Borrow { - pub borrow_reserve: Pubkey, - pub borrow_amount_wads: U256, - pub market_value: U256, - pub mint_address: Pubkey, - pub symbol: String, -} - -// type Deposit = { -// depositReserve: PublicKey, -// depositAmount: BN, -// marketValue: BigNumber, -// symbol: string; -// }; - -#[derive(Debug, Clone)] -pub struct Deposit { - pub deposit_reserve: Pubkey, - pub deposit_amount: U256, - pub market_value: U256, - pub symbol: String, -} - -#[derive(Debug, Clone)] -pub struct RefreshedObligation { - pub deposited_value: U256, - pub borrowed_value: U256, - pub allowed_borrow_value: U256, - pub unhealthy_borrow_value: U256, - pub deposits: Vec, - pub borrows: Vec, - pub utilization_ratio: U256, -} - -pub fn wad() -> U256 { - U256::from(1000000000000000000u128) -} - -pub fn calculate_refreshed_obligation( - obligation: &Obligation, - all_reserves: &Vec>, - tokens_oracle: &Vec, - logger: &Arc>, -) -> Option { - let mut deposited_value = U256::from(0u32); - let mut borrowed_value = U256::from(0u32); - let mut allowed_borrow_value = U256::from(0u32); - let mut unhealthy_borrow_value = U256::from(0u32); - - let mut deposits: Vec = vec![]; - let mut borrows: Vec = vec![]; - - // checked - for deposit in &obligation.deposits { - let token_oracle = tokens_oracle - .iter() - .position(|x| x.reserve_address == deposit.deposit_reserve); - - if token_oracle.is_none() { - // println!( - // " 📥 Missing token info for reserve {:}, skipping this obligation. \n - // Please restart liquidator to fetch latest configs from /v1/config", - // deposit.deposit_reserve - // ); - continue; - } - - let token_oracle = token_oracle.unwrap(); - let token_oracle = &tokens_oracle[token_oracle]; - - let (price, decimals, symbol) = ( - token_oracle.price, - token_oracle.decimals, - token_oracle.symbol.clone(), - ); - // println!("token_oracle: {:?}", token_oracle); - - let reserve = all_reserves - .iter() - .position(|r| r.pubkey == deposit.deposit_reserve) - .unwrap(); - - let reserve = &all_reserves[reserve]; - - // export const WAD = new BigNumber(1000000000000000000); - let collateral_exchange_rate = reserve.inner.collateral_exchange_rate().unwrap(); - // println!( - // " 📥 collateral exchange rate: {:?}", - // collateral_exchange_rate - // ); - - let market_value = U256::from(deposit.deposited_amount) - .mul(wad()) - .mul(price) - .div(Rate::from(collateral_exchange_rate).0.as_u128()) - .div(decimals as u32); - // println!(" 📥 market_value: {:?}", market_value); - - let loan_to_value_rate = U256::from(reserve.inner.config.loan_to_value_ratio); - // println!(" 📥 : loan_to_value_rate: {:?}", loan_to_value_rate); - - let liquidation_threshold_rate = U256::from(reserve.inner.config.liquidation_threshold); - // println!( - // " 📥 liquidation_threshold_rate: {:?}", - // liquidation_threshold_rate - // ); - - deposited_value = deposited_value.add(market_value); - // println!(" 📥 deposited_value: {:?}", deposited_value); - allowed_borrow_value = allowed_borrow_value.add(market_value * loan_to_value_rate / 100); - // println!(" 📥 allowed_borrow_value: {:?}", allowed_borrow_value); - unhealthy_borrow_value = - unhealthy_borrow_value.add(market_value * liquidation_threshold_rate / 100); - // println!(" 📥 unhealthy_borrow_value: {:?}", unhealthy_borrow_value); - - let casted_depo = Deposit { - deposit_reserve: deposit.deposit_reserve, - deposit_amount: U256::from(deposit.deposited_amount), - market_value, - symbol, - }; - // println!(" 📥 casted_depo: {:?}", casted_depo); - deposits.push(casted_depo); - } - - for borrow in &obligation.borrows { - let borrow_amount_wads = borrow.borrowed_amount_wads.0; - - let token_oracle = tokens_oracle - .iter() - .position(|rcl| rcl.reserve_address == borrow.borrow_reserve); - - if token_oracle.is_none() { - continue; - } - let token_oracle = token_oracle.unwrap(); - - let token_oracle = &tokens_oracle[token_oracle]; - - let (price, decimals, symbol, mint_address) = ( - token_oracle.price, - token_oracle.decimals, - token_oracle.symbol.clone(), - token_oracle.mint_address, - ); - - let reserve = all_reserves - .iter() - .position(|r| r.pubkey == borrow.borrow_reserve) - .unwrap(); - let reserve = &all_reserves[reserve]; - - // reserveCumulativeBorrowRateWads: BigNumber, - // obligationCumulativeBorrowRateWads: BigNumber, - // obligationBorrowAmountWads: BigNumber, - let reserve_cumulative_borrow_rate_wads = - reserve.inner.liquidity.cumulative_borrow_rate_wads.0; - let obligation_cumulative_borrow_rate_wads = borrow.cumulative_borrow_rate_wads.0; - - // println!( - // " 📤 reserve_cumulative_borrow_rate_wads: {:?}", - // reserve_cumulative_borrow_rate_wads - // ); - // println!( - // " 📤 obligation_cumulative_borrow_rate_wads: {:?}", - // obligation_cumulative_borrow_rate_wads - // ); - - /* - => - new BigNumber(reserve.liquidity.cumulativeBorrowRateWads.toString()), - new BigNumber(borrow.cumulativeBorrowRateWads.toString()), - borrowAmountWads, - - => - reserveCumulativeBorrowRateWads: BigNumber, - obligationCumulativeBorrowRateWads: BigNumber, - obligationBorrowAmountWads: BigNumber, - - */ - let borrow_amount_wads_with_interest_u192 = { - match reserve_cumulative_borrow_rate_wads - .0 - .cmp(&obligation_cumulative_borrow_rate_wads.0) - { - std::cmp::Ordering::Less => { - println!( - "Interest rate cannot be negative. reserveCumulativeBorrowRateWadsNum: {:} | - obligationCumulativeBorrowRateWadsNum: {:}`", - reserve_cumulative_borrow_rate_wads.to_string(), - obligation_cumulative_borrow_rate_wads.to_string() - ); - borrow_amount_wads.clone() - } - std::cmp::Ordering::Equal => borrow_amount_wads.clone(), - std::cmp::Ordering::Greater => { - let compound_interest_rate = reserve_cumulative_borrow_rate_wads - / obligation_cumulative_borrow_rate_wads; - - borrow_amount_wads * compound_interest_rate - } - } - }; - // println!( - // " 📤 borrow_amount_wads_with_interest: {:?}", - // borrow_amount_wads_with_interest_u192 - // ); - - let mut borrow_amount_wads_with_interest = U256::from(0u32); - - decimal_to_u256( - &Decimal(borrow_amount_wads_with_interest_u192), - &mut borrow_amount_wads_with_interest, - ); - - let market_value = borrow_amount_wads_with_interest * price / decimals; - // println!(" 📤 market_value: {:?}", market_value); - - borrowed_value = borrowed_value + market_value; - // println!(" 📤 borrowed_value: {:?}", borrowed_value); - - let mut obl_borrow_borrowed_amount_wads = U256::from(0); - decimal_to_u256( - &borrow.borrowed_amount_wads, - &mut obl_borrow_borrowed_amount_wads, - ); - - let casted_borrow = Borrow { - borrow_reserve: borrow.borrow_reserve, - borrow_amount_wads: obl_borrow_borrowed_amount_wads, - mint_address, - market_value, - symbol, - }; - // println!("casted_borrow: {:?}", casted_borrow); - - borrows.push(casted_borrow); - } - - // println!(" ✉️ : borrowed_value: {:?}", borrowed_value); - // println!(" ✉️ : deposited_value: {:?}", deposited_value); - - // println!(" ✉️ : deposits: {:?}", deposits); - // println!(" ✉️ : borrows: {:?}", borrows); - - let empty = U256::from(0u8); - if deposited_value == empty || borrowed_value == empty { - return None; - } - - let utilization_ratio = borrowed_value * U256::from(100) / deposited_value; - // println!("utilization_ratio: {:?}", utilization_ratio); - - Some(RefreshedObligation { - // pub deposited_value: u32, - // pub borrowed_value: u32, - // pub allowed_borrow_value: u32, - // pub unhealthy_borrow_value: u32, - // pub deposits: Vec, - // pub borrows: Vec, - // pub utilization_ratio: U256, - deposited_value, - borrowed_value, - allowed_borrow_value, - unhealthy_borrow_value, - deposits, - borrows, - utilization_ratio, - }) -} - pub fn decimal_to_u256(decimal: &Decimal, dest: &mut U256) { let mut bytes_baw = [0u8; 8 * 3]; decimal.0.to_little_endian(&mut bytes_baw); @@ -1075,8 +737,8 @@ pub struct WalletBalanceData { pub symbol: String, } -async fn get_wallet_token_data( - client: &Arc, +pub async fn get_wallet_token_data( + client: &Client, wallet_address: Pubkey, mint_address: Pubkey, symbol: String, @@ -1097,229 +759,162 @@ async fn get_wallet_token_data( symbol, }) } - Err(_) => None, + Err(e) => { + println!("err: {:?}", e); + None + } } } -async fn process_markets(client: Arc) { - let markets_list = client.solend_cfg.unwrap(); - let mut handles = vec![]; +pub async fn empty_future() -> usize { + 0usize +} - // let solend_cfg = client.solend_cfg.unwrap(); +#[async_trait] +trait UpdateableMarket { + fn update_market_data(&mut self, market_data: Box); + async fn fetch_market_data(&self, client: &'static Client) -> Box; +} - for current_market in markets_list { - let c_client = Arc::clone(&client); - let logger = Arc::clone(&c_client.logger); +#[derive(Default, Clone, Debug)] +pub struct MarketData { + pub oracle_data: Arc>>, + pub obligations: HashMap>>>, + pub reserves: Arc>>>, +} - let h = tokio::spawn(async move { - let lending_market = current_market.address.clone(); +#[derive(Default, Clone, Debug)] +pub struct MarketReservesRetriever { + pub inner: Box, + lending_market: String, + input_reserves: Option<&'static Vec>, + initialized: bool, +} - let (oracle_data, all_obligations, reserves) = tokio::join!( - c_client.get_token_oracle_data(¤t_market.reserves), - c_client.get_obligations(lending_market.as_str()), - c_client.get_reserves(lending_market.as_str()), - ); - // println!("oracle_data: {:?}", oracle_data); - // println!("all_obligations: {:?}", all_obligations); - // println!("reserves: {:?}", reserves); - - let mut inner_handles = vec![]; - - for (_, raw_obligation) in &all_obligations { - let oracle_data = oracle_data.clone(); - let c_client = Arc::clone(&c_client); - let obligation = Arc::clone(&raw_obligation); - let current_market = current_market.clone(); - let lending_market = lending_market.clone(); - let reserves = reserves.clone(); - - let logger = Arc::clone(&logger); - - let h = tokio::spawn(async move { - let r_obligation = obligation.read().clone(); - - let refreshed_obligation = calculate_refreshed_obligation( - // obligation: &Obligation, - // all_reserves: &Vec>, - // tokens_oracle: &Vec, - &r_obligation.inner, - &reserves, - &oracle_data, - &logger, - ); - - if refreshed_obligation.is_none() { - return; - } - - let refreshed_obligation = refreshed_obligation.unwrap(); - println!("refreshed_obligation_pubkey: {:?}", r_obligation.pubkey.to_string()); - // println!("refreshed_obligation: {:?}", refreshed_obligation); - - let (borrowed_value, unhealthy_borrow_value, deposits, borrows) = ( - refreshed_obligation.borrowed_value, - refreshed_obligation.unhealthy_borrow_value, - refreshed_obligation.deposits, - refreshed_obligation.borrows, - ); - - if borrowed_value <= unhealthy_borrow_value { - // println!("do nothing if obligation is healthy"); - return; - } - - // select repay token that has the highest market value - let selected_borrow = { - let mut v: Option = None; - for borrow in borrows { - // if v.is_none() || deposit.market_value >= v.unwrap().market_value - match v { - Some(ref real_v) => { - if borrow.market_value >= real_v.market_value { - v = Some(borrow); - } - } - None => v = Some(borrow), - } - } - v - }; - - // select the withdrawal collateral token with the highest market value - let selected_deposit = { - let mut v: Option = None; - for deposit in deposits { - // if v.is_none() || deposit.market_value >= v.unwrap().market_value - match v { - Some(ref real_v) => { - if deposit.market_value >= real_v.market_value { - v = Some(deposit); - } - } - None => v = Some(deposit), - } - } - v - }; - - if selected_deposit.is_none() || selected_borrow.is_none() { - println!("skip toxic obligations caused by toxic oracle data"); - return; - } - - let selected_deposit = selected_deposit.unwrap(); - let selected_borrow = selected_borrow.unwrap(); - - println!( - "obligation: {:} is underwater", - r_obligation.pubkey.to_string() - ); - println!( - "obligation: {:?}", - r_obligation.inner - ); - println!("borrowed_value: {:} ", borrowed_value.to_string()); - println!( - "unhealthy_borrow_value: {:} ", - unhealthy_borrow_value.to_string() - ); - format!("market addr: {:} ", lending_market); - - let wallet_address = c_client.config.signer.pubkey(); - println!( - " - wallet_address: {:?} - selected_borrow.mint_address: {:?} - selected_borrow.symbol: {:?} - ", - wallet_address, - selected_borrow.mint_address, - selected_borrow.symbol.clone(), - ); - - Client::get_or_create_account_data( - &c_client.config.signer.pubkey(), - &c_client.config.signer.pubkey(), - &selected_borrow.mint_address, - &c_client.config.rpc_client, - &c_client.config.signer, - ) - .await; - // panic!(""); - let retrieved_wallet_data = get_wallet_token_data( - &c_client, - wallet_address, - selected_borrow.mint_address, - selected_borrow.symbol.clone(), - ) - .await - .unwrap(); +#[async_trait] +impl UpdateableMarket for MarketReservesRetriever { + fn update_market_data(&mut self, market_data: Box) { + self.inner = market_data; + self.initialized = true; + } + + async fn fetch_market_data(&self, client: &'static Client) -> Box { + let initialized = self.initialized; + let input_reserves = self.input_reserves.unwrap(); + let lending_market = self.lending_market.as_str(); - println!( - " 🛢 🛢 🛢 retrieved_wallet_data: {:?}", - retrieved_wallet_data - ); - - // println!("selected_borrow: {:?}", &selected_borrow); - // println!("selected_deposit: {:?}", &selected_deposit); - - let u_zero = U256::from(0); - if retrieved_wallet_data.balance == u_zero { - println!( - "insufficient {:} to liquidate obligation {:} in market: {:}", - selected_borrow.symbol, - r_obligation.pubkey.to_string(), - lending_market - ); - return; - } else if retrieved_wallet_data.balance < u_zero { - println!("failed to get wallet balance for {:} to liquidate obligation {:} in market {:}", selected_borrow.symbol, r_obligation.pubkey.to_string(), lending_market); - println!("potentially network error or token account does not exist in wallet"); - return; - } - - let liquidation_result = c_client - .liquidate_and_redeem( - &retrieved_wallet_data, - &selected_borrow, - &selected_deposit, - current_market.clone(), - &r_obligation, - ) - .await; - - if liquidation_result.is_ok() { - println!("liquidation of {:?} went successful, updating the obligation *in-place*...", r_obligation.pubkey.to_string()); - - let updated_obligation = c_client.get_obligation(Either::Right(r_obligation.pubkey)).await.unwrap(); - - let mut w_obligation = obligation.write(); - *w_obligation = updated_obligation; - - println!("obligation {:?} is updated...", r_obligation.pubkey.to_string()); - } - }); - - inner_handles.push(h); + let obligation_pubkeys: Vec = self + .inner + .obligations + .keys() + .into_iter() + .map(|x| *x) + .collect(); + + let all_obligations = async move { + if !initialized { + client.get_obligations(lending_market).await + } else { + client.update_obligations(obligation_pubkeys).await } + }; + + let (reserves, oracle_data, all_obligations) = tokio::join!( + client.get_reserves(lending_market), + client.get_token_oracle_data(input_reserves), + all_obligations + ); - for inner_h in inner_handles { - inner_h.await.unwrap(); + Box::new(MarketData { + oracle_data: Arc::new(RwLock::new(oracle_data)), + obligations: all_obligations, + reserves: Arc::new(RwLock::new(reserves)), + }) + } +} + +impl MarketReservesRetriever { + fn update_distinct_obligation(&mut self, obligation: Enhanced) { + self.inner + .obligations + .insert(obligation.pubkey.clone(), Arc::new(RwLock::new(obligation))); + } +} + +impl MarketReservesRetriever { + pub fn new(lending_market: String, input_reserves: &'static Vec) -> Self { + Self { + lending_market, + initialized: false, + input_reserves: Some(input_reserves), + ..Self::default() + } + } +} + +#[derive(Default, Clone)] +pub struct MarketsCapsule { + // pub markets: HashMap> + markets: HashMap>, + client: Option<&'static Client>, +} + +unsafe impl Send for MarketsCapsule {} +unsafe impl Sync for MarketsCapsule {} + +impl MarketsCapsule { + pub fn new(client: &'static Client) -> Self { + Self { + client: Some(client), + ..Default::default() + } + } + + pub fn update_market_data_for(&mut self, market: String, market_data: Box) { + match self.markets.get_mut(&market) { + Some(target) => { + target.update_market_data(market_data); } - }); + _ => {} + } + } - handles.push(h); + pub async fn fetch_market_data_for(self, market: String) -> Box { + let market = self.markets.get(&market).unwrap(); + market.fetch_market_data(self.client.unwrap()).await } - let total_n = handles.len(); - println!("total n: {:?}", total_n); + pub fn update_initially(&mut self, market: String, input_reserves: &'static Vec) { + self.markets.insert( + market.clone(), + Box::new(MarketReservesRetriever::new(market, input_reserves)), + ); + } - let mut cur = 0usize; - for h in handles { - h.await.unwrap(); - cur += 1; + pub async fn fetch_distinct_obligation_for(&self, obligation: Pubkey) -> Enhanced { + let updated_obligation = self + .client + .unwrap() + .get_obligation(Either::Right(obligation)) + .await + .unwrap(); + + updated_obligation + } + + pub fn update_distinct_obligation_for( + &mut self, + market: String, + obligation: Enhanced, + ) { + match self.markets.get_mut(&market) { + Some(target) => target.update_distinct_obligation(obligation), + _ => {} + } + } - println!("current iters: {:?}", cur); + pub fn read_for(self, market: String) -> Box { + self.markets.get(&market).unwrap().clone() } } @@ -1331,11 +926,30 @@ pub async fn run_eternal_liquidator(keypair_path: String) { solend_client.solend_cfg = Some(solend_cfg); - let c_solend_client = Arc::new(solend_client); + let solend_client: &'static _ = Box::leak(Box::new(solend_client)); + let markets_capsule = Arc::new(RwLock::new(MarketsCapsule::new(solend_client))); + + let mut handles = vec![]; + for current_market in solend_client.solend_config().unwrap() { + let markets_capsule = Arc::clone(&markets_capsule); + + let market = current_market.address.clone(); + let input_reserves: &'static _ = Box::leak(Box::new(current_market.reserves.clone())); + + let h = tokio::spawn(async move { + let mut w = markets_capsule.write(); + w.update_initially(market, input_reserves); + }); + handles.push(h); + } + + for h in handles { + h.await.unwrap(); + } loop { - let c_solend_client = Arc::clone(&c_solend_client); - process_markets(c_solend_client).await; + let markets_capsule = Arc::clone(&markets_capsule); + process_markets(solend_client, markets_capsule).await; } } @@ -1347,9 +961,28 @@ pub async fn run_liquidator_iter(keypair_path: String) { solend_client.solend_cfg = Some(solend_cfg); - let c_solend_client = Arc::new(solend_client); + let solend_client: &'static _ = Box::leak(Box::new(solend_client)); + let markets_capsule = Arc::new(RwLock::new(MarketsCapsule::new(solend_client))); + + let mut handles = vec![]; + for current_market in solend_client.solend_config().unwrap() { + let markets_capsule = Arc::clone(&markets_capsule); + + let market = current_market.address.clone(); + let input_reserves: &'static _ = Box::leak(Box::new(current_market.reserves.clone())); + + let h = tokio::spawn(async move { + let mut w = markets_capsule.write(); + w.update_initially(market, input_reserves); + }); + handles.push(h); + } + + for h in handles { + h.await.unwrap(); + } - process_markets(c_solend_client).await; + process_markets(solend_client, markets_capsule).await; } #[cfg(test)] diff --git a/solend-liquidator/src/client_model.rs b/solend-liquidator/src/client_model.rs new file mode 100644 index 0000000..212f9f0 --- /dev/null +++ b/solend-liquidator/src/client_model.rs @@ -0,0 +1,72 @@ +use futures_retry::RetryPolicy; +use solana_program::pubkey::Pubkey; +use solend_program::math::Decimal; +use uint::construct_uint; + +construct_uint! { + pub struct U256(4); +} + +pub fn handle_error(_e: E) -> RetryPolicy { + RetryPolicy::WaitRetry(std::time::Duration::from_millis(150)) +} + +#[derive(thiserror::Error, Debug)] +pub enum LiquidationAndRedeemError { + #[error("reserves are not identified")] + ReservesAreNotIdentified, +} + +#[derive(Debug, Clone)] +pub struct Borrow { + pub borrow_reserve: Pubkey, + pub borrow_amount_wads: Decimal, + pub market_value: Decimal, + pub mint_address: Pubkey, + pub symbol: String, +} + +#[derive(Debug, Clone)] +pub struct Deposit { + pub deposit_reserve: Pubkey, + // pub deposit_amount: Decimal, + pub deposit_amount: u64, + pub market_value: Decimal, + pub symbol: String, +} + +#[derive(Debug, Clone)] +pub struct RefreshedObligation { + pub deposited_value: U256, + pub borrowed_value: U256, + pub allowed_borrow_value: U256, + pub unhealthy_borrow_value: U256, + pub deposits: Vec, + pub borrows: Vec, + pub utilization_ratio: U256, +} + +// basically it is 1e18 +pub fn wad() -> U256 { + U256::from(1000000000000000000u128) +} + +pub struct FormedOracle { + pub price_address: Pubkey, + pub switchboard_feed_address: Pubkey, +} + +#[derive(Debug, Clone, serde_derive::Serialize, serde_derive::Deserialize)] +pub struct OracleData { + pub symbol: String, + pub reserve_address: Pubkey, + pub mint_address: Pubkey, + pub decimals: i64, + pub price: u64, // pub price: pyth_sdk_solana::state::PriceFeed, +} + +#[derive(Debug, Clone)] +pub struct Enhanced { + pub inner: T, + pub pubkey: Pubkey, +} diff --git a/solend-liquidator/src/constants.rs b/solend-liquidator/src/constants.rs new file mode 100644 index 0000000..1739fed --- /dev/null +++ b/solend-liquidator/src/constants.rs @@ -0,0 +1,13 @@ +use solana_program::pubkey::Pubkey; +use std::str::FromStr; + +lazy_static::lazy_static! { + pub static ref SWITCHBOARD_V1_ADDRESS: Pubkey = + Pubkey::from_str("DtmE9D2CSB4L5D6A15mraeEjrGMm6auWVzgaD8hK2tZM").unwrap(); + pub static ref SWITCHBOARD_V2_ADDRESS: Pubkey = + Pubkey::from_str("SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f").unwrap(); + pub static ref NULL_ORACLE: Pubkey = + Pubkey::from_str("nu11111111111111111111111111111111111111111").unwrap(); + pub static ref SOLEND_PROGRAM_ID: Pubkey = + Pubkey::from_str("So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo").unwrap(); +} diff --git a/solend-liquidator/src/fixtures.rs b/solend-liquidator/src/fixtures.rs new file mode 100644 index 0000000..a8d69dc --- /dev/null +++ b/solend-liquidator/src/fixtures.rs @@ -0,0 +1,128 @@ +use std::collections::{HashMap, HashSet}; +use std::ops::{Add, Div, Mul}; +use std::sync::Arc; + +use hyper::Body; + +use hyper::{Client as HyperClient, Method, Request}; +use hyper_tls::HttpsConnector; + +use async_trait::async_trait; +use borsh::BorshDeserialize; + +use { + solana_client::nonblocking::rpc_client::RpcClient, + solana_client::rpc_config::RpcAccountInfoConfig, + solana_program::{program_pack::Pack, pubkey::Pubkey}, + solana_sdk::{ + commitment_config::CommitmentConfig, + signature::{Keypair, Signer}, + transaction::Transaction, + }, + std::str::FromStr, +}; + +use either::Either; +use futures_retry::{FutureFactory, FutureRetry, RetryPolicy}; +use parking_lot::{Mutex, RwLock}; + +use log::Log; +use pyth_sdk_solana; +use solana_account_decoder::UiAccountEncoding; +use solana_client::rpc_config::{RpcProgramAccountsConfig, RpcSendTransactionConfig}; +use solana_client::rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType}; + +use solana_program::instruction::Instruction; +use solana_sdk::account::create_is_signer_account_infos; +use solana_sdk::commitment_config::CommitmentLevel; + +use solend_program::math::{Decimal, Rate}; +use solend_program::state::{Obligation, ObligationCollateral, ObligationLiquidity, Reserve}; + +use spl_associated_token_account::get_associated_token_address; + +use switchboard_program::AggregatorState; +use uint::construct_uint; + +use crate::log::Logger; +use crate::model::{self, Market, SolendConfig}; +use crate::performance::PerformanceMeter; +use crate::utils::body_to_string; +use crate::binding; + +use crate::client_model::*; +use crate::helpers::*; +use crate::constants::*; + + +#[derive( + Default, PartialEq, Clone, Debug, serde_derive::Serialize, serde_derive::Deserialize, +)] +pub struct CalculateRefreshedObligationFixture { + pub packed_obligation: Vec, + pub packed_all_reserves: Vec<(Pubkey, Vec)>, + pub packed_oracles: Vec>, + // pub obligation: Obligation, + // pub all_reserves: Vec>, + // pub tokens_oracle: Vec, +} + +impl CalculateRefreshedObligationFixture { + pub async fn persist(&self, path: String) { + let content = serde_json::to_string_pretty(&self).unwrap(); + tokio::fs::write(Path::new(&path), content).await.unwrap(); + } + + pub fn encode( + obligation: Obligation, + all_reserves: &Vec>, + oracles: &Vec, + ) -> Self { + let mut packed_obligation = [0u8; 1300]; + Obligation::pack(obligation.clone(), &mut packed_obligation).unwrap(); + + let mut packed_all_reserves = vec![]; + for reserve in all_reserves { + let mut packed_reserve = [0u8; 619]; + + Reserve::pack(reserve.inner.clone(), &mut packed_reserve).unwrap(); + + // let concated = vec![reserve_pubkey, packed_reserve.to_vec()].concat(); + packed_all_reserves.push((reserve.pubkey, packed_reserve.to_vec())); + } + + let mut packed_oracles = vec![]; + for oracle in oracles { + let packed_oracle = serde_json::to_vec(oracle).unwrap(); + packed_oracles.push(packed_oracle) + } + + Self { + packed_obligation: packed_obligation.to_vec(), + packed_all_reserves, + packed_oracles, + ..CalculateRefreshedObligationFixture::default() + } + } + + pub fn decode(&self) -> (Obligation, Vec>, Vec) { + let obligation = Obligation::unpack(&self.packed_obligation).unwrap(); + + let mut all_reserves = vec![]; + for reserve in self.packed_all_reserves.clone() { + let inner = Reserve::unpack(&reserve.1).unwrap(); + all_reserves.push(Enhanced { + inner, + pubkey: reserve.0, + }); + } + + let mut oracles = vec![]; + for oracle in self.packed_oracles.clone() { + let value: OracleData = serde_json::from_slice(oracle.as_slice()).unwrap(); + oracles.push(value); + } + + (obligation, all_reserves, oracles) + } +} \ No newline at end of file diff --git a/solend-liquidator/src/helpers.rs b/solend-liquidator/src/helpers.rs index 75dd4f7..699653f 100644 --- a/solend-liquidator/src/helpers.rs +++ b/solend-liquidator/src/helpers.rs @@ -1 +1,262 @@ -// pub fn add_reserve() {} +use std::sync::Arc; + +use either::Either; +use solana_sdk::signature::Signer; + +use parking_lot::{FairMutex, RwLock}; + +use solend_program::math::Decimal; +// use rayon::prelude::*; + +use crate::performance::{PerformanceMeter, Setting}; + +use crate::binding::*; +use crate::client::{self, Client, MarketsCapsule}; +use crate::client_model::*; +use rayon::prelude::*; + +pub async fn process_markets( + client: &'static Client, + markets_capsule: Arc>, +) { + let markets_list = client.solend_config().unwrap(); + + let mut meter = PerformanceMeter::new(Setting::Ms); + + meter.add_point("after capsule initialization / before markets update"); + println!("markets len: {:?}", markets_list.len()); + + // fetch market data for update + let mut handles = vec![]; + for current_market in markets_list { + let markets_capsule = Arc::clone(&markets_capsule); + let market = current_market.address.clone(); + + let h = tokio::spawn(async move { + let data = markets_capsule.read().clone(); + + (data.fetch_market_data_for(market.clone()).await, market) + }); + handles.push(h); + } + + // persist market data + let mut w_handles = vec![]; + for h in handles { + let (market_data, market) = h.await.unwrap(); + + let markets_capsule = Arc::clone(&markets_capsule); + + let w_h = tokio::spawn(async move { + let mut w = markets_capsule.write(); + w.update_market_data_for(market, market_data); + }); + w_handles.push(w_h); + } + + for w_h in w_handles { + w_h.await.unwrap(); + } + + let mut handles = vec![]; + for current_market in markets_list { + let lending_market = current_market.address.clone(); + let r_markets_capsule = markets_capsule.read().clone(); + let markets = r_markets_capsule.read_for(lending_market.clone()); + let markets = markets.inner; + + let h = tokio::spawn(async move { + let (oracle_data, all_obligations, reserves) = + (markets.oracle_data, markets.obligations, markets.reserves); + + let mut inner_handles = vec![]; + + for (i, raw_obligation) in all_obligations { + let obligation = Arc::clone(&raw_obligation); + let oracle_data = Arc::clone(&oracle_data); + let reserves = Arc::clone(&reserves); + let lending_market = lending_market.clone(); + + let h = tokio::spawn(async move { + let r_obligation = obligation.read().clone(); + let r_reserves = reserves.read().clone(); + let r_oracle_data = oracle_data.read().clone(); + + let r = + refresh_obligation(&r_obligation, &r_reserves, &r_oracle_data); + if r.is_err() { + tokio::task::yield_now().await; + return None; + } + + let (refreshed_obligation, mut deposits, mut borrows) = r.unwrap(); + + let (borrowed_value, unhealthy_borrow_value) = ( + refreshed_obligation.borrowed_value.clone(), + refreshed_obligation.unhealthy_borrow_value.clone(), + ); + + if borrowed_value == Decimal::from(0u64) + || unhealthy_borrow_value == Decimal::from(0u64) + || borrowed_value <= unhealthy_borrow_value + { + tokio::task::yield_now().await; + return None; + } + + println!( + " + obligation: {:?} + refreshed_obligation_pubkey: {:?} + refreshed_obligation: {:?} + unhealthy_borrow_value: {:?} + borrowed_value: {:?} + ", + r_obligation, + r_obligation.pubkey.to_string(), + refreshed_obligation, + unhealthy_borrow_value, + borrowed_value, + ); + + deposits + .sort_by(|a, b| a.market_value.partial_cmp(&b.market_value).unwrap()); + borrows + .sort_by(|a, b| a.market_value.partial_cmp(&b.market_value).unwrap()); + + let selected_deposit = deposits.last(); + let selected_borrow = borrows.last(); + + if selected_deposit.is_none() || selected_borrow.is_none() { + tokio::task::yield_now().await; + return None; + } + + let selected_deposit = selected_deposit.unwrap(); + let selected_borrow = selected_borrow.unwrap(); + + println!( + "obligation: {:} is underwater", + r_obligation.pubkey.to_string() + ); + println!("obligation: {:?}", r_obligation.inner); + + Some(( + selected_deposit.clone(), + selected_borrow.clone(), + r_obligation, + i, + lending_market, + )) + }); + + inner_handles.push(h); + } + + let mut upd_handles = vec![]; + for inner_h in inner_handles { + let r = inner_h.await.unwrap(); + + let h = tokio::spawn(async move { + if r.is_none() { + tokio::task::yield_now().await; + return None; + } + + let values = r.unwrap(); + let (selected_deposit, selected_borrow, r_obligation, _i, lending_market) = values; + + Client::get_or_create_account_data( + &client.signer().pubkey(), + &client.signer().pubkey(), + &selected_borrow.mint_address, + &client.rpc_client(), + &client.signer(), + ) + .await; + + let retrieved_wallet_data = client::get_wallet_token_data( + &client, + client.signer().pubkey(), + selected_borrow.mint_address, + selected_borrow.symbol.clone(), + ) + .await + .unwrap(); + + let u_zero = U256::from(0); + if retrieved_wallet_data.balance == u_zero { + tokio::task::yield_now().await; + return None; + } else if retrieved_wallet_data.balance < u_zero { + tokio::task::yield_now().await; + return None; + } + + let liquidation_result = client + .liquidate_and_redeem( + retrieved_wallet_data.balance.as_u64(), + &selected_borrow, + &selected_deposit, + current_market, + &r_obligation, + ) + .await; + + if liquidation_result.is_ok() { + let updated_obligation = client + .get_obligation(Either::Right(r_obligation.pubkey)) + .await + .unwrap(); + + Some((lending_market, updated_obligation)) + } else { + tokio::task::yield_now().await; + None + } + }); + + upd_handles.push(h); + } + + // return update_required_obligations; + return upd_handles; + }); + + handles.push(h); + } + + meter.add_point("before main calc"); + + let mut u_handles = vec![]; + for h in handles { + let update_to_obligations = h.await.unwrap(); + + let markets_capsule = Arc::clone(&markets_capsule); + + 'i: for h in update_to_obligations { + let r = h.await.unwrap(); + let markets_capsule = Arc::clone(&markets_capsule); + + let h = tokio::spawn(async move { + + if r.is_none() { + tokio::task::yield_now().await; + return; + } + + let (lending_market, updated_obligation) = r.unwrap(); + + let mut w = markets_capsule.write(); + w.update_distinct_obligation_for(lending_market, updated_obligation); + }); + u_handles.push(h); + } + } + + for h in u_handles { + h.await.unwrap(); + } + + meter.measure(); +} diff --git a/solend-liquidator/src/lib.rs b/solend-liquidator/src/lib.rs new file mode 100644 index 0000000..d1862ae --- /dev/null +++ b/solend-liquidator/src/lib.rs @@ -0,0 +1,9 @@ +pub mod binding; +pub mod client; +pub mod client_model; +pub mod constants; +pub mod helpers; +pub mod log; +pub mod model; +pub mod performance; +pub mod utils; diff --git a/solend-liquidator/src/log.rs b/solend-liquidator/src/log.rs index 3161598..697206a 100644 --- a/solend-liquidator/src/log.rs +++ b/solend-liquidator/src/log.rs @@ -1,15 +1,12 @@ -use log::{info, trace, warn}; -use log::{Record, Level, Metadata}; - +use log::{Metadata, Record}; #[derive(Debug, Clone, Copy, Default)] pub struct Logger { enabled: bool, } - impl log::Log for Logger { - fn enabled(&self, metadata: &Metadata) -> bool { + fn enabled(&self, _metadata: &Metadata) -> bool { // metadata.level() <= Level::Info true } @@ -58,3 +55,7 @@ impl Logger { // } // } } + +struct PerformanceLogger { + inner: Logger, +} diff --git a/solend-liquidator/src/main.rs b/solend-liquidator/src/main.rs index 95b73fb..99eb457 100755 --- a/solend-liquidator/src/main.rs +++ b/solend-liquidator/src/main.rs @@ -1,11 +1,17 @@ -mod client; -mod helpers; -mod log; -mod model; -mod utils; +pub mod binding; +pub mod client; +pub mod client_model; +pub mod constants; +pub mod helpers; +pub mod log; +pub mod model; +pub mod performance; +pub mod utils; use clap::Parser; +use crate::client::{run_eternal_liquidator, run_liquidator_iter}; + #[derive(Parser, Debug)] #[clap(author, version, about, long_about = None)] struct Args { @@ -15,15 +21,30 @@ struct Args { keypair_path: String, } -use crate::client::{run_eternal_liquidator, run_liquidator_iter}; +// #[tokio::main] +// async fn main() { +// let args = Args::parse(); + +// match args.mode.as_str() { +// "eternal" => run_eternal_liquidator(args.keypair_path).await, +// "iter" => run_liquidator_iter(args.keypair_path).await, +// _ => panic!("specified mode is unavaiable"), +// }; +// } -#[tokio::main] -async fn main() { +fn main() { let args = Args::parse(); + let runtime = tokio::runtime::Builder::new_multi_thread() + .max_blocking_threads(1024 * 10) + .enable_all() + .build() + .unwrap(); - match args.mode.as_str() { - "eternal" => run_eternal_liquidator(args.keypair_path).await, - "iter" => run_liquidator_iter(args.keypair_path).await, - _ => panic!("specified mode is unavaiable"), - }; + runtime.block_on(async move { + match args.mode.as_str() { + "eternal" => run_eternal_liquidator(args.keypair_path).await, + "iter" => run_liquidator_iter(args.keypair_path).await, + _ => panic!("specified mode is unavaiable"), + }; + }); } diff --git a/solend-liquidator/src/performance.rs b/solend-liquidator/src/performance.rs new file mode 100644 index 0000000..81912c4 --- /dev/null +++ b/solend-liquidator/src/performance.rs @@ -0,0 +1,91 @@ +use std::collections::HashMap; +use std::time::{SystemTime, UNIX_EPOCH}; + +#[derive(Clone, Debug)] +pub enum Setting { + Ms, + Micros, +} + +impl Setting { + fn format(&self) -> String { + match self { + Self::Ms => "ms".to_string(), + Self::Micros => "micros".to_string(), + } + } +} + +impl Default for Setting { + fn default() -> Self { + Self::Ms + } +} + +#[derive(Default, Clone, Debug)] +pub struct PerformanceMeter<'a> { + points_table: HashMap<&'a str, u128>, + points_order: Vec<&'a str>, + setting: Setting, +} + +pub fn current_timestamp_ms() -> u128 { + let point_a = SystemTime::now(); + let point_a = point_a.duration_since(UNIX_EPOCH).unwrap(); + point_a.as_millis() +} + +pub fn current_timestamp_micros() -> u128 { + let point_a = SystemTime::now(); + let point_a = point_a.duration_since(UNIX_EPOCH).unwrap(); + point_a.as_micros() +} + +unsafe impl Send for PerformanceMeter<'_> {} +unsafe impl Sync for PerformanceMeter<'_> {} + +impl<'a> PerformanceMeter<'a> { + pub fn new(setting: Setting) -> Self { + Self { + setting, + ..Self::default() + } + } + + pub fn timestamp(&self) -> u128 { + match self.setting { + Setting::Ms => current_timestamp_ms(), + Setting::Micros => current_timestamp_micros(), + } + } + + pub fn add_point(&mut self, tag: &'a str) { + self.points_table.insert(tag, self.timestamp()); + self.points_order.push(tag); + } + + pub fn clear(&mut self) { + self.points_table = HashMap::new(); + self.points_order = vec![]; + } + + pub fn measure(&self) { + let n = self.points_order.len(); + + for i in 0..n - 1 { + let (a, b) = (self.points_order[i], self.points_order[i + 1]); + let current = self.points_table.get(a).unwrap(); + let next = self.points_table.get(b).unwrap(); + + println!( + " 🕒 point {:} to {:} took {:} {:}", + a, + b, + next - current, + self.setting.format() + ); + } + + // println!("🔺 🕒 longest point: {:} to {:} (took {:} ms)", a, b, next - current); + } +} diff --git a/solend-liquidator/src/pyth.rs b/solend-liquidator/src/pyth.rs deleted file mode 100755 index e69de29..0000000 diff --git a/solend-liquidator/src/utils.rs b/solend-liquidator/src/utils.rs index 8cade9c..0e2bf28 100755 --- a/solend-liquidator/src/utils.rs +++ b/solend-liquidator/src/utils.rs @@ -1,20 +1,6 @@ use hyper::Body; -// use rustc_hex::{FromHex, ToHex}; -// use tiny_keccak::{Hasher, Keccak}; - pub async fn body_to_string(body: Body) -> String { let body_bytes = hyper::body::to_bytes(body).await.unwrap(); String::from_utf8(body_bytes.to_vec()).unwrap() } - -// pub fn sha3_hash_u256(input: U256) -> [u8; 32] { -// // let mut hasher = Sha3_256::new(); -// let u256_bytes: &mut [u8] = &mut [0; 32]; -// input.to_big_endian(u256_bytes); -// let mut h = Keccak::v256(); -// h.update(&u256_bytes); -// let mut res: [u8; 32] = [0; 32]; -// h.finalize(&mut res); -// res -// }