From 45a6d9841da5ee447d73a8b63e30aa84373efba8 Mon Sep 17 00:00:00 2001 From: KlementXV <50872057+KlementXV@users.noreply.github.com> Date: Fri, 16 Aug 2024 22:46:04 +0200 Subject: [PATCH] chore: Refactor code to improve readability and remove unnecessary cloning --- Cargo.lock | 508 +++++++++++++++++++++------------------- src/busses.rs | 9 +- src/dynamic_fee.rs | 51 ++-- src/main.rs | 62 ++--- src/mine.rs | 16 +- src/proof.rs | 2 +- src/send_and_confirm.rs | 126 +++++----- 7 files changed, 390 insertions(+), 384 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2aeba29c..cc04129d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,9 +143,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -158,33 +158,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -321,9 +321,9 @@ checksum = "8bcb85e548c05d407fa6faff46b750ba287714ef32afc0f5e15b4641ffd6affb" [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" @@ -395,9 +395,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" +checksum = "fec134f64e2bc57411226dfc4e52dec859ddfc7e711fc5e07b612584f000e4aa" dependencies = [ "brotli", "flate2", @@ -424,7 +424,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -642,7 +642,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", "syn_derive", ] @@ -744,22 +744,22 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.16.3" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83" +checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" +checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -770,9 +770,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca2be1d5c43812bae364ee3f30b3afcb7877cf59f4aeb94c66f313a41d2fac9" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cached" @@ -819,13 +819,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.99" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" dependencies = [ "jobserver", "libc", - "once_cell", + "shlex", ] [[package]] @@ -897,9 +897,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.9" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ "clap_builder", "clap_derive", @@ -907,26 +907,26 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.9" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstream", "anstyle", - "clap_lex 0.7.1", + "clap_lex 0.7.2", "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.5.8" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -940,15 +940,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "colored" @@ -1049,9 +1049,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core_affinity" @@ -1066,9 +1066,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] @@ -1210,7 +1210,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -1232,7 +1232,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -1364,7 +1364,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -1387,14 +1387,14 @@ checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] name = "drillx" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c5fd3a8f11a6420d6efb1952c8c2e788627cb2c9e834537dc4b6bd036461646" +checksum = "356f272108d63b02f6dc5f813e63bfc72a004a486fe4dec73595c0fba70e5c4a" dependencies = [ "equix", "serde", @@ -1509,7 +1509,7 @@ checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -1533,9 +1533,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "equix" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced5aa2974d730a3bbe65dcb62ad8fbb0ae44d4aeed1093808a855d922b931ee" +checksum = "fec26c5c7c2fd421b3b7f9b7c069a7fdc2eae9cf78ab3d22c661e1d0e369c25f" dependencies = [ "arrayvec", "hashx", @@ -1580,9 +1580,9 @@ checksum = "6b31a14f5ee08ed1a40e1252b35af18bed062e3f39b69aab34decde36bc43e40" [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" dependencies = [ "crc32fast", "miniz_oxide", @@ -1674,7 +1674,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -1783,7 +1783,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.6", + "indexmap 2.4.0", "slab", "tokio", "tokio-util", @@ -1802,7 +1802,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.2.6", + "indexmap 2.4.0", "slab", "tokio", "tokio-util", @@ -2080,9 +2080,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" dependencies = [ "bytes", "futures-channel", @@ -2165,9 +2165,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -2203,9 +2203,9 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -2224,18 +2224,18 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -2278,9 +2278,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" [[package]] name = "libredox" @@ -2442,13 +2442,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi 0.3.9", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2574,7 +2575,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -2639,11 +2640,11 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ - "num_enum_derive 0.7.2", + "num_enum_derive 0.7.3", ] [[package]] @@ -2655,19 +2656,19 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] name = "num_enum_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -2678,9 +2679,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.36.1" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "memchr", ] @@ -2729,7 +2730,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -2761,7 +2762,7 @@ dependencies = [ "const-crypto", "drillx", "mpl-token-metadata", - "num_enum 0.7.2", + "num_enum 0.7.3", "ore-utils", "solana-program", "spl-associated-token-account", @@ -2779,7 +2780,7 @@ dependencies = [ "bytemuck", "cached", "chrono", - "clap 4.5.9", + "clap 4.5.16", "colored", "core_affinity", "drillx", @@ -2911,7 +2912,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -2963,9 +2964,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" [[package]] name = "powerfmt" @@ -2975,9 +2976,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "proc-macro-crate" @@ -3057,7 +3061,7 @@ checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -3231,9 +3235,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ "bitflags 2.6.0", ] @@ -3251,9 +3255,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -3502,9 +3506,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" @@ -3560,7 +3564,7 @@ checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -3575,9 +3579,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.6.0", "core-foundation", @@ -3588,9 +3592,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -3604,9 +3608,9 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.205" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] @@ -3622,22 +3626,23 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.205" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -3673,7 +3678,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -3682,7 +3687,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.4.0", "itoa", "ryu", "serde", @@ -3771,6 +3776,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -3829,9 +3840,9 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4973213a11c2e1b924b36e0c6688682b5aa4623f8d4eeaa1204c32cee524e6d6" +checksum = "b4185d569c062983fc2a618ae4ee6fe1a139b36bce7a25045647c49bf0020a53" dependencies = [ "Inflector", "base64 0.21.7", @@ -3854,9 +3865,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909f4553d0b31bb5b97533a6b64cc321a4eace9112d6efbabcf4408ea1b3f1db" +checksum = "c817832e71886dbea877d1aa911c9ce2e984a39081bb56ee30d4c835567827a6" dependencies = [ "chrono", "clap 2.34.0", @@ -3871,9 +3882,9 @@ dependencies = [ [[package]] name = "solana-cli-config" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2242c4a0776cdaec1358d0ffc61b32131985a7b2210c491fa465d28c313eb880" +checksum = "7a3d0ab58e2a883f36082c736fec6e6d5872dc902c3b2cc960ed67d8eaf8994d" dependencies = [ "dirs-next", "lazy_static", @@ -3887,16 +3898,16 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5cc431df6cc1dd964134fa4ec7df765d3af3fae9c2148f96a3c4fb500290633" +checksum = "7fa9cc6e8e59adf70acbf5cac21342ae8b5e41cbf05519fe5f6287e84ab40f63" dependencies = [ "async-trait", "bincode", "dashmap", "futures", "futures-util", - "indexmap 2.2.6", + "indexmap 2.4.0", "indicatif", "log", "quinn", @@ -3920,9 +3931,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e38b040d3a42e8f7d80c4a86bb0d49d7aed663b56b0fe0ae135d2d145fb7ae3a" +checksum = "d02fb29934427f1487d2149fe8bcb405306729b2f22a2ad616bb8ffd024cee7b" dependencies = [ "bincode", "chrono", @@ -3934,15 +3945,15 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae02622c63943485f0af3d0896626eaf6478e734f0b6bc61c7cc5320963c6e75" +checksum = "d8e5a2e26448b3e04ce673794994ff27f3972ec8a806c224eccc02e09f751ca5" dependencies = [ "async-trait", "bincode", "crossbeam-channel", "futures-util", - "indexmap 2.2.6", + "indexmap 2.4.0", "log", "rand 0.8.5", "rayon", @@ -3956,9 +3967,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4867f66e9527fa44451c861c1dc6d9b2a7c7a668d7c6a297cdefbe39f4395b33" +checksum = "20a6ef2db80dceb124b7bf81cca3300804bf427d2711973fc3df450ed7dfb26d" dependencies = [ "block-buffer 0.10.4", "bs58 0.4.0", @@ -3981,21 +3992,21 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168f24d97347b85f05192df58d6be3e3047a4aadc4001bc1b9e711a5ec878eea" +checksum = "70088de7d4067d19a7455609e2b393e6086bd847bb39c4d2bf234fc14827ef9e" dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] name = "solana-logger" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0511082fc62f2d086520fff5aa1917c389d8c840930c08ad255ae05952c08a2" +checksum = "b129da15193f26db62d62ae6bb9f72361f361bcdc36054be3ab8bc04cc7a4f31" dependencies = [ "env_logger", "lazy_static", @@ -4004,9 +4015,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55a3df105431d25f86f2a7da0cbbde5f54c1f0782ca59367ea4a8037bc6797" +checksum = "6d195b73093a4964ba6b5943418054a5fcbba23eafdd0842fd973fcceac1a967" dependencies = [ "log", "solana-sdk", @@ -4014,9 +4025,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddec097ed7572804389195128dbd57958b427829153c6cd8ec3343c86fe3cd22" +checksum = "fe7b06860ffbf4cf4714182e1b7eb00eb3ff0bcc9cff615d05e01e488923883c" dependencies = [ "crossbeam-channel", "gethostname", @@ -4029,9 +4040,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258fa7c29fb7605b8d2ed89aa0d43c640d14f4147ad1f5b3fdad19a1ac145ca5" +checksum = "9400b50b8439868a99b5fa2d961d74e37b7a6c1d5865759d0b1c906c2ad6b2a9" dependencies = [ "bincode", "clap 3.2.25", @@ -4051,9 +4062,9 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca422edcf16a6e64003ca118575ea641f7b750f14a0ad28c71dd84f33dcb912a" +checksum = "b01a386e852df67031195094628851b8d239dd71fe17b721c3993277e68cb3ab" dependencies = [ "ahash 0.8.11", "bincode", @@ -4080,9 +4091,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc5a636dc75e5c25651e34f7a36afc9ae60d38166687c5b0375abb580ac81a2" +checksum = "fb2b2c8babfae4cace1a25b6efa00418f3acd852cf55d7cecc0360d3c5050479" dependencies = [ "ark-bn254", "ark-ec", @@ -4135,9 +4146,9 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf373c3da0387f47fee4c5ed2465a9628b9db026a62211a692a9285aa9251544" +checksum = "0444f9440f4459d377c41470b2eb48b527def81f3052b7a121f6aa8c7350cc52" dependencies = [ "base64 0.21.7", "bincode", @@ -4163,9 +4174,9 @@ dependencies = [ [[package]] name = "solana-pubsub-client" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b9abc76168d19927561db6a3685b98752bd0961b4ce4f8b7f85ee12238c017" +checksum = "0ee4a39e41e789b6f100c97d9f40c1d08381bf6e3d0e351065e542091cddb039" dependencies = [ "crossbeam-channel", "futures-util", @@ -4188,9 +4199,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7952c5306a0be5f5276448cd20246b31265bfa884f29a077a24303c6a16aeb34" +checksum = "baad755c76ee0aab8890f0ef873e61b8b3012c523d33bfa5b062fe9be8cef370" dependencies = [ "async-mutex", "async-trait", @@ -4215,9 +4226,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4fa0cc66f8e73d769bca2ede3012ba2ef8ab67963e832808665369f2cf81743" +checksum = "c1c2a0ccb0be7ca79e8ff0d7c786bce586433a5687ffbea522453d0b41c4bf4a" dependencies = [ "lazy_static", "num_cpus", @@ -4225,9 +4236,9 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "289803796d4ff7b4699504d3ab9e9d9c5205ea3892b2ebe397b377494dbd75d4" +checksum = "3d042a812537e3507e1c163c7573fc04c96e12d3eba512e3fe74c7393229fa39" dependencies = [ "console", "dialoguer", @@ -4244,9 +4255,9 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb55a08018776a62ecff52139fbcdab1a7baa4e8f077202be58156e8dde4d5f" +checksum = "3c6f5560283bd0a6833d1bd816299785058a870fff51b0df399fdb3ce92c8484" dependencies = [ "async-trait", "base64 0.21.7", @@ -4270,9 +4281,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a8403038f4d6ab65bc7e7afb3afe8d9824c592232553c5cef55cf3de36025d" +checksum = "2e4ca77f89caa9071acadb1eed19c28a6691fd63d0563ed927c96bf734cf1c9c" dependencies = [ "base64 0.21.7", "bs58 0.4.0", @@ -4292,9 +4303,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4caca735caf76d51c074c3bacbfe38094bf7f92cfbe7b5b13f3bc4946e64f889" +checksum = "42a6ea9ad81d63f18fb8b3a9b39643cc43eaf909199d67037e724562301d1df7" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -4305,9 +4316,9 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df43d3a1e1637397ab43cbc216a5a8f977ec8a3cc3f3ae8c3851c83a3255dbcf" +checksum = "b5e0f0def5c5af07f53d321cea7b104487b522cfff77c3cae3da361bfe956e9e" dependencies = [ "assert_matches", "base64 0.21.7", @@ -4332,7 +4343,7 @@ dependencies = [ "memmap2", "num-derive 0.4.2", "num-traits", - "num_enum 0.7.2", + "num_enum 0.7.3", "pbkdf2 0.11.0", "qstring", "qualifier_attr", @@ -4360,15 +4371,15 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86c76414183a325038ff020b22c07d1e9d2da0703ddc0244acfed37ee2921d96" +checksum = "c55c196c8050834c391a34b58e3c9fd86b15452ef1feeeafa1dbeb9d2291dfec" dependencies = [ "bs58 0.4.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -4379,16 +4390,16 @@ checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" [[package]] name = "solana-streamer" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad1bdb955ec6d23a1dbf87e403ff3e610d68616275693125a893d7ed4b2d323" +checksum = "749720d82c5f31f7ec326da1e0baac098201de70f0874719172a55309433b449" dependencies = [ "async-channel", "bytes", "crossbeam-channel", "futures-util", "histogram", - "indexmap 2.2.6", + "indexmap 2.4.0", "itertools", "libc", "log", @@ -4412,9 +4423,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc301310ba0755c449a8800136f67f8ad14419b366404629894cd10021495360" +checksum = "84535de1253afb6ccc4ae6852eb013ca734c439a902ec5e4684b90ed649a37c2" dependencies = [ "bincode", "log", @@ -4427,14 +4438,14 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb887bd5078ff015e103e9ee54a6713380590efa8ff1804b3a653f07188928c6" +checksum = "3ff514462bb715aaea9bc5c0ee60f83ab3f91e04279337c6b07d054153b616dc" dependencies = [ "async-trait", "bincode", "futures-util", - "indexmap 2.2.6", + "indexmap 2.4.0", "indicatif", "log", "rayon", @@ -4451,9 +4462,9 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0cdfdf63192fb60de094fae8e81159e4e3e9aac9659fe3f9ef0e707023fb32" +checksum = "670e387049812d42bdc8fcc4ff75452ff3cb00657af979a90f55f6d37dba9dd9" dependencies = [ "Inflector", "base64 0.21.7", @@ -4476,9 +4487,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea0d6d8d66e36371577f51c4d1d6192a66f1fa4efe7161a36d94677640dcadb" +checksum = "11183dae826f942ebd0401712c8a52367a4a6312f1cd325f304cd9551226fc8b" dependencies = [ "async-trait", "solana-connection-cache", @@ -4491,9 +4502,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f4c2f531c22ce806b211118be8928a791425f97de4592371fb57b246ed33e34" +checksum = "8e8d518e61ce22c812df23d9c61ab9bcbef4df3e3d3dcaa74a999625f11bcf07" dependencies = [ "log", "rustc_version", @@ -4507,9 +4518,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d8a6486017e71a3714a8e1a635e17209135cc20535ba9808ccf106d80ff6e8b" +checksum = "5743503143fb2259c41a973a78e9aeeb8e21f1b03543c3bb85449926ea692719" dependencies = [ "bincode", "log", @@ -4529,9 +4540,9 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.18.17" +version = "1.18.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513407f88394e437b4ff5aad892bc5bf51a655ae2401e6e63549734d3695c46f" +checksum = "57ee07fa523b4cfcff68de774db7aa87d2da2c4357155a90bacd9a0a0af70a99" dependencies = [ "aes-gcm-siv", "base64 0.21.7", @@ -4558,9 +4569,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.8.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d457cc2ba742c120492a64b7fa60e22c575e891f6b55039f4d736568fb112a3" +checksum = "da5d083187e3b3f453e140f292c09186881da8a02a7b5e27f645ee26de3d9cc5" dependencies = [ "byteorder", "combine", @@ -4632,7 +4643,7 @@ checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" dependencies = [ "quote", "spl-discriminator-syn", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -4644,7 +4655,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.70", + "syn 2.0.74", "thiserror", ] @@ -4692,7 +4703,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -4734,7 +4745,7 @@ dependencies = [ "bytemuck", "num-derive 0.4.2", "num-traits", - "num_enum 0.7.2", + "num_enum 0.7.3", "solana-program", "solana-security-txt", "solana-zk-token-sdk", @@ -4847,7 +4858,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -4869,9 +4880,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.70" +version = "2.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" +checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" dependencies = [ "proc-macro2", "quote", @@ -4887,7 +4898,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -4931,14 +4942,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4967,22 +4979,22 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -5052,32 +5064,31 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -5162,9 +5173,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" @@ -5172,7 +5183,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.4.0", "toml_datetime", "winnow", ] @@ -5183,7 +5194,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.4.0", "toml_datetime", "winnow", ] @@ -5205,15 +5216,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -5235,7 +5246,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -5416,19 +5427,19 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "visibility" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3fd98999db9227cf28e59d83e1f120f42bc233d4b152e8fab9bc87d5bb1e0f8" +checksum = "d674d135b4a8c1d7e813e2f8d1c9a58308aee4a680323066025e53132218bd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -5460,34 +5471,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -5497,9 +5509,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5507,28 +5519,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -5567,11 +5579,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5607,6 +5619,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -5790,6 +5811,7 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] @@ -5801,7 +5823,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -5821,7 +5843,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.74", ] [[package]] @@ -5845,9 +5867,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.12+zstd.1.5.6" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", diff --git a/src/busses.rs b/src/busses.rs index 075f7c35..c9895689 100644 --- a/src/busses.rs +++ b/src/busses.rs @@ -11,12 +11,9 @@ impl Miner { let client = self.rpc_client.clone(); for address in BUS_ADDRESSES.iter() { let data = client.get_account_data(address).await.unwrap(); - match Bus::try_from_bytes(&data) { - Ok(bus) => { - let rewards = (bus.rewards as f64) / 10f64.powf(TOKEN_DECIMALS as f64); - println!("Bus {}: {:} ORE", bus.id, rewards); - } - Err(_) => {} + if let Ok(bus) = Bus::try_from_bytes(&data) { + let rewards = (bus.rewards as f64) / 10f64.powf(TOKEN_DECIMALS as f64); + println!("Bus {}: {:} ORE", bus.id, rewards); } } } diff --git a/src/dynamic_fee.rs b/src/dynamic_fee.rs index 67f8bc29..670be0a6 100644 --- a/src/dynamic_fee.rs +++ b/src/dynamic_fee.rs @@ -10,10 +10,11 @@ use std::{collections::HashMap, str::FromStr}; use solana_client::rpc_response::RpcPrioritizationFee; use url::Url; + enum FeeStrategy { Helius, Triton, - LOCAL, + Local, Alchemy, Quiknode, } @@ -24,9 +25,9 @@ impl Miner { let rpc_url = self .dynamic_fee_url .clone() - .unwrap_or(self.rpc_client.url()); + .unwrap_or_else(|| self.rpc_client.url()); - // Select fee estiamte strategy + // Select fee estimate strategy let host = Url::parse(&rpc_url) .unwrap() .host_str() @@ -41,7 +42,7 @@ impl Miner { } else if host.contains("rpcpool.com") { FeeStrategy::Triton } else { - FeeStrategy::LOCAL + FeeStrategy::Local }; // Build fee estimate request @@ -89,7 +90,7 @@ impl Miner { } ] })), - FeeStrategy::LOCAL => None, + FeeStrategy::Local => None, }; // Send rpc request @@ -117,20 +118,19 @@ impl Miner { FeeStrategy::Quiknode => response["result"]["per_compute_unit"]["medium"] .as_f64() .map(|fee| fee as u64) - .ok_or_else(|| format!("Please enable the Solana Priority Fee API add-on in your QuickNode account.")), + .ok_or_else(|| { + "Please enable the Solana Priority Fee API add-on in your QuickNode account." + .to_string() + }), FeeStrategy::Alchemy => response["result"] .as_array() - .and_then(|arr| { - Some( - arr.into_iter() - .map(|v| v["prioritizationFee"].as_u64().unwrap()) - .collect::>(), - ) + .map(|arr| { + arr.iter() + .map(|v| v["prioritizationFee"].as_u64().unwrap()) + .collect::>() }) - .and_then(|fees| { - Some( - ((fees.iter().sum::() as f32 / fees.len() as f32).ceil() * 1.2) as u64, - ) + .map(|fees| { + ((fees.iter().sum::() as f32 / fees.len() as f32).ceil() * 1.2) as u64 }) .ok_or_else(|| format!("Failed to parse priority fee response: {:?}", response)), FeeStrategy::Triton => { @@ -138,17 +138,16 @@ impl Miner { .map(|prioritization_fees| { estimate_prioritization_fee_micro_lamports(prioritization_fees) }) - .or_else(|error: serde_json::Error| { - Err(format!( + .map_err(|error: serde_json::Error| { + format!( "Failed to parse priority fee response: {response:?}, error: {error}" - )) + ) }) - }, - FeeStrategy::LOCAL => { - self.local_dynamic_fee().await.or_else(|err| { - Err(format!("Failed to parse priority fee response: {err}")) - }) - }, + } + FeeStrategy::Local => self + .local_dynamic_fee() + .await + .map_err(|err| format!("Failed to parse priority fee response: {err}")), }; // Check if the calculated fee is higher than max @@ -189,7 +188,7 @@ impl Miner { let chunk_size = 150; let chunks: Vec<_> = sorted_fees.chunks(chunk_size).take(3).collect(); let mut percentiles: HashMap = HashMap::new(); - for (_, chunk) in chunks.iter().enumerate() { + for chunk in chunks.iter() { let fees: Vec = chunk.iter().map(|fee| fee.prioritization_fee).collect(); percentiles = Self::calculate_percentiles(&fees); } diff --git a/src/main.rs b/src/main.rs index 783f5286..c5172c7f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,6 +44,17 @@ struct Miner { pub tip: Arc>, } +struct MinerConfig { + pub rpc_client: Arc, + pub priority_fee: Option, + pub keypair_filepath: Option, + pub dynamic_fee_url: Option, + pub dynamic_fee: bool, + pub fee_payer_filepath: Option, + pub jito_client: Arc, + pub tip: Arc>, +} + #[derive(Subcommand, Debug)] enum Commands { #[command(about = "Fetch an account balance")] @@ -201,16 +212,18 @@ async fn main() { }); } - let miner = Arc::new(Miner::new( - Arc::new(rpc_client), - args.priority_fee, - Some(default_keypair), - args.dynamic_fee_url, - args.dynamic_fee, - Some(fee_payer_filepath), - Arc::new(jito_client), + let miner_config = MinerConfig { + rpc_client: Arc::new(rpc_client), + priority_fee: args.priority_fee, + keypair_filepath: Some(default_keypair), + dynamic_fee_url: args.dynamic_fee_url, + dynamic_fee: args.dynamic_fee, + fee_payer_filepath: Some(fee_payer_filepath), + jito_client: Arc::new(jito_client), tip, - )); + }; + + let miner = Arc::new(Miner::new(miner_config)); // Execute user command. match args.command { @@ -258,32 +271,23 @@ async fn main() { } impl Miner { - pub fn new( - rpc_client: Arc, - priority_fee: Option, - keypair_filepath: Option, - dynamic_fee_url: Option, - dynamic_fee: bool, - fee_payer_filepath: Option, - jito_client: Arc, - tip: Arc>, - ) -> Self { + pub fn new(config: MinerConfig) -> Self { Self { - rpc_client, - keypair_filepath, - priority_fee, - dynamic_fee_url, - dynamic_fee, - fee_payer_filepath, - jito_client, - tip, + rpc_client: config.rpc_client, + keypair_filepath: config.keypair_filepath, + priority_fee: config.priority_fee, + dynamic_fee_url: config.dynamic_fee_url, + dynamic_fee: config.dynamic_fee, + fee_payer_filepath: config.fee_payer_filepath, + jito_client: config.jito_client, + tip: config.tip, } } pub fn signer(&self) -> Keypair { match self.keypair_filepath.clone() { Some(filepath) => read_keypair_file(filepath.clone()) - .expect(format!("No keypair found at {}", filepath).as_str()), + .unwrap_or_else(|_| panic!("No keypair found at {}", filepath)), None => panic!("No keypair provided"), } } @@ -291,7 +295,7 @@ impl Miner { pub fn fee_payer(&self) -> Keypair { match self.fee_payer_filepath.clone() { Some(filepath) => read_keypair_file(filepath.clone()) - .expect(format!("No fee payer keypair found at {}", filepath).as_str()), + .unwrap_or_else(|_| panic!("No fee payer keypair found at {}", filepath)), None => panic!("No fee payer keypair provided"), } } diff --git a/src/mine.rs b/src/mine.rs index 5c369e3e..8afd7df6 100644 --- a/src/mine.rs +++ b/src/mine.rs @@ -105,7 +105,6 @@ impl Miner { .map(|i| { let global_best_difficulty = Arc::clone(&global_best_difficulty); std::thread::spawn({ - let proof = proof.clone(); let progress_bar = progress_bar.clone(); let mut memory = equix::SolverMemory::new(); move || { @@ -135,12 +134,10 @@ impl Miner { best_nonce = nonce; best_difficulty = difficulty; best_hash = hx; - // {{ edit_1 }} if best_difficulty.gt(&*global_best_difficulty.read().unwrap()) { *global_best_difficulty.write().unwrap() = best_difficulty; } - // {{ edit_1 }} } } @@ -241,19 +238,16 @@ impl Miner { if let Ok(accounts) = self.rpc_client.get_multiple_accounts(&BUS_ADDRESSES).await { let mut top_bus_balance: u64 = 0; let mut top_bus = BUS_ADDRESSES[0]; - for account in accounts { - if let Some(account) = account { - if let Ok(bus) = Bus::try_from_bytes(&account.data) { - if bus.rewards.gt(&top_bus_balance) { - top_bus_balance = bus.rewards; - top_bus = BUS_ADDRESSES[bus.id as usize]; - } + for account in accounts.into_iter().flatten() { + if let Ok(bus) = Bus::try_from_bytes(&account.data) { + if bus.rewards.gt(&top_bus_balance) { + top_bus_balance = bus.rewards; + top_bus = BUS_ADDRESSES[bus.id as usize]; } } } return top_bus; } - // Otherwise return a random bus let i = rand::thread_rng().gen_range(0..BUS_COUNT); BUS_ADDRESSES[i] diff --git a/src/proof.rs b/src/proof.rs index 4e9d8f32..a6ccbfc1 100644 --- a/src/proof.rs +++ b/src/proof.rs @@ -28,7 +28,7 @@ impl Miner { ); println!( "Last hash: {}", - solana_sdk::hash::Hash::new_from_array(proof.last_hash).to_string() + solana_sdk::hash::Hash::new_from_array(proof.last_hash) ); println!("Last hash at: {:?}", proof.last_hash_at); println!("Last stake at: {:?}", proof.last_stake_at); diff --git a/src/send_and_confirm.rs b/src/send_and_confirm.rs index 2c81ac33..e7a25412 100644 --- a/src/send_and_confirm.rs +++ b/src/send_and_confirm.rs @@ -96,13 +96,7 @@ impl Miner { ]; final_ixs.push(transfer( &signer.pubkey(), - &Pubkey::from_str( - &tip_accounts - .choose(&mut rand::thread_rng()) - .unwrap() - .to_string(), - ) - .unwrap(), + &Pubkey::from_str(tip_accounts.choose(&mut rand::thread_rng()).unwrap()).unwrap(), jito_tip, )); progress_bar.println(format!(" Jito tip: {} SOL", lamports_to_sol(jito_tip))); @@ -177,72 +171,68 @@ impl Miner { std::thread::sleep(Duration::from_millis(CONFIRM_DELAY)); match client.get_signature_statuses(&[sig]).await { Ok(signature_statuses) => { - for status in signature_statuses.value { - if let Some(status) = status { - if let Some(err) = status.err { - match err { - // Instruction error - solana_sdk::transaction::TransactionError::InstructionError(_, err) => { - match err { - // Custom instruction error, parse into OreError - solana_program::instruction::InstructionError::Custom(err_code) => { - match err_code { - e if e == OreError::NeedsReset as u32 => { - attempts = 0; - log_error(&progress_bar, "Needs reset. Retrying...", false); - break 'confirm; - }, - _ => { - log_error(&progress_bar, &err.to_string(), true); - return Err(ClientError { - request: None, - kind: ClientErrorKind::Custom(err.to_string()), - }); - } + for status in signature_statuses.value.into_iter().flatten() { + if let Some(err) = status.err { + match err { + // Instruction error + solana_sdk::transaction::TransactionError::InstructionError(_, err) => { + match err { + // Custom instruction error, parse into OreError + solana_program::instruction::InstructionError::Custom(err_code) => { + match err_code { + e if e == OreError::NeedsReset as u32 => { + attempts = 0; + log_error(&progress_bar, "Needs reset. Retrying...", false); + break 'confirm; + }, + _ => { + log_error(&progress_bar, &err.to_string(), true); + return Err(ClientError { + request: None, + kind: ClientErrorKind::Custom(err.to_string()), + }); } - }, - - // Non custom instruction error, return - _ => { - log_error(&progress_bar, &err.to_string(), true); - return Err(ClientError { - request: None, - kind: ClientErrorKind::Custom(err.to_string()), - }); } - } - }, + }, - // Non instruction error, return - _ => { - log_error(&progress_bar, &err.to_string(), true); - return Err(ClientError { - request: None, - kind: ClientErrorKind::Custom(err.to_string()), - }); + // Non custom instruction error, return + _ => { + log_error(&progress_bar, &err.to_string(), true); + return Err(ClientError { + request: None, + kind: ClientErrorKind::Custom(err.to_string()), + }); + } } + }, + + // Non instruction error, return + _ => { + log_error(&progress_bar, &err.to_string(), true); + return Err(ClientError { + request: None, + kind: ClientErrorKind::Custom(err.to_string()), + }); } - } else if let Some(confirmation) = - status.confirmation_status - { - match confirmation { - TransactionConfirmationStatus::Processed => {} - TransactionConfirmationStatus::Confirmed - | TransactionConfirmationStatus::Finalized => { - let now = Local::now(); - let formatted_time = - now.format("%Y-%m-%d %H:%M:%S").to_string(); - progress_bar.println(format!( - " Timestamp: {}", - formatted_time - )); - progress_bar.finish_with_message(format!( - "{} {}", - "OK".bold().green(), - sig - )); - return Ok(sig); - } + } + } else if let Some(confirmation) = status.confirmation_status { + match confirmation { + TransactionConfirmationStatus::Processed => {} + TransactionConfirmationStatus::Confirmed + | TransactionConfirmationStatus::Finalized => { + let now = Local::now(); + let formatted_time = + now.format("%Y-%m-%d %H:%M:%S").to_string(); + progress_bar.println(format!( + " Timestamp: {}", + formatted_time + )); + progress_bar.finish_with_message(format!( + "{} {}", + "OK".bold().green(), + sig + )); + return Ok(sig); } } }