From 0bbb30b0db2d012ec2ec129edbd61ccd4a5fd156 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Tue, 31 Jan 2023 15:32:48 +0530 Subject: [PATCH 01/27] use solana repo --- Cargo.lock | 1090 ++++++++++++++++++++------------ Cargo.toml | 12 +- bench/Cargo.toml | 4 +- bench/src/helpers.rs | 2 +- bench/src/main.rs | 2 +- src/bridge.rs | 16 +- src/rpc.rs | 4 +- src/tpu_manager.rs | 15 +- src/workers/block_listenser.rs | 11 +- tests/client.rs | 3 +- tests/workers.rs | 3 +- 11 files changed, 734 insertions(+), 428 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 503df6d0..ef9a41a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,21 +98,103 @@ dependencies = [ "libc", ] -[[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.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" +[[package]] +name = "ark-bn254" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea691771ebbb28aea556c044e2e5c5227398d840cee0c34d4d20fa8eb2689e8c" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dea978406c4b1ca13c2db2373b05cc55429c3575b8b21f1b9ee859aa5b03dd42" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "num-bigint 0.4.3", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint 0.4.3", + "num-traits", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std", + "digest 0.9.0", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "array-bytes" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" + [[package]] name = "arrayref" version = "0.3.6" @@ -125,6 +207,12 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + [[package]] name = "asn1-rs" version = "0.5.1" @@ -205,9 +293,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.63" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff18d764974428cf3a9328e23fc5c986f5fbed46e6cd4cdf42544df5d297ec1" +checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ "proc-macro2 1.0.50", "quote 1.0.23", @@ -275,8 +363,8 @@ dependencies = [ "log", "serde", "serde_json", - "solana-client", - "solana-sdk", + "solana-rpc-client", + "solana-sdk 1.15.0", "tokio", "tracing-subscriber", ] @@ -546,21 +634,6 @@ dependencies = [ "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.23" @@ -572,9 +645,9 @@ dependencies = [ "clap_lex 0.2.4", "indexmap", "once_cell", - "strsim 0.10.0", + "strsim", "termcolor", - "textwrap 0.16.0", + "textwrap", ] [[package]] @@ -588,7 +661,7 @@ dependencies = [ "clap_lex 0.3.1", "is-terminal", "once_cell", - "strsim 0.10.0", + "strsim", "termcolor", ] @@ -633,6 +706,19 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + [[package]] name = "console" version = "0.15.5" @@ -848,9 +934,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d1075c37807dcf850c379432f0df05ba52cc30f279c5cfc43cc221ce7f8579" +checksum = "322296e2f2e5af4270b54df9e85a02ff037e271af20ba3e7fe1575515dc840b8" dependencies = [ "cc", "cxxbridge-flags", @@ -860,9 +946,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5044281f61b27bc598f2f6647d480aed48d2bf52d6eb0b627d84c0361b17aa70" +checksum = "017a1385b05d631e7875b1f151c9f012d37b53491e2a87f65bff5c262b2111d8" dependencies = [ "cc", "codespan-reporting", @@ -875,21 +961,56 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b50bc93ba22c27b0d31128d2d130a0a6b3d267ae27ef7e4fae2167dfe8781c" +checksum = "c26bbb078acf09bc1ecda02d4223f03bdd28bd4874edcb0379138efc499ce971" [[package]] name = "cxxbridge-macro" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e61fda7e62115119469c7b3591fd913ecca96fb766cfd3f2e2502ab7bc87a5" +checksum = "357f40d1f06a24b60ae1fe122542c1fb05d28d32acb2aed064e84bc2ad1e252e" dependencies = [ "proc-macro2 1.0.50", "quote 1.0.23", "syn 1.0.107", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 1.0.50", + "quote 1.0.23", + "strsim", + "syn 1.0.107", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "dashmap" version = "5.4.0" @@ -939,15 +1060,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" [[package]] -name = "dialoguer" -version = "0.10.3" +name = "derivative" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af3c796f3b0b408d9fd581611b47fa850821fcb84aa640b83a3c1a5be2d691f2" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "console", - "shell-words", - "tempfile", - "zeroize", + "proc-macro2 1.0.50", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -979,16 +1099,6 @@ dependencies = [ "dirs-sys", ] -[[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" version = "0.3.7" @@ -1000,17 +1110,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "displaydoc" version = "0.2.3" @@ -1115,36 +1214,24 @@ dependencies = [ [[package]] name = "enum-iterator" -version = "0.8.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2953d1df47ac0eb70086ccabf0275aa8da8591a28bd358ee2b52bd9f9e3ff9e9" +checksum = "91a4ec26efacf4aeff80887a175a419493cb6f8b5480d26387eb0bd038976187" dependencies = [ "enum-iterator-derive", ] [[package]] name = "enum-iterator-derive" -version = "0.8.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" +checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" dependencies = [ "proc-macro2 1.0.50", "quote 1.0.23", "syn 1.0.107", ] -[[package]] -name = "enum_dispatch" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11f36e95862220b211a6e2aa5eca09b4fa391b13cd52ceb8035a24bf65a79de2" -dependencies = [ - "once_cell", - "proc-macro2 1.0.50", - "quote 1.0.23", - "syn 1.0.107", -] - [[package]] name = "env_logger" version = "0.9.3" @@ -1366,15 +1453,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generic-array" version = "0.14.6" @@ -1437,9 +1515,9 @@ dependencies = [ [[package]] name = "gloo-net" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9050ff8617e950288d7bf7f300707639fdeda5ca0d0ecf380cff448cfd52f4a6" +checksum = "9902a044653b26b99f7e3693a42f171312d9be8b26b5697bd1e43ad1f8a35e10" dependencies = [ "futures-channel", "futures-core", @@ -1457,9 +1535,9 @@ dependencies = [ [[package]] name = "gloo-timers" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c4a8d6391675c6b2ee1a6c8d06e8e2d03605c44cec1270675985a4c2a5500b" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" dependencies = [ "futures-channel", "futures-core", @@ -1480,6 +1558,17 @@ dependencies = [ "web-sys", ] +[[package]] +name = "goblin" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" +dependencies = [ + "log", + "plain", + "scroll", +] + [[package]] name = "h2" version = "0.3.15" @@ -1499,6 +1588,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + [[package]] name = "hashbrown" version = "0.11.2" @@ -1681,6 +1779,12 @@ dependencies = [ "cxx-build", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.3.0" @@ -1720,14 +1824,14 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.16.2" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" +checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" dependencies = [ "console", - "lazy_static", "number_prefix", - "regex", + "portable-atomic", + "unicode-width", ] [[package]] @@ -2080,12 +2184,6 @@ dependencies = [ "cc", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.1.4" @@ -2114,8 +2212,12 @@ dependencies = [ "serde", "serde_json", "serde_prometheus", - "solana-client", - "solana-sdk", + "solana-pubsub-client", + "solana-quic-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk 1.15.0", + "solana-tpu-client", "solana-transaction-status", "solana-version", "thiserror", @@ -2250,14 +2352,16 @@ dependencies = [ [[package]] name = "nix" -version = "0.24.3" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" dependencies = [ + "autocfg", "bitflags", "cfg-if", "libc", "memoffset 0.6.5", + "pin-utils", ] [[package]] @@ -2538,6 +2642,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "paste" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" + [[package]] name = "pbkdf2" version = "0.4.0" @@ -2580,6 +2690,16 @@ dependencies = [ "num", ] +[[package]] +name = "pest" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" +dependencies = [ + "thiserror", + "ucd-trie", +] + [[package]] name = "phf" version = "0.11.1" @@ -2647,6 +2767,12 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "polyval" version = "0.5.3" @@ -2659,6 +2785,12 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "portable-atomic" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26f6a7b87c2e435a3241addceeeff740ff8b7e76b74c13bf9acb17fa454ea00b" + [[package]] name = "postgres-native-tls" version = "0.5.0" @@ -2791,16 +2923,15 @@ dependencies = [ [[package]] name = "quinn" -version = "0.8.5" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b435e71d9bfa0d8889927231970c51fb89c58fa63bffcab117c9c7a41e5ef8f" +checksum = "445cbfe2382fa023c4f2f3c7e1c95c03dcc1df2bf23cebcb2b13e1402c4394d1" dependencies = [ "bytes", - "futures-channel", - "futures-util", - "fxhash", + "pin-project-lite", "quinn-proto", "quinn-udp", + "rustc-hash", "rustls", "thiserror", "tokio", @@ -2810,17 +2941,16 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.8.4" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fce546b9688f767a57530652488420d419a8b1f44a478b451c3d1ab6d992a55" +checksum = "72ef4ced82a24bb281af338b9e8f94429b6eca01b4e66d899f40031f074e74c9" dependencies = [ "bytes", - "fxhash", "rand 0.8.5", "ring", + "rustc-hash", "rustls", "rustls-native-certs", - "rustls-pemfile 0.2.1", "slab", "thiserror", "tinyvec", @@ -2830,16 +2960,15 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.1.4" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07946277141531aea269befd949ed16b2c85a780ba1043244eda0969e538e54" +checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" dependencies = [ - "futures-util", "libc", "quinn-proto", "socket2", - "tokio", "tracing", + "windows-sys", ] [[package]] @@ -2964,9 +3093,9 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", "ring", @@ -3051,7 +3180,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls", - "rustls-pemfile 1.0.2", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", @@ -3083,16 +3212,10 @@ dependencies = [ ] [[package]] -name = "rpassword" -version = "6.0.1" +name = "rustc-demangle" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf099a1888612545b683d2661a1940089f6c2e5a8e38979b2159da876bfd956" -dependencies = [ - "libc", - "serde", - "serde_json", - "winapi", -] +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustc-hash" @@ -3109,6 +3232,15 @@ dependencies = [ "semver 0.9.0", ] +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.0" @@ -3160,20 +3292,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.2", + "rustls-pemfile", "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.1", -] - [[package]] name = "rustls-pemfile" version = "1.0.2" @@ -3216,6 +3339,26 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" +dependencies = [ + "proc-macro2 1.0.50", + "quote 1.0.23", + "syn 1.0.107", +] + [[package]] name = "sct" version = "0.7.0" @@ -3228,9 +3371,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ "bitflags", "core-foundation", @@ -3241,9 +3384,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" dependencies = [ "core-foundation-sys", "libc", @@ -3255,7 +3398,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser", + "semver-parser 0.7.0", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser 0.10.2", ] [[package]] @@ -3270,6 +3422,15 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + [[package]] name = "send_wrapper" version = "0.4.0" @@ -3344,15 +3505,25 @@ dependencies = [ ] [[package]] -name = "serde_yaml" -version = "0.8.26" +name = "serde_with" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +checksum = "30d904179146de381af4c93d3af6ca4984b3152db687dacb9c3c35e86f39809c" dependencies = [ - "indexmap", - "ryu", "serde", - "yaml-rust", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1966009f3c05f095697c537312f5415d1e3ed31ce0a56942bac4c771c5c335e" +dependencies = [ + "darling", + "proc-macro2 1.0.50", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -3434,12 +3605,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shell-words" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" - [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -3535,9 +3700,7 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b04c1316932017ae5f947e83d77cc0356c4a395130a480cdc17ffb0570a0c115" +version = "1.15.0" dependencies = [ "Inflector", "base64 0.13.1", @@ -3550,8 +3713,7 @@ dependencies = [ "serde_json", "solana-address-lookup-table-program", "solana-config-program", - "solana-sdk", - "solana-vote-program", + "solana-sdk 1.15.0", "spl-token", "spl-token-2022", "thiserror", @@ -3560,9 +3722,7 @@ dependencies = [ [[package]] name = "solana-address-lookup-table-program" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be490ed850c99286a4e4ba169ce20695336fe666c56bd823bfd8db689d23a58" +version = "1.15.0" dependencies = [ "bincode", "bytemuck", @@ -3571,138 +3731,24 @@ dependencies = [ "num-traits", "rustc_version 0.4.0", "serde", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-program", + "solana-frozen-abi 1.15.0", + "solana-frozen-abi-macro 1.15.0", + "solana-program 1.15.0", "solana-program-runtime", - "solana-sdk", + "solana-sdk 1.15.0", "thiserror", ] -[[package]] -name = "solana-clap-utils" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36228e03e14bc7d7707189b66f625981993f1a000b0b192d5b42367349901d91" -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.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c43b08f24fd605eaeaafe0e834dc9b209137ac253bc874d32a5bdd791cbd318" -dependencies = [ - "dirs-next", - "lazy_static", - "serde", - "serde_derive", - "serde_yaml", - "solana-clap-utils", - "solana-sdk", - "url", -] - -[[package]] -name = "solana-client" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e270b1afd0b360c2aec42ae302ae7980ebb226017275b32a6156ab2ccbdad9" -dependencies = [ - "async-mutex", - "async-trait", - "base64 0.13.1", - "bincode", - "bs58", - "bytes", - "clap 2.34.0", - "crossbeam-channel", - "enum_dispatch", - "futures", - "futures-util", - "indexmap", - "indicatif", - "itertools", - "jsonrpc-core", - "lazy_static", - "log", - "quinn", - "quinn-proto", - "rand 0.7.3", - "rand_chacha 0.2.2", - "rayon", - "reqwest", - "rustls", - "semver 1.0.16", - "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", - "spl-token-2022", - "thiserror", - "tokio", - "tokio-stream", - "tokio-tungstenite", - "tungstenite", - "url", -] - [[package]] name = "solana-config-program" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb275d80a482134f0f0c5439b0c40ba3f04bef70dbc46c0e47f6107f6ae482a8" +version = "1.15.0" dependencies = [ "bincode", "chrono", "serde", "serde_derive", "solana-program-runtime", - "solana-sdk", -] - -[[package]] -name = "solana-faucet" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3ef95ad1f87b8c011d0e4d85a46f4a703e9dd7e722459659b395ed70d6ba924" -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", + "solana-sdk 1.15.0", ] [[package]] @@ -3734,7 +3780,39 @@ dependencies = [ "serde_derive", "serde_json", "sha2 0.10.6", - "solana-frozen-abi-macro", + "solana-frozen-abi-macro 1.14.13", + "subtle", + "thiserror", +] + +[[package]] +name = "solana-frozen-abi" +version = "1.15.0" +dependencies = [ + "ahash", + "blake3", + "block-buffer 0.9.0", + "bs58", + "bv", + "byteorder", + "cc", + "either", + "generic-array", + "getrandom 0.1.16", + "hashbrown 0.12.3", + "im", + "lazy_static", + "log", + "memmap2", + "once_cell", + "rand_core 0.6.4", + "rustc_version 0.4.0", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.6", + "solana-frozen-abi-macro 1.15.0", "subtle", "thiserror", ] @@ -3751,6 +3829,16 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "solana-frozen-abi-macro" +version = "1.15.0" +dependencies = [ + "proc-macro2 1.0.50", + "quote 1.0.23", + "rustc_version 0.4.0", + "syn 1.0.107", +] + [[package]] name = "solana-logger" version = "1.14.13" @@ -3762,35 +3850,38 @@ dependencies = [ "log", ] +[[package]] +name = "solana-logger" +version = "1.15.0" +dependencies = [ + "env_logger", + "lazy_static", + "log", +] + [[package]] name = "solana-measure" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2400d2534a19f7605c5059060edea0499600a223f1a1f6a4b172666c04946a77" +version = "1.15.0" dependencies = [ "log", - "solana-sdk", + "solana-sdk 1.15.0", ] [[package]] name = "solana-metrics" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68aaa3d683945dc3b6ca38923ef952ca1f96a27b61f898a1ddf9f4cd79f2df92" +version = "1.15.0" dependencies = [ "crossbeam-channel", "gethostname", "lazy_static", "log", "reqwest", - "solana-sdk", + "solana-sdk 1.15.0", ] [[package]] name = "solana-net-utils" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d7093739e143d5e2edf3e81e523d47228adb802b847d66f4ab819be7ad6dc8" +version = "1.15.0" dependencies = [ "bincode", "clap 3.2.23", @@ -3801,8 +3892,8 @@ dependencies = [ "serde", "serde_derive", "socket2", - "solana-logger", - "solana-sdk", + "solana-logger 1.15.0", + "solana-sdk 1.15.0", "solana-version", "tokio", "url", @@ -3810,9 +3901,7 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc742f8d53f0a6e6f3a27ed11c1d0764b5486813c721d625c56094fcd14e984" +version = "1.15.0" dependencies = [ "ahash", "bincode", @@ -3831,7 +3920,7 @@ dependencies = [ "serde", "solana-metrics", "solana-rayon-threadlimit", - "solana-sdk", + "solana-sdk 1.15.0", "solana-vote-program", ] @@ -3875,9 +3964,61 @@ dependencies = [ "serde_json", "sha2 0.10.6", "sha3 0.10.6", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-sdk-macro", + "solana-frozen-abi 1.14.13", + "solana-frozen-abi-macro 1.14.13", + "solana-sdk-macro 1.14.13", + "thiserror", + "tiny-bip39", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "solana-program" +version = "1.15.0" +dependencies = [ + "ark-bn254", + "ark-ec", + "ark-ff", + "array-bytes", + "base64 0.13.1", + "bincode", + "bitflags", + "blake3", + "borsh", + "borsh-derive", + "bs58", + "bv", + "bytemuck", + "cc", + "console_error_panic_hook", + "console_log", + "curve25519-dalek", + "getrandom 0.2.8", + "itertools", + "js-sys", + "lazy_static", + "libc", + "libsecp256k1", + "log", + "memoffset 0.6.5", + "num-bigint 0.4.3", + "num-derive", + "num-traits", + "parking_lot", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rustc_version 0.4.0", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.6", + "sha3 0.10.6", + "solana-frozen-abi 1.15.0", + "solana-frozen-abi-macro 1.15.0", + "solana-sdk-macro 1.15.0", "thiserror", "tiny-bip39", "wasm-bindgen", @@ -3886,9 +4027,7 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4d12047608bac77fca000e18f7a2df3c7fa90656d7c7d387b1cd7faf18b238c" +version = "1.15.0" dependencies = [ "base64 0.13.1", "bincode", @@ -3903,41 +4042,113 @@ dependencies = [ "rand 0.7.3", "rustc_version 0.4.0", "serde", - "solana-frozen-abi", - "solana-frozen-abi-macro", + "solana-frozen-abi 1.15.0", + "solana-frozen-abi-macro 1.15.0", "solana-measure", "solana-metrics", - "solana-sdk", + "solana-sdk 1.15.0", + "solana_rbpf", "thiserror", ] +[[package]] +name = "solana-pubsub-client" +version = "1.15.0" +dependencies = [ + "crossbeam-channel", + "futures-util", + "log", + "reqwest", + "semver 1.0.16", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk 1.15.0", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tungstenite", + "url", +] + +[[package]] +name = "solana-quic-client" +version = "1.15.0" +dependencies = [ + "async-mutex", + "async-trait", + "futures", + "itertools", + "lazy_static", + "log", + "quinn", + "quinn-proto", + "quinn-udp", + "rustls", + "solana-measure", + "solana-metrics", + "solana-net-utils", + "solana-rpc-client-api", + "solana-sdk 1.15.0", + "solana-streamer", + "solana-tpu-client", + "thiserror", + "tokio", +] + [[package]] name = "solana-rayon-threadlimit" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eca67181e0381532db4bc69a625b1f96a047be461ff9050c451add0165424f" +version = "1.15.0" dependencies = [ "lazy_static", "num_cpus", ] [[package]] -name = "solana-remote-wallet" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b83d035ee90035ebcb07ec73672fdc0272e5b98899846dd29fcb31f856ac78c" +name = "solana-rpc-client" +version = "1.15.0" dependencies = [ - "console", - "dialoguer", + "async-trait", + "base64 0.13.1", + "bincode", + "bs58", + "indicatif", "log", - "num-derive", - "num-traits", - "parking_lot", - "qstring", + "reqwest", "semver 1.0.16", - "solana-sdk", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk 1.15.0", + "solana-transaction-status", + "solana-version", + "solana-vote-program", + "tokio", +] + +[[package]] +name = "solana-rpc-client-api" +version = "1.15.0" +dependencies = [ + "base64 0.13.1", + "bs58", + "jsonrpc-core", + "reqwest", + "semver 1.0.16", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-sdk 1.15.0", + "solana-transaction-status", + "solana-version", + "spl-token-2022", "thiserror", - "uriparse", ] [[package]] @@ -3981,11 +4192,62 @@ dependencies = [ "serde_json", "sha2 0.10.6", "sha3 0.10.6", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-logger", - "solana-program", - "solana-sdk-macro", + "solana-frozen-abi 1.14.13", + "solana-frozen-abi-macro 1.14.13", + "solana-logger 1.14.13", + "solana-program 1.14.13", + "solana-sdk-macro 1.14.13", + "thiserror", + "uriparse", + "wasm-bindgen", +] + +[[package]] +name = "solana-sdk" +version = "1.15.0" +dependencies = [ + "assert_matches", + "base64 0.13.1", + "bincode", + "bitflags", + "borsh", + "bs58", + "bytemuck", + "byteorder", + "chrono", + "derivation-path", + "digest 0.10.6", + "ed25519-dalek", + "ed25519-dalek-bip32", + "generic-array", + "hmac 0.12.1", + "itertools", + "js-sys", + "lazy_static", + "libsecp256k1", + "log", + "memmap2", + "num-derive", + "num-traits", + "num_enum", + "pbkdf2 0.11.0", + "qstring", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rustc_version 0.4.0", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "serde_with", + "sha2 0.10.6", + "sha3 0.10.6", + "solana-frozen-abi 1.15.0", + "solana-frozen-abi-macro 1.15.0", + "solana-logger 1.15.0", + "solana-program 1.15.0", + "solana-sdk-macro 1.15.0", "thiserror", "uriparse", "wasm-bindgen", @@ -4004,11 +4266,20 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "solana-sdk-macro" +version = "1.15.0" +dependencies = [ + "bs58", + "proc-macro2 1.0.50", + "quote 1.0.23", + "rustversion", + "syn 1.0.107", +] + [[package]] name = "solana-streamer" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853b0187fdf233c13e8b7ba76e61d0c7cb49ca92c5fdb3b7568ad5ca30e2cf88" +version = "1.15.0" dependencies = [ "crossbeam-channel", "futures-util", @@ -4022,22 +4293,45 @@ dependencies = [ "percentage", "pkcs8", "quinn", + "quinn-proto", + "quinn-udp", "rand 0.7.3", "rcgen", "rustls", "solana-metrics", "solana-perf", - "solana-sdk", + "solana-sdk 1.15.0", "thiserror", "tokio", "x509-parser", ] +[[package]] +name = "solana-tpu-client" +version = "1.15.0" +dependencies = [ + "async-trait", + "bincode", + "futures-util", + "indexmap", + "indicatif", + "log", + "rand 0.7.3", + "rayon", + "solana-measure", + "solana-metrics", + "solana-net-utils", + "solana-pubsub-client", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk 1.15.0", + "thiserror", + "tokio", +] + [[package]] name = "solana-transaction-status" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5bbdaed99403e4a17763bee60c1e0e3418524503c72b514ebff62efbcc9d33" +version = "1.15.0" dependencies = [ "Inflector", "base64 0.13.1", @@ -4051,10 +4345,7 @@ dependencies = [ "serde_json", "solana-account-decoder", "solana-address-lookup-table-program", - "solana-measure", - "solana-metrics", - "solana-sdk", - "solana-vote-program", + "solana-sdk 1.15.0", "spl-associated-token-account", "spl-memo", "spl-token", @@ -4064,25 +4355,21 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a46c9ecb15ccd5388511cec0c5bfb989589425f8286ce432ff64b55dc7bf61e" +version = "1.15.0" dependencies = [ "log", "rustc_version 0.4.0", "semver 1.0.16", "serde", "serde_derive", - "solana-frozen-abi", - "solana-frozen-abi-macro", - "solana-sdk", + "solana-frozen-abi 1.15.0", + "solana-frozen-abi-macro 1.15.0", + "solana-sdk 1.15.0", ] [[package]] name = "solana-vote-program" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ab9ff8928282cb42871a370435dd4713f700854801afb476cf63066f1337db" +version = "1.15.0" dependencies = [ "bincode", "log", @@ -4091,11 +4378,12 @@ dependencies = [ "rustc_version 0.4.0", "serde", "serde_derive", - "solana-frozen-abi", - "solana-frozen-abi-macro", + "solana-frozen-abi 1.15.0", + "solana-frozen-abi-macro 1.15.0", "solana-metrics", + "solana-program 1.15.0", "solana-program-runtime", - "solana-sdk", + "solana-sdk 1.15.0", "thiserror", ] @@ -4123,13 +4411,32 @@ dependencies = [ "serde", "serde_json", "sha3 0.9.1", - "solana-program", - "solana-sdk", + "solana-program 1.14.13", + "solana-sdk 1.14.13", "subtle", "thiserror", "zeroize", ] +[[package]] +name = "solana_rbpf" +version = "0.2.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e9e5085099858adba23d0a0b5298da8803f89999cb567ecafab9c916cdf53d" +dependencies = [ + "byteorder", + "combine", + "goblin", + "hash32", + "libc", + "log", + "rand 0.8.5", + "rustc-demangle", + "scroll", + "thiserror", + "winapi", +] + [[package]] name = "spin" version = "0.5.2" @@ -4156,7 +4463,7 @@ dependencies = [ "borsh", "num-derive", "num-traits", - "solana-program", + "solana-program 1.14.13", "spl-token", "spl-token-2022", "thiserror", @@ -4168,7 +4475,7 @@ version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325" dependencies = [ - "solana-program", + "solana-program 1.14.13", ] [[package]] @@ -4182,7 +4489,7 @@ dependencies = [ "num-derive", "num-traits", "num_enum", - "solana-program", + "solana-program 1.14.13", "thiserror", ] @@ -4197,7 +4504,7 @@ dependencies = [ "num-derive", "num-traits", "num_enum", - "solana-program", + "solana-program 1.14.13", "solana-zk-token-sdk", "spl-memo", "spl-token", @@ -4214,12 +4521,6 @@ dependencies = [ "unicode-normalization", ] -[[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" @@ -4289,15 +4590,6 @@ dependencies = [ "winapi-util", ] -[[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.16.0" @@ -4665,6 +4957,12 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + [[package]] name = "unicode-bidi" version = "0.3.10" @@ -4714,6 +5012,15 @@ dependencies = [ "subtle", ] +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + [[package]] name = "untrusted" version = "0.7.1" @@ -4759,18 +5066,18 @@ 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 = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + [[package]] name = "waker-fn" version = "1.1.0" @@ -5015,15 +5322,6 @@ dependencies = [ "time 0.3.17", ] -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "yasna" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index 832004c0..7788c8de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,10 +13,14 @@ members = [ bench = { path = "./bench" } [dependencies] -solana-client = "1.14.13" -solana-sdk = "1.14.13" -solana-transaction-status = "1.14.13" -solana-version = "1.14.13" +solana-sdk = { path = "../solana/sdk/" } +solana-rpc-client = { path = "../solana/rpc-client/" } +solana-rpc-client-api = { path = "../solana/rpc-client-api/" } +solana-tpu-client = { path = "../solana/tpu-client/" } +solana-quic-client= { path = "../solana/quic-client/" } +solana-pubsub-client = { path = "../solana/pubsub-client/" } +solana-transaction-status = { path = "../solana/transaction-status/" } +solana-version = { path = "../solana/version/" } serde = { version = "1.0.152", features = ["derive"] } serde_json = "1.0.91" tokio = { version = "1.25.0", features = ["full"]} diff --git a/bench/Cargo.toml b/bench/Cargo.toml index a66d071a..625cd197 100644 --- a/bench/Cargo.toml +++ b/bench/Cargo.toml @@ -4,8 +4,8 @@ version = "0.1.0" edition = "2021" [dependencies] -solana-client = "1.14.13" -solana-sdk = "1.14.13" +solana-sdk = { path = "../../solana/sdk/" } +solana-rpc-client = { path = "../../solana/rpc-client/" } log = "0.4.17" anyhow = "1.0.68" serde = "1.0.152" diff --git a/bench/src/helpers.rs b/bench/src/helpers.rs index c4a6a7a4..b1b54811 100644 --- a/bench/src/helpers.rs +++ b/bench/src/helpers.rs @@ -1,7 +1,7 @@ use std::{ops::Deref, sync::Arc}; use anyhow::Context; -use solana_client::nonblocking::rpc_client::RpcClient; +use solana_rpc_client::nonblocking::rpc_client::RpcClient; use solana_sdk::{ commitment_config::CommitmentConfig, hash::Hash, diff --git a/bench/src/main.rs b/bench/src/main.rs index 4b2954ef..34f62d76 100644 --- a/bench/src/main.rs +++ b/bench/src/main.rs @@ -11,7 +11,7 @@ use bench::{ }; use clap::Parser; use log::info; -use solana_client::{nonblocking::rpc_client::RpcClient, rpc_client::SerializableTransaction}; +use solana_rpc_client::{nonblocking::rpc_client::RpcClient, rpc_client::SerializableTransaction}; use solana_sdk::{commitment_config::CommitmentConfig, signature::Signature}; #[tokio::main] diff --git a/src/bridge.rs b/src/bridge.rs index 79895b01..6ea366b5 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -16,11 +16,11 @@ use anyhow::bail; use log::info; use jsonrpsee::{server::ServerBuilder, types::SubscriptionResult, SubscriptionSink}; -use solana_client::{ - nonblocking::{pubsub_client::PubsubClient, rpc_client::RpcClient}, - rpc_client::SerializableTransaction, - rpc_config::{RpcContextConfig, RpcRequestAirdropConfig}, - rpc_response::{Response as RpcResponse, RpcBlockhash, RpcResponseContext, RpcVersionInfo}, +use solana_pubsub_client::nonblocking::pubsub_client::PubsubClient; +use solana_rpc_client::{nonblocking::rpc_client::RpcClient, rpc_client::SerializableTransaction}; +use solana_rpc_client_api::{ + config::{RpcContextConfig, RpcRequestAirdropConfig, RpcSignatureStatusConfig}, + response::{Response as RpcResponse, RpcBlockhash, RpcResponseContext, RpcVersionInfo}, }; use solana_sdk::{ commitment_config::{CommitmentConfig, CommitmentLevel}, @@ -236,8 +236,8 @@ impl LiteRpcServer for LiteBridge { async fn get_latest_blockhash( &self, - config: Option, - ) -> crate::rpc::Result> { + config: Option, + ) -> crate::rpc::Result> { let commitment_config = if let Some(RpcContextConfig { commitment, .. }) = config { commitment.unwrap_or_default() } else { @@ -302,7 +302,7 @@ impl LiteRpcServer for LiteBridge { async fn get_signature_statuses( &self, sigs: Vec, - _config: Option, + _config: Option, ) -> crate::rpc::Result>>> { let sig_statuses = sigs .iter() diff --git a/src/rpc.rs b/src/rpc.rs index 36430d16..0f2b63cd 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -1,8 +1,8 @@ use jsonrpsee::proc_macros::rpc; -use solana_client::rpc_config::{ +use solana_rpc_client_api::config::{ RpcContextConfig, RpcRequestAirdropConfig, RpcSignatureStatusConfig, }; -use solana_client::rpc_response::{Response as RpcResponse, RpcBlockhash, RpcVersionInfo}; +use solana_rpc_client_api::response::{Response as RpcResponse, RpcBlockhash, RpcVersionInfo}; use solana_sdk::commitment_config::CommitmentConfig; use solana_transaction_status::TransactionStatus; diff --git a/src/tpu_manager.rs b/src/tpu_manager.rs index b7d3a776..0eafe1c0 100644 --- a/src/tpu_manager.rs +++ b/src/tpu_manager.rs @@ -4,17 +4,18 @@ use std::sync::{ }; use log::info; -use solana_client::{ - nonblocking::{rpc_client::RpcClient, tpu_client::TpuClient}, - tpu_client::TpuClientConfig, -}; +use solana_quic_client::QuicPool; +use solana_rpc_client::nonblocking::rpc_client::RpcClient; +use solana_tpu_client::{nonblocking::tpu_client::TpuClient, tpu_client::TpuClientConfig}; use tokio::sync::{RwLock, RwLockReadGuard}; +pub type QuicTpuClient = TpuClient; + #[derive(Clone)] pub struct TpuManager { error_count: Arc, rpc_client: Arc, - tpu_client: Arc>, + tpu_client: Arc>, ws_addr: String, fanout_slots: u64, } @@ -41,7 +42,7 @@ impl TpuManager { rpc_client: Arc, ws_addr: &str, fanout_slots: u64, - ) -> anyhow::Result { + ) -> anyhow::Result { Ok(TpuClient::new( rpc_client.clone(), ws_addr, @@ -84,7 +85,7 @@ impl TpuManager { } } - pub async fn get_tpu_client(&self) -> RwLockReadGuard { + pub async fn get_tpu_client(&self) -> RwLockReadGuard { self.tpu_client.read().await } } diff --git a/src/workers/block_listenser.rs b/src/workers/block_listenser.rs index e98fe94a..3a5e602b 100644 --- a/src/workers/block_listenser.rs +++ b/src/workers/block_listenser.rs @@ -5,12 +5,13 @@ use dashmap::DashMap; use futures::StreamExt; use jsonrpsee::SubscriptionSink; use log::info; -use solana_client::{ - nonblocking::{pubsub_client::PubsubClient, rpc_client::RpcClient}, - rpc_client::SerializableTransaction, - rpc_config::{RpcBlockSubscribeConfig, RpcBlockSubscribeFilter}, - rpc_response::{Response as RpcResponse, RpcResponseContext}, +use solana_pubsub_client::nonblocking::pubsub_client::PubsubClient; +use solana_rpc_client::{nonblocking::rpc_client::RpcClient, rpc_client::SerializableTransaction}; +use solana_rpc_client_api::{ + config::{RpcBlockSubscribeConfig, RpcBlockSubscribeFilter}, + response::{Response as RpcResponse, RpcResponseContext}, }; + use solana_sdk::commitment_config::{CommitmentConfig, CommitmentLevel}; use solana_transaction_status::{ diff --git a/tests/client.rs b/tests/client.rs index 2766c755..334ce06e 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -3,7 +3,8 @@ use std::sync::Arc; use bench::helpers::BenchHelper; use lite_rpc::DEFAULT_LITE_RPC_ADDR; use log::info; -use solana_client::{nonblocking::rpc_client::RpcClient, rpc_client::SerializableTransaction}; +use solana_rpc_client::nonblocking::rpc_client::RpcClient; +use solana_rpc_client::rpc_client::SerializableTransaction; use solana_sdk::commitment_config::CommitmentConfig; const AMOUNT: usize = 5; diff --git a/tests/workers.rs b/tests/workers.rs index 2a31262a..b535443b 100644 --- a/tests/workers.rs +++ b/tests/workers.rs @@ -9,7 +9,8 @@ use lite_rpc::{ DEFAULT_LITE_RPC_ADDR, DEFAULT_RPC_ADDR, DEFAULT_TX_BATCH_INTERVAL_MS, DEFAULT_TX_BATCH_SIZE, DEFAULT_WS_ADDR, }; -use solana_client::nonblocking::{pubsub_client::PubsubClient, rpc_client::RpcClient}; +use solana_pubsub_client::nonblocking::pubsub_client::PubsubClient; +use solana_rpc_client::nonblocking::rpc_client::RpcClient; use solana_sdk::commitment_config::CommitmentConfig; use solana_transaction_status::TransactionConfirmationStatus; From a2a91dcaf71a40adff7936249090448a673518d0 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Tue, 31 Jan 2023 19:00:52 +0530 Subject: [PATCH 02/27] postgres env --- README.md | 14 ++++++++++++ src/bridge.rs | 6 ++--- src/cli.rs | 2 +- src/main.rs | 4 ++-- src/workers/block_listenser.rs | 40 ++++++++++++++++++---------------- src/workers/postgres.rs | 37 ++++++++++++++++++------------- 6 files changed, 63 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 10f77141..2cdec18e 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,20 @@ $ cd bench and cargo run --release Find a new file named `metrics.csv` in the project root. +## Metrics and Postgres + +LiteRpc implements a postgres service that can write to a postgres database tables as defined +in `./migrations` + +### env variables + +| env | purpose | +| --------- | ------ | +| `CA_PEM_B64` | Base64 encoded `ca.pem` | +| `CLIENT_PKS_B64` | Base64 encoded `client.pks` | +| `CLIENT_PKS_PASS` | Password to `client.pks` | +| `PG_CONFIG` | Postgres Connection Config | + ## License & Copyright Copyright (c) 2022 Blockworks Foundation diff --git a/src/bridge.rs b/src/bridge.rs index 6ea366b5..68f40eca 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -99,11 +99,11 @@ impl LiteBridge { tx_batch_size: usize, tx_send_interval: Duration, clean_interval: Duration, - postgres_config: Option, + enable_postgres: bool, ) -> anyhow::Result>>> { - let (postgres, postgres_send) = if let Some(postgres_config) = postgres_config { + let (postgres, postgres_send) = if enable_postgres { let (postgres_send, postgres_recv) = mpsc::unbounded_channel(); - let (postgres_connection, postgres) = Postgres::new(postgres_config).await?; + let (postgres_connection, postgres) = Postgres::new().await?; let postgres = postgres.start(postgres_recv); diff --git a/src/cli.rs b/src/cli.rs index 18542ca2..ac8bcd42 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -29,5 +29,5 @@ pub struct Args { pub clean_interval_ms: u64, /// addr to postgres #[arg(short = 'p', long)] - pub postgres_config: Option, + pub enable_postgres: bool } diff --git a/src/main.rs b/src/main.rs index 709f0dd1..de2af6f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,7 @@ pub async fn main() -> anyhow::Result<()> { tx_batch_interval_ms, clean_interval_ms, fanout_size, - postgres_config, + enable_postgres, } = Args::parse(); let tx_batch_interval_ms = Duration::from_millis(tx_batch_interval_ms); @@ -32,7 +32,7 @@ pub async fn main() -> anyhow::Result<()> { tx_batch_size, tx_batch_interval_ms, clean_interval_ms, - postgres_config, + enable_postgres, ) .await?; diff --git a/src/workers/block_listenser.rs b/src/workers/block_listenser.rs index 3a5e602b..1cefd389 100644 --- a/src/workers/block_listenser.rs +++ b/src/workers/block_listenser.rs @@ -207,6 +207,27 @@ impl BlockListener { err: err.clone(), confirmation_status: Some(comfirmation_status.clone()), }); + + // + // Write to postgres + // + if let Some(postgres) = &postgres { + let cu_consumed = match compute_units_consumed { + OptionSerializer::Some(cu_consumed) => Some(cu_consumed as i64), + _ => None, + }; + + postgres + .send(PostgresMsg::PostgresUpdateTx( + PostgresUpdateTx { + processed_slot: slot as i64, + cu_consumed, + cu_requested: None, //TODO: cu requested + }, + sig.clone(), + )) + .unwrap(); + } }; // subscribers @@ -220,25 +241,6 @@ impl BlockListener { value: serde_json::json!({ "err": err }), })?; } - - let cu_consumed = match compute_units_consumed { - OptionSerializer::Some(cu_consumed) => Some(cu_consumed as i64), - _ => None, - }; - - // write to postgres - if let Some(postgres) = &postgres { - postgres - .send(PostgresMsg::PostgresUpdateTx( - PostgresUpdateTx { - processed_slot: slot as i64, - cu_consumed, - cu_requested: None, //TODO: cu requested - }, - sig, - )) - .unwrap(); - } } } diff --git a/src/workers/postgres.rs b/src/workers/postgres.rs index 6fcdc964..1810aed8 100644 --- a/src/workers/postgres.rs +++ b/src/workers/postgres.rs @@ -5,7 +5,6 @@ use log::{info, warn}; use postgres_native_tls::MakeTlsConnector; use tokio::{ - fs, sync::{ mpsc::{UnboundedReceiver, UnboundedSender}, RwLock, @@ -16,6 +15,8 @@ use tokio_postgres::Client; use native_tls::{Certificate, Identity, TlsConnector}; +use crate::encoding::BinaryEncoding; + pub struct Postgres { client: Arc>, } @@ -67,20 +68,25 @@ impl Postgres { /// (connection join handle, Self) /// /// returned join handle is required to be polled - pub async fn new( - porstgres_config: String, - ) -> anyhow::Result<(JoinHandle>, Self)> { - let ca_pem = fs::read("ca.pem").await?; - // let ca_pem = BinaryEncoding::Base64 - // .decode(ca_pem_b64) - // .context("ca pem decode")?; + pub async fn new() -> anyhow::Result<(JoinHandle>, Self)> { + let ca_pem_b64 = std::env::var("CA_PEM_B64").context("env CA_PEM_B64 not found")?; + let client_pks_b64 = + std::env::var("CLIENT_PKS_B64").context("env CLIENT_PKS_B64 not found")?; + let client_pks_password = + std::env::var("CLIENT_PKS_PASS").context("env CLIENT_PKS_PASS not found")?; + let pg_config = std::env::var("PG_CONFIG").context("env PG_CONFIG not found")?; - let client_pks = fs::read("client.pks").await?; - // let client_pks = BinaryEncoding::Base64.decode(client_pks_b64).context("client pks decode")?; + let ca_pem = BinaryEncoding::Base64 + .decode(ca_pem_b64) + .context("ca pem decode")?; + + let client_pks = BinaryEncoding::Base64 + .decode(client_pks_b64) + .context("client pks decode")?; let connector = TlsConnector::builder() .add_root_certificate(Certificate::from_pem(&ca_pem)?) - .identity(Identity::from_pkcs12(&client_pks, "p").context("Identity")?) + .identity(Identity::from_pkcs12(&client_pks, &client_pks_password).context("Identity")?) .danger_accept_invalid_hostnames(true) .danger_accept_invalid_certs(true) .build()?; @@ -88,8 +94,7 @@ impl Postgres { info!("making tls config"); let connector = MakeTlsConnector::new(connector); - let (client, connection) = - tokio_postgres::connect(&porstgres_config, connector.clone()).await?; + let (client, connection) = tokio_postgres::connect(&pg_config, connector.clone()).await?; let client = Arc::new(RwLock::new(client)); let connection = { @@ -104,7 +109,7 @@ impl Postgres { warn!("Connection to postgres broke {err:?}") }; - let f = tokio_postgres::connect(&porstgres_config, connector.clone()).await?; + let f = tokio_postgres::connect(&pg_config, connector.clone()).await?; *client.write().await = f.0; connection = f.1; @@ -166,6 +171,8 @@ impl Postgres { } pub async fn update_tx(&self, tx: PostgresUpdateTx, signature: &str) -> anyhow::Result<()> { + warn!("updating {signature} with {tx:?}"); + let PostgresUpdateTx { processed_slot, cu_consumed, @@ -177,7 +184,7 @@ impl Postgres { .await .execute( r#" - UPDATE lite_rpc.Txs + UPDATE lite_rpc.txs SET processed_slot = $1, cu_consumed = $2, cu_requested = $3 WHERE signature = $4 "#, From c696ec587bd68292c447f7eba7d698ffb3c0f3cf Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Tue, 31 Jan 2023 19:01:48 +0530 Subject: [PATCH 03/27] rm log --- src/workers/postgres.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/workers/postgres.rs b/src/workers/postgres.rs index 1810aed8..2e0721bb 100644 --- a/src/workers/postgres.rs +++ b/src/workers/postgres.rs @@ -171,8 +171,6 @@ impl Postgres { } pub async fn update_tx(&self, tx: PostgresUpdateTx, signature: &str) -> anyhow::Result<()> { - warn!("updating {signature} with {tx:?}"); - let PostgresUpdateTx { processed_slot, cu_consumed, From de872eee922b04ff8bddfefe899e94a3b7869726 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Tue, 31 Jan 2023 19:02:23 +0530 Subject: [PATCH 04/27] ignore *post pks and pem --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ef061073..8eaa38f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ target node_modules bench/metrics.csv -*.pem -*.pks +*.pem* +*.pks* .env From 334b6a2c5543d27005a780f7c662263bebd82081 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Tue, 31 Jan 2023 19:20:17 +0530 Subject: [PATCH 05/27] use rust 1.67 and enable postgres --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3c423e1b..a4a0bd18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:1.2 -FROM rust:1.65.0 as base +FROM rust:1.67.0 as base RUN cargo install cargo-chef RUN rustup component add rustfmt RUN apt-get update && apt-get install -y clang cmake ssh @@ -20,4 +20,4 @@ FROM debian:bullseye-slim as run RUN apt-get update && apt-get -y install ca-certificates libc6 COPY --from=build /app/target/release/lite-rpc /usr/local/bin/ -CMD lite-rpc --rpc-addr "$RPC_URL" --ws-addr "$WS_URL" \ No newline at end of file +CMD lite-rpc --rpc-addr "$RPC_URL" --ws-addr "$WS_URL" -p From 464b857a87f71672e01a11403da5e9856f0287fc Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Tue, 31 Jan 2023 22:32:50 +0530 Subject: [PATCH 06/27] bail out when services quit --- src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index de2af6f5..c69d6674 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use anyhow::Context; +use anyhow::bail; use clap::Parser; use lite_rpc::{bridge::LiteBridge, cli::Args}; @@ -41,11 +41,11 @@ pub async fn main() -> anyhow::Result<()> { let ctrl_c_signal = tokio::signal::ctrl_c(); tokio::select! { - services = services => { - services.context("Some services exited unexpectedly")?; + _ = services => { + bail!("Serives quit unexpectedly"); + } + _ = ctrl_c_signal => { + Ok(()) } - _ = ctrl_c_signal => {} } - - Ok(()) } From ecdba2cedc3a7353ce06e65eb9f8b0af4e5db98c Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Tue, 31 Jan 2023 22:38:10 +0530 Subject: [PATCH 07/27] log ctrl c --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index c69d6674..3f115e18 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ use std::time::Duration; use anyhow::bail; use clap::Parser; use lite_rpc::{bridge::LiteBridge, cli::Args}; +use log::info; #[tokio::main] pub async fn main() -> anyhow::Result<()> { @@ -45,6 +46,7 @@ pub async fn main() -> anyhow::Result<()> { bail!("Serives quit unexpectedly"); } _ = ctrl_c_signal => { + info!("Received ctrl+c signal"); Ok(()) } } From 64d8429c455259d1c8a63956c9cfd4ae7f68a1d0 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Tue, 31 Jan 2023 22:38:28 +0530 Subject: [PATCH 08/27] fixed spell mistake --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 3f115e18..680e50f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,7 +43,7 @@ pub async fn main() -> anyhow::Result<()> { tokio::select! { _ = services => { - bail!("Serives quit unexpectedly"); + bail!("Services quit unexpectedly"); } _ = ctrl_c_signal => { info!("Received ctrl+c signal"); From ab24e9df77f618f6de98115025e0b2f16287fcb6 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Tue, 31 Jan 2023 23:54:50 +0530 Subject: [PATCH 09/27] tx_sender batching fix --- src/workers/tx_sender.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/workers/tx_sender.rs b/src/workers/tx_sender.rs index cc5dd372..3ddd851d 100644 --- a/src/workers/tx_sender.rs +++ b/src/workers/tx_sender.rs @@ -118,12 +118,10 @@ impl TxSender { ); loop { - let prev_inst = tokio::time::Instant::now(); - let mut sigs_and_slots = Vec::with_capacity(tx_batch_size); let mut txs = Vec::with_capacity(tx_batch_size); - while (prev_inst.elapsed() < tx_send_interval) || txs.len() == tx_batch_size { + while txs.len() <= tx_batch_size { match recv.try_recv() { Ok((sig, tx, slot)) => { sigs_and_slots.push((sig, slot)); @@ -132,12 +130,16 @@ impl TxSender { Err(TryRecvError::Disconnected) => { bail!("Channel Disconnected"); } - _ => {} + _ => { + break; + } } } self.forward_txs(sigs_and_slots, txs, postgres_send.clone()) .await; + + tokio::time::sleep(tx_send_interval).await; } }) } From e706429b0859eb0eedabb1ffd0bfb40083282055 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Wed, 1 Feb 2023 00:14:24 +0530 Subject: [PATCH 10/27] rm procinfo --- Cargo.lock | 156 ++++++++++++++++++++++++++------- Cargo.toml | 1 - src/bridge.rs | 3 +- src/workers/metrics_capture.rs | 19 +--- 4 files changed, 128 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef9a41a1..de00eacf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -222,7 +222,7 @@ dependencies = [ "asn1-rs-derive", "asn1-rs-impl", "displaydoc", - "nom 7.1.3", + "nom", "num-traits", "rusticata-macros", "thiserror", @@ -1047,7 +1047,7 @@ checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1" dependencies = [ "asn1-rs", "displaydoc", - "nom 7.1.3", + "nom", "num-bigint 0.4.3", "num-traits", "rusticata-macros", @@ -2208,7 +2208,6 @@ dependencies = [ "log", "native-tls", "postgres-native-tls", - "procinfo", "serde", "serde_json", "serde_prometheus", @@ -2364,12 +2363,6 @@ dependencies = [ "pin-utils", ] -[[package]] -name = "nom" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf51a729ecf40266a2368ad335a5fdde43471f545a967109cd62146ecf8b66ff" - [[package]] name = "nom" version = "7.1.3" @@ -2900,18 +2893,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "procinfo" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab1427f3d2635891f842892dda177883dca0639e05fe66796a62c9d2f23b49c" -dependencies = [ - "byteorder", - "libc", - "nom 2.2.1", - "rustc_version 0.2.3", -] - [[package]] name = "qstring" version = "0.7.2" @@ -3225,6 +3206,7 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" +<<<<<<< HEAD version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" @@ -3243,11 +3225,13 @@ dependencies = [ [[package]] name = "rustc_version" +======= +>>>>>>> 107e06a (rm procinfo) version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.16", + "semver", ] [[package]] @@ -3256,7 +3240,7 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" dependencies = [ - "nom 7.1.3", + "nom", ] [[package]] @@ -3394,6 +3378,7 @@ dependencies = [ [[package]] name = "semver" +<<<<<<< HEAD version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" @@ -3412,11 +3397,14 @@ dependencies = [ [[package]] name = "semver" +======= +>>>>>>> 107e06a (rm procinfo) version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" [[package]] +<<<<<<< HEAD name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3432,6 +3420,8 @@ dependencies = [ ] [[package]] +======= +>>>>>>> 107e06a (rm procinfo) name = "send_wrapper" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3729,7 +3719,7 @@ dependencies = [ "log", "num-derive", "num-traits", - "rustc_version 0.4.0", + "rustc_version", "serde", "solana-frozen-abi 1.15.0", "solana-frozen-abi-macro 1.15.0", @@ -3740,6 +3730,97 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD +======= +name = "solana-clap-utils" +version = "1.14.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36228e03e14bc7d7707189b66f625981993f1a000b0b192d5b42367349901d91" +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.14.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c43b08f24fd605eaeaafe0e834dc9b209137ac253bc874d32a5bdd791cbd318" +dependencies = [ + "dirs-next", + "lazy_static", + "serde", + "serde_derive", + "serde_yaml", + "solana-clap-utils", + "solana-sdk", + "url", +] + +[[package]] +name = "solana-client" +version = "1.14.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e270b1afd0b360c2aec42ae302ae7980ebb226017275b32a6156ab2ccbdad9" +dependencies = [ + "async-mutex", + "async-trait", + "base64 0.13.1", + "bincode", + "bs58", + "bytes", + "clap 2.34.0", + "crossbeam-channel", + "enum_dispatch", + "futures", + "futures-util", + "indexmap", + "indicatif", + "itertools", + "jsonrpc-core", + "lazy_static", + "log", + "quinn", + "quinn-proto", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rayon", + "reqwest", + "rustls", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-clap-utils", + "solana-faucet", + "solana-measure", + "solana-metrics", + "solana-net-utils", + "solana-sdk", + "solana-streamer", + "solana-transaction-status", + "solana-version", + "solana-vote-program", + "spl-token-2022", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tungstenite", + "url", +] + +[[package]] +>>>>>>> 107e06a (rm procinfo) name = "solana-config-program" version = "1.15.0" dependencies = [ @@ -3774,7 +3855,7 @@ dependencies = [ "memmap2", "once_cell", "rand_core 0.6.4", - "rustc_version 0.4.0", + "rustc_version", "serde", "serde_bytes", "serde_derive", @@ -3825,7 +3906,7 @@ checksum = "be23cc7a382f54dfe1348edb94610e5cc146b8eb21563cdd04062a403c75ba62" dependencies = [ "proc-macro2 1.0.50", "quote 1.0.23", - "rustc_version 0.4.0", + "rustc_version", "syn 1.0.107", ] @@ -3956,7 +4037,7 @@ dependencies = [ "parking_lot", "rand 0.7.3", "rand_chacha 0.2.2", - "rustc_version 0.4.0", + "rustc_version", "rustversion", "serde", "serde_bytes", @@ -4040,7 +4121,7 @@ dependencies = [ "num-derive", "num-traits", "rand 0.7.3", - "rustc_version 0.4.0", + "rustc_version", "serde", "solana-frozen-abi 1.15.0", "solana-frozen-abi-macro 1.15.0", @@ -4117,6 +4198,7 @@ dependencies = [ "bs58", "indicatif", "log", +<<<<<<< HEAD "reqwest", "semver 1.0.16", "serde", @@ -4148,6 +4230,14 @@ dependencies = [ "solana-transaction-status", "solana-version", "spl-token-2022", +======= + "num-derive", + "num-traits", + "parking_lot", + "qstring", + "semver", + "solana-sdk", +>>>>>>> 107e06a (rm procinfo) "thiserror", ] @@ -4184,7 +4274,7 @@ dependencies = [ "qstring", "rand 0.7.3", "rand_chacha 0.2.2", - "rustc_version 0.4.0", + "rustc_version", "rustversion", "serde", "serde_bytes", @@ -4358,8 +4448,8 @@ name = "solana-version" version = "1.15.0" dependencies = [ "log", - "rustc_version 0.4.0", - "semver 1.0.16", + "rustc_version", + "semver", "serde", "serde_derive", "solana-frozen-abi 1.15.0", @@ -4375,7 +4465,7 @@ dependencies = [ "log", "num-derive", "num-traits", - "rustc_version 0.4.0", + "rustc_version", "serde", "serde_derive", "solana-frozen-abi 1.15.0", @@ -5315,7 +5405,7 @@ dependencies = [ "data-encoding", "der-parser", "lazy_static", - "nom 7.1.3", + "nom", "oid-registry", "rusticata-macros", "thiserror", diff --git a/Cargo.toml b/Cargo.toml index 7788c8de..8f4b9bee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,6 @@ dashmap = "5.4.0" const_env = "0.1.2" jsonrpsee = { version = "0.16.2", features = ["macros", "full"] } tracing-subscriber = "0.3.16" -procinfo = "0.4.2" tokio-postgres = "0.7.7" native-tls = "0.2.11" postgres-native-tls = "0.5.0" diff --git a/src/bridge.rs b/src/bridge.rs index 68f40eca..77e774f2 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -124,6 +124,7 @@ impl LiteBridge { let metrics_capture = MetricsCapture::new(self.tx_sender.clone()); let prometheus_sync = PrometheusSync::new(metrics_capture.clone()).sync(); + let metrics_capture = metrics_capture.capture(); let finalized_block_listener = self .finalized_block_listener @@ -176,7 +177,7 @@ impl LiteBridge { tx_sender, finalized_block_listener, confirmed_block_listener, - metrics_capture.capture(postgres_send), + metrics_capture, prometheus_sync, cleaner, ]; diff --git a/src/workers/metrics_capture.rs b/src/workers/metrics_capture.rs index fdb2b965..0c66059a 100644 --- a/src/workers/metrics_capture.rs +++ b/src/workers/metrics_capture.rs @@ -1,10 +1,10 @@ use std::sync::Arc; -use log::{info, warn}; +use log::info; use solana_transaction_status::TransactionConfirmationStatus; use tokio::{sync::RwLock, task::JoinHandle}; -use super::{PostgresMpscSend, TxSender}; +use super::TxSender; use serde::{Deserialize, Serialize}; /// Background worker which captures metrics @@ -22,7 +22,6 @@ pub struct Metrics { pub txs_ps: usize, pub txs_confirmed_ps: usize, pub txs_finalized_ps: usize, - pub mem_used: Option, } impl MetricsCapture { @@ -37,7 +36,7 @@ impl MetricsCapture { self.metrics.read().await.to_owned() } - pub fn capture(self, postgres: Option) -> JoinHandle> { + pub fn capture(self) -> JoinHandle> { let mut one_second = tokio::time::interval(std::time::Duration::from_secs(1)); tokio::spawn(async move { @@ -76,18 +75,6 @@ impl MetricsCapture { metrics.txs_sent = txs_sent; metrics.txs_confirmed = txs_confirmed; metrics.txs_finalized = txs_finalized; - - metrics.mem_used = match procinfo::pid::statm_self() { - Ok(statm) => Some(statm.size), - Err(err) => { - warn!("Error capturing memory consumption {err}"); - None - } - }; - - if let Some(_postgres) = &postgres { - // postgres.send_metrics(metrics.clone()).await?; - } } }) } From 3387c704dd2c44c945ea3242b3c1452a1ad3df16 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Tue, 31 Jan 2023 15:32:48 +0530 Subject: [PATCH 11/27] use solana repo --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 8f4b9bee..93b84844 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ bs58 = "0.4.0" base64 = "0.21.0" thiserror = "1.0.38" futures = "0.3.26" -bytes = "1.3.0" +bytes = "1.4.0" anyhow = "1.0.68" log = "0.4.17" clap = { version = "4.1.4", features = ["derive"] } From 3f4f673d028e2e5244398bd665690de2d09a6149 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Wed, 1 Feb 2023 17:01:48 +0530 Subject: [PATCH 12/27] forwarded slot --- Cargo.lock | 163 ++++----------------------------------- src/workers/tx_sender.rs | 10 ++- 2 files changed, 21 insertions(+), 152 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index de00eacf..87199811 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -570,9 +570,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "caps" @@ -3204,16 +3204,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -<<<<<<< HEAD -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.3.3" @@ -3225,13 +3215,11 @@ dependencies = [ [[package]] name = "rustc_version" -======= ->>>>>>> 107e06a (rm procinfo) version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver", + "semver 1.0.16", ] [[package]] @@ -3376,40 +3364,21 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -<<<<<<< HEAD -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser 0.7.0", -] - [[package]] name = "semver" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "semver-parser 0.10.2", + "semver-parser", ] [[package]] name = "semver" -======= ->>>>>>> 107e06a (rm procinfo) version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" -[[package]] -<<<<<<< HEAD -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "semver-parser" version = "0.10.2" @@ -3420,8 +3389,6 @@ dependencies = [ ] [[package]] -======= ->>>>>>> 107e06a (rm procinfo) name = "send_wrapper" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3719,7 +3686,7 @@ dependencies = [ "log", "num-derive", "num-traits", - "rustc_version", + "rustc_version 0.4.0", "serde", "solana-frozen-abi 1.15.0", "solana-frozen-abi-macro 1.15.0", @@ -3730,97 +3697,6 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD -======= -name = "solana-clap-utils" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36228e03e14bc7d7707189b66f625981993f1a000b0b192d5b42367349901d91" -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.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c43b08f24fd605eaeaafe0e834dc9b209137ac253bc874d32a5bdd791cbd318" -dependencies = [ - "dirs-next", - "lazy_static", - "serde", - "serde_derive", - "serde_yaml", - "solana-clap-utils", - "solana-sdk", - "url", -] - -[[package]] -name = "solana-client" -version = "1.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e270b1afd0b360c2aec42ae302ae7980ebb226017275b32a6156ab2ccbdad9" -dependencies = [ - "async-mutex", - "async-trait", - "base64 0.13.1", - "bincode", - "bs58", - "bytes", - "clap 2.34.0", - "crossbeam-channel", - "enum_dispatch", - "futures", - "futures-util", - "indexmap", - "indicatif", - "itertools", - "jsonrpc-core", - "lazy_static", - "log", - "quinn", - "quinn-proto", - "rand 0.7.3", - "rand_chacha 0.2.2", - "rayon", - "reqwest", - "rustls", - "semver", - "serde", - "serde_derive", - "serde_json", - "solana-account-decoder", - "solana-clap-utils", - "solana-faucet", - "solana-measure", - "solana-metrics", - "solana-net-utils", - "solana-sdk", - "solana-streamer", - "solana-transaction-status", - "solana-version", - "solana-vote-program", - "spl-token-2022", - "thiserror", - "tokio", - "tokio-stream", - "tokio-tungstenite", - "tungstenite", - "url", -] - -[[package]] ->>>>>>> 107e06a (rm procinfo) name = "solana-config-program" version = "1.15.0" dependencies = [ @@ -3855,7 +3731,7 @@ dependencies = [ "memmap2", "once_cell", "rand_core 0.6.4", - "rustc_version", + "rustc_version 0.4.0", "serde", "serde_bytes", "serde_derive", @@ -3906,7 +3782,7 @@ checksum = "be23cc7a382f54dfe1348edb94610e5cc146b8eb21563cdd04062a403c75ba62" dependencies = [ "proc-macro2 1.0.50", "quote 1.0.23", - "rustc_version", + "rustc_version 0.4.0", "syn 1.0.107", ] @@ -4037,7 +3913,7 @@ dependencies = [ "parking_lot", "rand 0.7.3", "rand_chacha 0.2.2", - "rustc_version", + "rustc_version 0.4.0", "rustversion", "serde", "serde_bytes", @@ -4121,7 +3997,7 @@ dependencies = [ "num-derive", "num-traits", "rand 0.7.3", - "rustc_version", + "rustc_version 0.4.0", "serde", "solana-frozen-abi 1.15.0", "solana-frozen-abi-macro 1.15.0", @@ -4198,7 +4074,6 @@ dependencies = [ "bs58", "indicatif", "log", -<<<<<<< HEAD "reqwest", "semver 1.0.16", "serde", @@ -4230,14 +4105,6 @@ dependencies = [ "solana-transaction-status", "solana-version", "spl-token-2022", -======= - "num-derive", - "num-traits", - "parking_lot", - "qstring", - "semver", - "solana-sdk", ->>>>>>> 107e06a (rm procinfo) "thiserror", ] @@ -4274,7 +4141,7 @@ dependencies = [ "qstring", "rand 0.7.3", "rand_chacha 0.2.2", - "rustc_version", + "rustc_version 0.4.0", "rustversion", "serde", "serde_bytes", @@ -4448,8 +4315,8 @@ name = "solana-version" version = "1.15.0" dependencies = [ "log", - "rustc_version", - "semver", + "rustc_version 0.4.0", + "semver 1.0.16", "serde", "serde_derive", "solana-frozen-abi 1.15.0", @@ -4465,7 +4332,7 @@ dependencies = [ "log", "num-derive", "num-traits", - "rustc_version", + "rustc_version 0.4.0", "serde", "serde_derive", "solana-frozen-abi 1.15.0", @@ -5463,9 +5330,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.5+zstd.1.5.2" +version = "2.0.6+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc50ffce891ad571e9f9afe5039c4837bede781ac4bb13052ed7ae695518596" +checksum = "68a3f9792c0c3dc6c165840a75f47ae1f4da402c2d006881129579f6597e801b" dependencies = [ "cc", "libc", diff --git a/src/workers/tx_sender.rs b/src/workers/tx_sender.rs index 3ddd851d..81f0fcb2 100644 --- a/src/workers/tx_sender.rs +++ b/src/workers/tx_sender.rs @@ -86,15 +86,17 @@ impl TxSender { }; if let Some(postgres) = postgres { + let forwarded_slot = tpu_client.get_tpu_client().await.get_current_slot(); + for (sig, recent_slot) in sigs_and_slots { postgres .send(PostgresMsg::PostgresTx(PostgresTx { signature: sig.clone(), recent_slot: recent_slot as i64, - forwarded_slot: 0, // FIX: figure this out - processed_slot: None, // FIX: figure this out - cu_consumed: None, // FIX: figure this out - cu_requested: None, // FIX: figure this out + forwarded_slot, + processed_slot: None, + cu_consumed: None, + cu_requested: None, quic_response, })) .expect("Error writing to postgres service"); From 63879314a7b93ddda03c6ad7131668ead16a1749 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Thu, 2 Feb 2023 14:33:17 +0530 Subject: [PATCH 13/27] forwarded slot --- src/workers/tx_sender.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/workers/tx_sender.rs b/src/workers/tx_sender.rs index 81f0fcb2..4760174e 100644 --- a/src/workers/tx_sender.rs +++ b/src/workers/tx_sender.rs @@ -86,14 +86,14 @@ impl TxSender { }; if let Some(postgres) = postgres { - let forwarded_slot = tpu_client.get_tpu_client().await.get_current_slot(); + let forwarded_slot = tpu_client.get_tpu_client().await.estimated_current_slot(); for (sig, recent_slot) in sigs_and_slots { postgres .send(PostgresMsg::PostgresTx(PostgresTx { signature: sig.clone(), recent_slot: recent_slot as i64, - forwarded_slot, + forwarded_slot: forwarded_slot as i64, processed_slot: None, cu_consumed: None, cu_requested: None, From c6b6ec0c2fd719b674dec4a7f78fa5e768e35fbb Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Thu, 2 Feb 2023 16:20:06 +0530 Subject: [PATCH 14/27] use solana git --- Cargo.lock | 594 +++++++++++++++++++++++++++++++++++++++++++++-------- Cargo.toml | 16 +- 2 files changed, 512 insertions(+), 98 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 87199811..c0b10310 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -363,7 +363,7 @@ dependencies = [ "log", "serde", "serde_json", - "solana-rpc-client", + "solana-rpc-client 1.15.0", "solana-sdk 1.15.0", "tokio", "tracing-subscriber", @@ -518,9 +518,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45ea9b00a7b3f2988e9a65ad3917e62123c38dba709b666506207be96d1790b" +checksum = "b7f0778972c64420fdedc63f09919c8a88bda7b25135357fd25a5d9f3257e832" dependencies = [ "memchr", "serde", @@ -729,7 +729,7 @@ dependencies = [ "lazy_static", "libc", "unicode-width", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -934,9 +934,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322296e2f2e5af4270b54df9e85a02ff037e271af20ba3e7fe1575515dc840b8" +checksum = "bc831ee6a32dd495436e317595e639a587aa9907bef96fe6e6abc290ab6204e9" dependencies = [ "cc", "cxxbridge-flags", @@ -946,9 +946,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "017a1385b05d631e7875b1f151c9f012d37b53491e2a87f65bff5c262b2111d8" +checksum = "94331d54f1b1a8895cd81049f7eaaaef9d05a7dcb4d1fd08bf3ff0806246789d" dependencies = [ "cc", "codespan-reporting", @@ -961,15 +961,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c26bbb078acf09bc1ecda02d4223f03bdd28bd4874edcb0379138efc499ce971" +checksum = "48dcd35ba14ca9b40d6e4b4b39961f23d835dbb8eed74565ded361d93e1feb8a" [[package]] name = "cxxbridge-macro" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357f40d1f06a24b60ae1fe122542c1fb05d28d32acb2aed064e84bc2ad1e252e" +checksum = "81bbeb29798b407ccd82a3324ade1a7286e0d29851475990b612670f6f5124d2" dependencies = [ "proc-macro2 1.0.50", "quote 1.0.23", @@ -1205,9 +1205,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ "cfg-if", ] @@ -1507,7 +1507,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" dependencies = [ "aho-corasick", - "bstr 1.1.0", + "bstr 1.2.0", "fnv", "log", "regex", @@ -1617,9 +1617,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -1854,12 +1854,12 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" +checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1877,7 +1877,7 @@ dependencies = [ "hermit-abi 0.2.6", "io-lifetimes", "rustix", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1912,9 +1912,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] @@ -2213,12 +2213,12 @@ dependencies = [ "serde_prometheus", "solana-pubsub-client", "solana-quic-client", - "solana-rpc-client", - "solana-rpc-client-api", - "solana-sdk 1.15.0", + "solana-rpc-client 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-rpc-client-api 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-tpu-client", - "solana-transaction-status", - "solana-version", + "solana-transaction-status 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-version 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "thiserror", "tokio", "tokio-postgres", @@ -2312,9 +2312,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "f2e212582ede878b109755efd0773a4f0f4ec851584cf0aefbeb4d9ecc114822" dependencies = [ "adler", ] @@ -2328,7 +2328,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2624,15 +2624,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -2949,7 +2949,7 @@ dependencies = [ "quinn-proto", "socket2", "tracing", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -3242,7 +3242,7 @@ dependencies = [ "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -3296,7 +3296,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -3668,8 +3668,8 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-address-lookup-table-program", - "solana-config-program", + "solana-address-lookup-table-program 1.15.0", + "solana-config-program 1.15.0", "solana-sdk 1.15.0", "spl-token", "spl-token-2022", @@ -3677,6 +3677,29 @@ dependencies = [ "zstd", ] +[[package]] +name = "solana-account-decoder" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "Inflector", + "base64 0.13.1", + "bincode", + "bs58", + "bv", + "lazy_static", + "serde", + "serde_derive", + "serde_json", + "solana-address-lookup-table-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-config-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "spl-token", + "spl-token-2022", + "thiserror", + "zstd", +] + [[package]] name = "solana-address-lookup-table-program" version = "1.15.0" @@ -3691,11 +3714,31 @@ dependencies = [ "solana-frozen-abi 1.15.0", "solana-frozen-abi-macro 1.15.0", "solana-program 1.15.0", - "solana-program-runtime", + "solana-program-runtime 1.15.0", "solana-sdk 1.15.0", "thiserror", ] +[[package]] +name = "solana-address-lookup-table-program" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "bincode", + "bytemuck", + "log", + "num-derive", + "num-traits", + "rustc_version 0.4.0", + "serde", + "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-program-runtime 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "thiserror", +] + [[package]] name = "solana-config-program" version = "1.15.0" @@ -3704,10 +3747,23 @@ dependencies = [ "chrono", "serde", "serde_derive", - "solana-program-runtime", + "solana-program-runtime 1.15.0", "solana-sdk 1.15.0", ] +[[package]] +name = "solana-config-program" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "bincode", + "chrono", + "serde", + "serde_derive", + "solana-program-runtime 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", +] + [[package]] name = "solana-frozen-abi" version = "1.14.13" @@ -3774,6 +3830,39 @@ dependencies = [ "thiserror", ] +[[package]] +name = "solana-frozen-abi" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "ahash", + "blake3", + "block-buffer 0.9.0", + "bs58", + "bv", + "byteorder", + "cc", + "either", + "generic-array", + "getrandom 0.1.16", + "hashbrown 0.12.3", + "im", + "lazy_static", + "log", + "memmap2", + "once_cell", + "rand_core 0.6.4", + "rustc_version 0.4.0", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.6", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "subtle", + "thiserror", +] + [[package]] name = "solana-frozen-abi-macro" version = "1.14.13" @@ -3796,6 +3885,17 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "solana-frozen-abi-macro" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "proc-macro2 1.0.50", + "quote 1.0.23", + "rustc_version 0.4.0", + "syn 1.0.107", +] + [[package]] name = "solana-logger" version = "1.14.13" @@ -3816,6 +3916,16 @@ dependencies = [ "log", ] +[[package]] +name = "solana-logger" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "env_logger", + "lazy_static", + "log", +] + [[package]] name = "solana-measure" version = "1.15.0" @@ -3824,6 +3934,15 @@ dependencies = [ "solana-sdk 1.15.0", ] +[[package]] +name = "solana-measure" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "log", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", +] + [[package]] name = "solana-metrics" version = "1.15.0" @@ -3836,9 +3955,23 @@ dependencies = [ "solana-sdk 1.15.0", ] +[[package]] +name = "solana-metrics" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "crossbeam-channel", + "gethostname", + "lazy_static", + "log", + "reqwest", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", +] + [[package]] name = "solana-net-utils" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "bincode", "clap 3.2.23", @@ -3849,9 +3982,9 @@ dependencies = [ "serde", "serde_derive", "socket2", - "solana-logger 1.15.0", - "solana-sdk 1.15.0", - "solana-version", + "solana-logger 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-version 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "tokio", "url", ] @@ -3859,6 +3992,7 @@ dependencies = [ [[package]] name = "solana-perf" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "ahash", "bincode", @@ -3875,10 +4009,10 @@ dependencies = [ "rand 0.7.3", "rayon", "serde", - "solana-metrics", + "solana-metrics 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-rayon-threadlimit", - "solana-sdk 1.15.0", - "solana-vote-program", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-vote-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", ] [[package]] @@ -3982,6 +4116,59 @@ dependencies = [ "zeroize", ] +[[package]] +name = "solana-program" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "ark-bn254", + "ark-ec", + "ark-ff", + "array-bytes", + "base64 0.13.1", + "bincode", + "bitflags", + "blake3", + "borsh", + "borsh-derive", + "bs58", + "bv", + "bytemuck", + "cc", + "console_error_panic_hook", + "console_log", + "curve25519-dalek", + "getrandom 0.2.8", + "itertools", + "js-sys", + "lazy_static", + "libc", + "libsecp256k1", + "log", + "memoffset 0.6.5", + "num-bigint 0.4.3", + "num-derive", + "num-traits", + "parking_lot", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rustc_version 0.4.0", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "sha2 0.10.6", + "sha3 0.10.6", + "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "thiserror", + "tiny-bip39", + "wasm-bindgen", + "zeroize", +] + [[package]] name = "solana-program-runtime" version = "1.15.0" @@ -4001,16 +4188,44 @@ dependencies = [ "serde", "solana-frozen-abi 1.15.0", "solana-frozen-abi-macro 1.15.0", - "solana-measure", - "solana-metrics", + "solana-measure 1.15.0", + "solana-metrics 1.15.0", "solana-sdk 1.15.0", "solana_rbpf", "thiserror", ] +[[package]] +name = "solana-program-runtime" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "base64 0.13.1", + "bincode", + "eager", + "enum-iterator", + "itertools", + "libc", + "libloading", + "log", + "num-derive", + "num-traits", + "rand 0.7.3", + "rustc_version 0.4.0", + "serde", + "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-measure 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-metrics 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana_rbpf", + "thiserror", +] + [[package]] name = "solana-pubsub-client" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "crossbeam-channel", "futures-util", @@ -4020,9 +4235,9 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder", - "solana-rpc-client-api", - "solana-sdk 1.15.0", + "solana-account-decoder 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-rpc-client-api 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "thiserror", "tokio", "tokio-stream", @@ -4034,6 +4249,7 @@ dependencies = [ [[package]] name = "solana-quic-client" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "async-mutex", "async-trait", @@ -4045,11 +4261,11 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustls", - "solana-measure", - "solana-metrics", + "solana-measure 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-metrics 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-net-utils", - "solana-rpc-client-api", - "solana-sdk 1.15.0", + "solana-rpc-client-api 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-streamer", "solana-tpu-client", "thiserror", @@ -4059,6 +4275,7 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "lazy_static", "num_cpus", @@ -4079,12 +4296,37 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder", - "solana-rpc-client-api", + "solana-account-decoder 1.15.0", + "solana-rpc-client-api 1.15.0", "solana-sdk 1.15.0", - "solana-transaction-status", - "solana-version", - "solana-vote-program", + "solana-transaction-status 1.15.0", + "solana-version 1.15.0", + "solana-vote-program 1.15.0", + "tokio", +] + +[[package]] +name = "solana-rpc-client" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "async-trait", + "base64 0.13.1", + "bincode", + "bs58", + "indicatif", + "log", + "reqwest", + "semver 1.0.16", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-rpc-client-api 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-transaction-status 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-version 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-vote-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "tokio", ] @@ -4100,10 +4342,31 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder", + "solana-account-decoder 1.15.0", "solana-sdk 1.15.0", - "solana-transaction-status", - "solana-version", + "solana-transaction-status 1.15.0", + "solana-version 1.15.0", + "spl-token-2022", + "thiserror", +] + +[[package]] +name = "solana-rpc-client-api" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "base64 0.13.1", + "bs58", + "jsonrpc-core", + "reqwest", + "semver 1.0.16", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-transaction-status 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-version 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "spl-token-2022", "thiserror", ] @@ -4210,6 +4473,58 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "solana-sdk" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "assert_matches", + "base64 0.13.1", + "bincode", + "bitflags", + "borsh", + "bs58", + "bytemuck", + "byteorder", + "chrono", + "derivation-path", + "digest 0.10.6", + "ed25519-dalek", + "ed25519-dalek-bip32", + "generic-array", + "hmac 0.12.1", + "itertools", + "js-sys", + "lazy_static", + "libsecp256k1", + "log", + "memmap2", + "num-derive", + "num-traits", + "num_enum", + "pbkdf2 0.11.0", + "qstring", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rustc_version 0.4.0", + "rustversion", + "serde", + "serde_bytes", + "serde_derive", + "serde_json", + "serde_with", + "sha2 0.10.6", + "sha3 0.10.6", + "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-logger 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "thiserror", + "uriparse", + "wasm-bindgen", +] + [[package]] name = "solana-sdk-macro" version = "1.14.13" @@ -4234,9 +4549,22 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "solana-sdk-macro" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "bs58", + "proc-macro2 1.0.50", + "quote 1.0.23", + "rustversion", + "syn 1.0.107", +] + [[package]] name = "solana-streamer" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "crossbeam-channel", "futures-util", @@ -4255,9 +4583,9 @@ dependencies = [ "rand 0.7.3", "rcgen", "rustls", - "solana-metrics", + "solana-metrics 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-perf", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "thiserror", "tokio", "x509-parser", @@ -4266,6 +4594,7 @@ dependencies = [ [[package]] name = "solana-tpu-client" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "async-trait", "bincode", @@ -4275,13 +4604,13 @@ dependencies = [ "log", "rand 0.7.3", "rayon", - "solana-measure", - "solana-metrics", + "solana-measure 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-metrics 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-net-utils", "solana-pubsub-client", - "solana-rpc-client", - "solana-rpc-client-api", - "solana-sdk 1.15.0", + "solana-rpc-client 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-rpc-client-api 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "thiserror", "tokio", ] @@ -4300,8 +4629,8 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder", - "solana-address-lookup-table-program", + "solana-account-decoder 1.15.0", + "solana-address-lookup-table-program 1.15.0", "solana-sdk 1.15.0", "spl-associated-token-account", "spl-memo", @@ -4310,6 +4639,31 @@ dependencies = [ "thiserror", ] +[[package]] +name = "solana-transaction-status" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "Inflector", + "base64 0.13.1", + "bincode", + "borsh", + "bs58", + "lazy_static", + "log", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-address-lookup-table-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "spl-associated-token-account", + "spl-memo", + "spl-token", + "spl-token-2022", + "thiserror", +] + [[package]] name = "solana-version" version = "1.15.0" @@ -4324,6 +4678,21 @@ dependencies = [ "solana-sdk 1.15.0", ] +[[package]] +name = "solana-version" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "log", + "rustc_version 0.4.0", + "semver 1.0.16", + "serde", + "serde_derive", + "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", +] + [[package]] name = "solana-vote-program" version = "1.15.0" @@ -4337,13 +4706,34 @@ dependencies = [ "serde_derive", "solana-frozen-abi 1.15.0", "solana-frozen-abi-macro 1.15.0", - "solana-metrics", + "solana-metrics 1.15.0", "solana-program 1.15.0", - "solana-program-runtime", + "solana-program-runtime 1.15.0", "solana-sdk 1.15.0", "thiserror", ] +[[package]] +name = "solana-vote-program" +version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" +dependencies = [ + "bincode", + "log", + "num-derive", + "num-traits", + "rustc_version 0.4.0", + "serde", + "serde_derive", + "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-metrics 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-program-runtime 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "thiserror", +] + [[package]] name = "solana-zk-token-sdk" version = "1.14.13" @@ -4671,7 +5061,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -5071,9 +5461,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -5081,9 +5471,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", "log", @@ -5096,9 +5486,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ "cfg-if", "js-sys", @@ -5108,9 +5498,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote 1.0.23", "wasm-bindgen-macro-support", @@ -5118,9 +5508,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2 1.0.50", "quote 1.0.23", @@ -5131,15 +5521,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -5210,6 +5600,30 @@ dependencies = [ "windows_x86_64_msvc", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.1" diff --git a/Cargo.toml b/Cargo.toml index 93b84844..7dbffb17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,14 +13,14 @@ members = [ bench = { path = "./bench" } [dependencies] -solana-sdk = { path = "../solana/sdk/" } -solana-rpc-client = { path = "../solana/rpc-client/" } -solana-rpc-client-api = { path = "../solana/rpc-client-api/" } -solana-tpu-client = { path = "../solana/tpu-client/" } -solana-quic-client= { path = "../solana/quic-client/" } -solana-pubsub-client = { path = "../solana/pubsub-client/" } -solana-transaction-status = { path = "../solana/transaction-status/" } -solana-version = { path = "../solana/version/" } +solana-sdk = { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } +solana-rpc-client = { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } +solana-rpc-client-api= { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } +solana-tpu-client= { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } +solana-quic-client= { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } +solana-pubsub-client= { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } +solana-transaction-status = { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } +solana-version= { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } serde = { version = "1.0.152", features = ["derive"] } serde_json = "1.0.91" tokio = { version = "1.25.0", features = ["full"]} From 2f1334c9fed7e2f05000b96c3ae23d10a6363f18 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Thu, 2 Feb 2023 16:38:27 +0530 Subject: [PATCH 15/27] fix tests to use git instead of path for deps --- Cargo.lock | 486 ++++++----------------------------------------- bench/Cargo.toml | 4 +- tests/client.rs | 3 +- 3 files changed, 63 insertions(+), 430 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c0b10310..0a047fc0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -363,7 +363,7 @@ dependencies = [ "log", "serde", "serde_json", - "solana-rpc-client 1.15.0", + "solana-rpc-client", "solana-sdk 1.15.0", "tokio", "tracing-subscriber", @@ -2213,12 +2213,12 @@ dependencies = [ "serde_prometheus", "solana-pubsub-client", "solana-quic-client", - "solana-rpc-client 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-rpc-client-api 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk 1.15.0", "solana-tpu-client", - "solana-transaction-status 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-version 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-transaction-status", + "solana-version", "thiserror", "tokio", "tokio-postgres", @@ -3655,28 +3655,6 @@ dependencies = [ "sha-1 0.9.8", ] -[[package]] -name = "solana-account-decoder" -version = "1.15.0" -dependencies = [ - "Inflector", - "base64 0.13.1", - "bincode", - "bs58", - "bv", - "lazy_static", - "serde", - "serde_derive", - "serde_json", - "solana-address-lookup-table-program 1.15.0", - "solana-config-program 1.15.0", - "solana-sdk 1.15.0", - "spl-token", - "spl-token-2022", - "thiserror", - "zstd", -] - [[package]] name = "solana-account-decoder" version = "1.15.0" @@ -3691,34 +3669,15 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-address-lookup-table-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-config-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-address-lookup-table-program", + "solana-config-program", + "solana-sdk 1.15.0", "spl-token", "spl-token-2022", "thiserror", "zstd", ] -[[package]] -name = "solana-address-lookup-table-program" -version = "1.15.0" -dependencies = [ - "bincode", - "bytemuck", - "log", - "num-derive", - "num-traits", - "rustc_version 0.4.0", - "serde", - "solana-frozen-abi 1.15.0", - "solana-frozen-abi-macro 1.15.0", - "solana-program 1.15.0", - "solana-program-runtime 1.15.0", - "solana-sdk 1.15.0", - "thiserror", -] - [[package]] name = "solana-address-lookup-table-program" version = "1.15.0" @@ -3731,24 +3690,12 @@ dependencies = [ "num-traits", "rustc_version 0.4.0", "serde", - "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-program-runtime 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "thiserror", -] - -[[package]] -name = "solana-config-program" -version = "1.15.0" -dependencies = [ - "bincode", - "chrono", - "serde", - "serde_derive", - "solana-program-runtime 1.15.0", + "solana-frozen-abi 1.15.0", + "solana-frozen-abi-macro 1.15.0", + "solana-program 1.15.0", + "solana-program-runtime", "solana-sdk 1.15.0", + "thiserror", ] [[package]] @@ -3760,8 +3707,8 @@ dependencies = [ "chrono", "serde", "serde_derive", - "solana-program-runtime 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-program-runtime", + "solana-sdk 1.15.0", ] [[package]] @@ -3801,6 +3748,7 @@ dependencies = [ [[package]] name = "solana-frozen-abi" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "ahash", "blake3", @@ -3830,39 +3778,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "solana-frozen-abi" -version = "1.15.0" -source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" -dependencies = [ - "ahash", - "blake3", - "block-buffer 0.9.0", - "bs58", - "bv", - "byteorder", - "cc", - "either", - "generic-array", - "getrandom 0.1.16", - "hashbrown 0.12.3", - "im", - "lazy_static", - "log", - "memmap2", - "once_cell", - "rand_core 0.6.4", - "rustc_version 0.4.0", - "serde", - "serde_bytes", - "serde_derive", - "serde_json", - "sha2 0.10.6", - "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "subtle", - "thiserror", -] - [[package]] name = "solana-frozen-abi-macro" version = "1.14.13" @@ -3875,16 +3790,6 @@ dependencies = [ "syn 1.0.107", ] -[[package]] -name = "solana-frozen-abi-macro" -version = "1.15.0" -dependencies = [ - "proc-macro2 1.0.50", - "quote 1.0.23", - "rustc_version 0.4.0", - "syn 1.0.107", -] - [[package]] name = "solana-frozen-abi-macro" version = "1.15.0" @@ -3907,15 +3812,6 @@ dependencies = [ "log", ] -[[package]] -name = "solana-logger" -version = "1.15.0" -dependencies = [ - "env_logger", - "lazy_static", - "log", -] - [[package]] name = "solana-logger" version = "1.15.0" @@ -3926,32 +3822,12 @@ dependencies = [ "log", ] -[[package]] -name = "solana-measure" -version = "1.15.0" -dependencies = [ - "log", - "solana-sdk 1.15.0", -] - [[package]] name = "solana-measure" version = "1.15.0" source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "log", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", -] - -[[package]] -name = "solana-metrics" -version = "1.15.0" -dependencies = [ - "crossbeam-channel", - "gethostname", - "lazy_static", - "log", - "reqwest", "solana-sdk 1.15.0", ] @@ -3965,7 +3841,7 @@ dependencies = [ "lazy_static", "log", "reqwest", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0", ] [[package]] @@ -3982,9 +3858,9 @@ dependencies = [ "serde", "serde_derive", "socket2", - "solana-logger 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-version 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-logger 1.15.0", + "solana-sdk 1.15.0", + "solana-version", "tokio", "url", ] @@ -4009,10 +3885,10 @@ dependencies = [ "rand 0.7.3", "rayon", "serde", - "solana-metrics 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-metrics", "solana-rayon-threadlimit", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-vote-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0", + "solana-vote-program", ] [[package]] @@ -4067,6 +3943,7 @@ dependencies = [ [[package]] name = "solana-program" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "ark-bn254", "ark-ec", @@ -4116,62 +3993,10 @@ dependencies = [ "zeroize", ] -[[package]] -name = "solana-program" -version = "1.15.0" -source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" -dependencies = [ - "ark-bn254", - "ark-ec", - "ark-ff", - "array-bytes", - "base64 0.13.1", - "bincode", - "bitflags", - "blake3", - "borsh", - "borsh-derive", - "bs58", - "bv", - "bytemuck", - "cc", - "console_error_panic_hook", - "console_log", - "curve25519-dalek", - "getrandom 0.2.8", - "itertools", - "js-sys", - "lazy_static", - "libc", - "libsecp256k1", - "log", - "memoffset 0.6.5", - "num-bigint 0.4.3", - "num-derive", - "num-traits", - "parking_lot", - "rand 0.7.3", - "rand_chacha 0.2.2", - "rustc_version 0.4.0", - "rustversion", - "serde", - "serde_bytes", - "serde_derive", - "serde_json", - "sha2 0.10.6", - "sha3 0.10.6", - "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "thiserror", - "tiny-bip39", - "wasm-bindgen", - "zeroize", -] - [[package]] name = "solana-program-runtime" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "base64 0.13.1", "bincode", @@ -4188,40 +4013,13 @@ dependencies = [ "serde", "solana-frozen-abi 1.15.0", "solana-frozen-abi-macro 1.15.0", - "solana-measure 1.15.0", - "solana-metrics 1.15.0", + "solana-measure", + "solana-metrics", "solana-sdk 1.15.0", "solana_rbpf", "thiserror", ] -[[package]] -name = "solana-program-runtime" -version = "1.15.0" -source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" -dependencies = [ - "base64 0.13.1", - "bincode", - "eager", - "enum-iterator", - "itertools", - "libc", - "libloading", - "log", - "num-derive", - "num-traits", - "rand 0.7.3", - "rustc_version 0.4.0", - "serde", - "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-measure 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-metrics 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana_rbpf", - "thiserror", -] - [[package]] name = "solana-pubsub-client" version = "1.15.0" @@ -4235,9 +4033,9 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-rpc-client-api 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-account-decoder", + "solana-rpc-client-api", + "solana-sdk 1.15.0", "thiserror", "tokio", "tokio-stream", @@ -4261,11 +4059,11 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustls", - "solana-measure 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-metrics 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-measure", + "solana-metrics", "solana-net-utils", - "solana-rpc-client-api 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-rpc-client-api", + "solana-sdk 1.15.0", "solana-streamer", "solana-tpu-client", "thiserror", @@ -4281,30 +4079,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "solana-rpc-client" -version = "1.15.0" -dependencies = [ - "async-trait", - "base64 0.13.1", - "bincode", - "bs58", - "indicatif", - "log", - "reqwest", - "semver 1.0.16", - "serde", - "serde_derive", - "serde_json", - "solana-account-decoder 1.15.0", - "solana-rpc-client-api 1.15.0", - "solana-sdk 1.15.0", - "solana-transaction-status 1.15.0", - "solana-version 1.15.0", - "solana-vote-program 1.15.0", - "tokio", -] - [[package]] name = "solana-rpc-client" version = "1.15.0" @@ -4321,33 +4095,13 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-rpc-client-api 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-transaction-status 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-version 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-vote-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "tokio", -] - -[[package]] -name = "solana-rpc-client-api" -version = "1.15.0" -dependencies = [ - "base64 0.13.1", - "bs58", - "jsonrpc-core", - "reqwest", - "semver 1.0.16", - "serde", - "serde_derive", - "serde_json", - "solana-account-decoder 1.15.0", + "solana-account-decoder", + "solana-rpc-client-api", "solana-sdk 1.15.0", - "solana-transaction-status 1.15.0", - "solana-version 1.15.0", - "spl-token-2022", - "thiserror", + "solana-transaction-status", + "solana-version", + "solana-vote-program", + "tokio", ] [[package]] @@ -4363,10 +4117,10 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-transaction-status 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-version 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-account-decoder", + "solana-sdk 1.15.0", + "solana-transaction-status", + "solana-version", "spl-token-2022", "thiserror", ] @@ -4425,6 +4179,7 @@ dependencies = [ [[package]] name = "solana-sdk" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "assert_matches", "base64 0.13.1", @@ -4473,58 +4228,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "solana-sdk" -version = "1.15.0" -source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" -dependencies = [ - "assert_matches", - "base64 0.13.1", - "bincode", - "bitflags", - "borsh", - "bs58", - "bytemuck", - "byteorder", - "chrono", - "derivation-path", - "digest 0.10.6", - "ed25519-dalek", - "ed25519-dalek-bip32", - "generic-array", - "hmac 0.12.1", - "itertools", - "js-sys", - "lazy_static", - "libsecp256k1", - "log", - "memmap2", - "num-derive", - "num-traits", - "num_enum", - "pbkdf2 0.11.0", - "qstring", - "rand 0.7.3", - "rand_chacha 0.2.2", - "rustc_version 0.4.0", - "rustversion", - "serde", - "serde_bytes", - "serde_derive", - "serde_json", - "serde_with", - "sha2 0.10.6", - "sha3 0.10.6", - "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-logger 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "thiserror", - "uriparse", - "wasm-bindgen", -] - [[package]] name = "solana-sdk-macro" version = "1.14.13" @@ -4538,17 +4241,6 @@ dependencies = [ "syn 1.0.107", ] -[[package]] -name = "solana-sdk-macro" -version = "1.15.0" -dependencies = [ - "bs58", - "proc-macro2 1.0.50", - "quote 1.0.23", - "rustversion", - "syn 1.0.107", -] - [[package]] name = "solana-sdk-macro" version = "1.15.0" @@ -4583,9 +4275,9 @@ dependencies = [ "rand 0.7.3", "rcgen", "rustls", - "solana-metrics 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-metrics", "solana-perf", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0", "thiserror", "tokio", "x509-parser", @@ -4604,41 +4296,17 @@ dependencies = [ "log", "rand 0.7.3", "rayon", - "solana-measure 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-metrics 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-measure", + "solana-metrics", "solana-net-utils", "solana-pubsub-client", - "solana-rpc-client 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-rpc-client-api 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-sdk 1.15.0", "thiserror", "tokio", ] -[[package]] -name = "solana-transaction-status" -version = "1.15.0" -dependencies = [ - "Inflector", - "base64 0.13.1", - "bincode", - "borsh", - "bs58", - "lazy_static", - "log", - "serde", - "serde_derive", - "serde_json", - "solana-account-decoder 1.15.0", - "solana-address-lookup-table-program 1.15.0", - "solana-sdk 1.15.0", - "spl-associated-token-account", - "spl-memo", - "spl-token", - "spl-token-2022", - "thiserror", -] - [[package]] name = "solana-transaction-status" version = "1.15.0" @@ -4654,9 +4322,9 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-address-lookup-table-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-account-decoder", + "solana-address-lookup-table-program", + "solana-sdk 1.15.0", "spl-associated-token-account", "spl-memo", "spl-token", @@ -4667,6 +4335,7 @@ dependencies = [ [[package]] name = "solana-version" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "log", "rustc_version 0.4.0", @@ -4678,24 +4347,10 @@ dependencies = [ "solana-sdk 1.15.0", ] -[[package]] -name = "solana-version" -version = "1.15.0" -source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" -dependencies = [ - "log", - "rustc_version 0.4.0", - "semver 1.0.16", - "serde", - "serde_derive", - "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", -] - [[package]] name = "solana-vote-program" version = "1.15.0" +source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "bincode", "log", @@ -4706,34 +4361,13 @@ dependencies = [ "serde_derive", "solana-frozen-abi 1.15.0", "solana-frozen-abi-macro 1.15.0", - "solana-metrics 1.15.0", + "solana-metrics", "solana-program 1.15.0", - "solana-program-runtime 1.15.0", + "solana-program-runtime", "solana-sdk 1.15.0", "thiserror", ] -[[package]] -name = "solana-vote-program" -version = "1.15.0" -source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" -dependencies = [ - "bincode", - "log", - "num-derive", - "num-traits", - "rustc_version 0.4.0", - "serde", - "serde_derive", - "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-metrics 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-program-runtime 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", - "thiserror", -] - [[package]] name = "solana-zk-token-sdk" version = "1.14.13" diff --git a/bench/Cargo.toml b/bench/Cargo.toml index 625cd197..e7d577b9 100644 --- a/bench/Cargo.toml +++ b/bench/Cargo.toml @@ -4,8 +4,8 @@ version = "0.1.0" edition = "2021" [dependencies] -solana-sdk = { path = "../../solana/sdk/" } -solana-rpc-client = { path = "../../solana/rpc-client/" } +solana-sdk = { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } +solana-rpc-client = { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } log = "0.4.17" anyhow = "1.0.68" serde = "1.0.152" diff --git a/tests/client.rs b/tests/client.rs index 334ce06e..cc3bb234 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -3,8 +3,7 @@ use std::sync::Arc; use bench::helpers::BenchHelper; use lite_rpc::DEFAULT_LITE_RPC_ADDR; use log::info; -use solana_rpc_client::nonblocking::rpc_client::RpcClient; -use solana_rpc_client::rpc_client::SerializableTransaction; +use solana_rpc_client::{nonblocking::rpc_client::RpcClient, rpc_client::SerializableTransaction}; use solana_sdk::commitment_config::CommitmentConfig; const AMOUNT: usize = 5; From 566b4ee7ec139c42c9af767714b80e57baff14c9 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Thu, 2 Feb 2023 18:00:09 +0530 Subject: [PATCH 16/27] wip --- src/block_store.rs | 37 ++++++++++++++++++++++++++++++++++ src/lib.rs | 1 + src/workers/block_listenser.rs | 30 +++++++++++++++------------ 3 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 src/block_store.rs diff --git a/src/block_store.rs b/src/block_store.rs new file mode 100644 index 00000000..65246217 --- /dev/null +++ b/src/block_store.rs @@ -0,0 +1,37 @@ +use std::sync::{Arc, RwLock}; + +use dashmap::DashMap; +use solana_rpc_client::nonblocking::rpc_client::RpcClient; +use solana_sdk::commitment_config::CommitmentConfig; + +use crate::workers::BlockInformation; + +pub struct BlockStore { + blocks: Arc>, + latest_block_hash: Arc>, +} + +impl BlockStore { + pub async fn new( + rpc_client: &RpcClient, + commitment_config: CommitmentConfig, + ) -> anyhow::Result { + let (latest_block_hash, block_height) = rpc_client + .get_latest_blockhash_with_commitment(commitment_config) + .await?; + + let latest_block_hash = latest_block_hash.to_string(); + let slot = rpc_client + .get_slot_with_commitment(commitment_config) + .await?; + + Ok(Self { + latest_block_hash: Arc::new(RwLock::new(latest_block_hash.clone())), + blocks: Arc::new({ + let map = DashMap::new(); + map.insert(latest_block_hash, BlockInformation { slot, block_height }); + map + }), + }) + } +} diff --git a/src/lib.rs b/src/lib.rs index 4bb5e821..041530c7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,6 +9,7 @@ pub mod errors; pub mod rpc; pub mod tpu_manager; pub mod workers; +pub mod block_store; #[from_env] pub const DEFAULT_RPC_ADDR: &str = "http://0.0.0.0:8899"; diff --git a/src/workers/block_listenser.rs b/src/workers/block_listenser.rs index 1cefd389..77620925 100644 --- a/src/workers/block_listenser.rs +++ b/src/workers/block_listenser.rs @@ -15,8 +15,8 @@ use solana_rpc_client_api::{ use solana_sdk::commitment_config::{CommitmentConfig, CommitmentLevel}; use solana_transaction_status::{ - option_serializer::OptionSerializer, TransactionConfirmationStatus, TransactionStatus, - UiConfirmedBlock, UiTransactionStatusMeta, + option_serializer::OptionSerializer, RewardType, TransactionConfirmationStatus, + TransactionStatus, UiConfirmedBlock, UiTransactionStatusMeta, }; use tokio::{ sync::{mpsc::Sender, RwLock}, @@ -57,14 +57,6 @@ impl BlockListener { tx_sender: TxSender, commitment_config: CommitmentConfig, ) -> anyhow::Result { - let (latest_block_hash, block_height) = rpc_client - .get_latest_blockhash_with_commitment(commitment_config) - .await?; - - let latest_block_hash = latest_block_hash.to_string(); - let slot = rpc_client - .get_slot_with_commitment(commitment_config) - .await?; Ok(Self { pub_sub_client, @@ -97,7 +89,7 @@ impl BlockListener { blockhash.to_owned(), self.block_store .get(blockhash) - .expect("Latest Block Not in Map") + .expect("Race Condition: Latest block not in block store") .value() .to_owned(), ) @@ -172,15 +164,27 @@ impl BlockListener { let parent_slot = block.parent_slot; - *self.latest_block_hash.write().await = blockhash.clone(); self.block_store .insert(blockhash, BlockInformation { slot, block_height }); + *self.latest_block_hash.write().await = blockhash.clone(); if let Some(postgres) = &postgres { + let Some(rewards) = block.rewards else { + continue; + }; + + let Some(leader_reward) = rewards + .iter() + .find(|reward| Some(RewardType::Fee) == reward.reward_type) else { + continue; + }; + + let leader_id = &leader_reward.pubkey; + postgres .send(PostgresMsg::PostgresBlock(PostgresBlock { slot: slot as i64, - leader_id: 0, //FIX: + leader_id, //FIX: parent_slot: parent_slot as i64, })) .expect("Error sending block to postgres service"); From 8aab926e39f6e81ccf6588d99b12776623fc29d6 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Thu, 2 Feb 2023 18:10:02 +0530 Subject: [PATCH 17/27] merge --- src/workers/block_listenser.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/workers/block_listenser.rs b/src/workers/block_listenser.rs index 427d57cd..280b6a56 100644 --- a/src/workers/block_listenser.rs +++ b/src/workers/block_listenser.rs @@ -164,18 +164,12 @@ impl BlockListener { let parent_slot = block.parent_slot; -<<<<<<< HEAD - self.block_store - .insert(blockhash, BlockInformation { slot, block_height }); - *self.latest_block_hash.write().await = blockhash.clone(); -======= // Write to block store first in order to prevent // any race condition i.e prevent some one to // ask the map what it doesn't have rn self.block_store .insert(blockhash.clone(), BlockInformation { slot, block_height }); *self.latest_block_hash.write().await = blockhash; ->>>>>>> fix_block_race_condition if let Some(postgres) = &postgres { let Some(rewards) = block.rewards else { From 7f97b628455ec3a8cd01d9fe222162290cacf99d Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Thu, 2 Feb 2023 19:00:15 +0530 Subject: [PATCH 18/27] untested: block_store and common block_listener --- src/block_store.rs | 87 ++++++++++++++++++++++++++++----- src/bridge.rs | 88 ++++++++++++++-------------------- src/cli.rs | 2 +- src/lib.rs | 2 +- src/tpu_manager.rs | 2 +- src/workers/block_listenser.rs | 82 +++++++++++-------------------- src/workers/cleaner.rs | 32 ++++++------- tests/workers.rs | 12 +++-- 8 files changed, 164 insertions(+), 143 deletions(-) diff --git a/src/block_store.rs b/src/block_store.rs index 65246217..323a63a4 100644 --- a/src/block_store.rs +++ b/src/block_store.rs @@ -1,21 +1,42 @@ -use std::sync::{Arc, RwLock}; +use std::sync::Arc; use dashmap::DashMap; use solana_rpc_client::nonblocking::rpc_client::RpcClient; use solana_sdk::commitment_config::CommitmentConfig; +use tokio::sync::RwLock; use crate::workers::BlockInformation; +#[derive(Clone)] pub struct BlockStore { blocks: Arc>, - latest_block_hash: Arc>, + latest_confirmed_blockhash: Arc>, + latest_finalized_blockhash: Arc>, } impl BlockStore { - pub async fn new( + pub async fn new(rpc_client: &RpcClient) -> anyhow::Result { + let (confirmed_blockhash, confirmed_block) = + Self::fetch_latest(rpc_client, CommitmentConfig::confirmed()).await?; + let (finalized_blockhash, finalized_block) = + Self::fetch_latest(rpc_client, CommitmentConfig::finalized()).await?; + + Ok(Self { + latest_confirmed_blockhash: Arc::new(RwLock::new(confirmed_blockhash.clone())), + latest_finalized_blockhash: Arc::new(RwLock::new(finalized_blockhash.clone())), + blocks: Arc::new({ + let map = DashMap::new(); + map.insert(confirmed_blockhash, confirmed_block); + map.insert(finalized_blockhash, finalized_block); + map + }), + }) + } + + pub async fn fetch_latest( rpc_client: &RpcClient, commitment_config: CommitmentConfig, - ) -> anyhow::Result { + ) -> anyhow::Result<(String, BlockInformation)> { let (latest_block_hash, block_height) = rpc_client .get_latest_blockhash_with_commitment(commitment_config) .await?; @@ -25,13 +46,55 @@ impl BlockStore { .get_slot_with_commitment(commitment_config) .await?; - Ok(Self { - latest_block_hash: Arc::new(RwLock::new(latest_block_hash.clone())), - blocks: Arc::new({ - let map = DashMap::new(); - map.insert(latest_block_hash, BlockInformation { slot, block_height }); - map - }), - }) + Ok((latest_block_hash, BlockInformation { slot, block_height })) + } + + pub async fn get_block_info(&self, blockhash: &str) -> Option { + let Some(info) = self.blocks.get(blockhash) else { + return None; + }; + + Some(info.value().to_owned()) + } + + pub fn get_latest_blockhash(&self, commitment_config: CommitmentConfig) -> Arc> { + if commitment_config.is_finalized() { + self.latest_confirmed_blockhash.clone() + } else { + self.latest_finalized_blockhash.clone() + } + } + + pub async fn get_latest_block_info( + &self, + commitment_config: CommitmentConfig, + ) -> (String, BlockInformation) { + let blockhash = self + .get_latest_blockhash(commitment_config) + .read() + .await + .to_owned(); + + let block_info = self + .blocks + .get(&blockhash) + .expect("Race Condition: Latest block not in block store") + .value() + .to_owned(); + + (blockhash, block_info) + } + + pub async fn add_block( + &self, + blockhash: String, + block_info: BlockInformation, + commitment_config: CommitmentConfig, + ) { + // Write to block store first in order to prevent + // any race condition i.e prevent some one to + // ask the map what it doesn't have rn + self.blocks.insert(blockhash.clone(), block_info); + *self.get_latest_blockhash(commitment_config).write().await = blockhash; } } diff --git a/src/bridge.rs b/src/bridge.rs index 77e774f2..98bf0e8d 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -1,4 +1,5 @@ use crate::{ + block_store::BlockStore, configs::{IsBlockHashValidConfig, SendTransactionConfig}, encoding::BinaryEncoding, rpc::LiteRpcServer, @@ -23,9 +24,7 @@ use solana_rpc_client_api::{ response::{Response as RpcResponse, RpcBlockhash, RpcResponseContext, RpcVersionInfo}, }; use solana_sdk::{ - commitment_config::{CommitmentConfig, CommitmentLevel}, - hash::Hash, - pubkey::Pubkey, + commitment_config::CommitmentConfig, hash::Hash, pubkey::Pubkey, transaction::VersionedTransaction, }; use solana_transaction_status::TransactionStatus; @@ -42,14 +41,13 @@ pub struct LiteBridge { // None if LiteBridge is not executed pub tx_send: Option>, pub tx_sender: TxSender, - pub finalized_block_listener: BlockListener, - pub confirmed_block_listener: BlockListener, + pub block_listner: BlockListener, + pub block_store: BlockStore, } impl LiteBridge { pub async fn new(rpc_url: String, ws_addr: String, fanout_slots: u64) -> anyhow::Result { let rpc_client = Arc::new(RpcClient::new(rpc_url.clone())); - let pub_sub_client = Arc::new(PubsubClient::new(&ws_addr).await?); let tpu_manager = @@ -57,40 +55,25 @@ impl LiteBridge { let tx_sender = TxSender::new(tpu_manager.clone()); - let finalized_block_listener = BlockListener::new( + let block_store = BlockStore::new(&rpc_client).await?; + + let block_listner = BlockListener::new( pub_sub_client.clone(), rpc_client.clone(), tx_sender.clone(), - CommitmentConfig::finalized(), - ) - .await?; - - let confirmed_block_listener = BlockListener::new( - pub_sub_client, - rpc_client.clone(), - tx_sender.clone(), - CommitmentConfig::confirmed(), - ) - .await?; + block_store.clone(), + ); Ok(Self { rpc_client, tpu_manager, tx_send: None, tx_sender, - finalized_block_listener, - confirmed_block_listener, + block_listner, + block_store, }) } - pub fn get_block_listner(&self, commitment_config: CommitmentConfig) -> BlockListener { - if let CommitmentLevel::Finalized = commitment_config.commitment { - self.finalized_block_listener.clone() - } else { - self.confirmed_block_listener.clone() - } - } - /// List for `JsonRpc` requests pub async fn start_services( mut self, @@ -127,19 +110,17 @@ impl LiteBridge { let metrics_capture = metrics_capture.capture(); let finalized_block_listener = self - .finalized_block_listener + .block_listner .clone() - .listen(postgres_send.clone()); + .listen(CommitmentConfig::finalized(), postgres_send.clone()); - let confirmed_block_listener = self.confirmed_block_listener.clone().listen(None); - let cleaner = Cleaner::new( - self.tx_sender.clone(), - [ - self.finalized_block_listener.clone(), - self.confirmed_block_listener.clone(), - ], - ) - .start(clean_interval); + let confirmed_block_listener = self + .block_listner + .clone() + .listen(CommitmentConfig::confirmed(), None); + + let cleaner = + Cleaner::new(self.tx_sender.clone(), self.block_listner.clone()).start(clean_interval); let rpc = self.into_rpc(); @@ -219,11 +200,11 @@ impl LiteRpcServer for LiteBridge { let sig = tx.get_signature(); let Some(BlockInformation { slot, .. }) = self - .confirmed_block_listener + .block_store .get_block_info(&tx.get_recent_blockhash().to_string()) .await else { log::warn!("block"); - return Err(jsonrpsee::core::Error::Custom("Blockhash not found in confirmed block store".to_string())); + return Err(jsonrpsee::core::Error::Custom("Blockhash not found in block store".to_string())); }; self.tx_send @@ -245,9 +226,10 @@ impl LiteRpcServer for LiteBridge { CommitmentConfig::default() }; - let block_listner = self.get_block_listner(commitment_config); - let (blockhash, BlockInformation { slot, block_height }) = - block_listner.get_latest_block_info().await; + let (blockhash, BlockInformation { slot, block_height }) = self + .block_store + .get_latest_block_info(commitment_config) + .await; Ok(RpcResponse { context: RpcResponseContext { @@ -276,8 +258,6 @@ impl LiteRpcServer for LiteBridge { } }; - let block_listner = self.get_block_listner(commitment); - let is_valid = match self .rpc_client .is_blockhash_valid(&blockhash, commitment) @@ -289,7 +269,12 @@ impl LiteRpcServer for LiteBridge { } }; - let slot = block_listner.get_latest_block_info().await.1.slot; + let slot = self + .block_store + .get_latest_block_info(commitment) + .await + .1 + .slot; Ok(RpcResponse { context: RpcResponseContext { @@ -318,8 +303,8 @@ impl LiteRpcServer for LiteBridge { Ok(RpcResponse { context: RpcResponseContext { slot: self - .finalized_block_listener - .get_latest_block_info() + .block_store + .get_latest_block_info(CommitmentConfig::finalized()) .await .1 .slot, @@ -372,11 +357,10 @@ impl LiteRpcServer for LiteBridge { &self, mut sink: SubscriptionSink, signature: String, - commitment_config: CommitmentConfig, + _commitment_config: CommitmentConfig, ) -> SubscriptionResult { sink.accept()?; - self.get_block_listner(commitment_config) - .signature_subscribe(signature, sink); + self.block_listner.signature_subscribe(signature, sink); Ok(()) } } diff --git a/src/cli.rs b/src/cli.rs index ac8bcd42..ab4e03c2 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -29,5 +29,5 @@ pub struct Args { pub clean_interval_ms: u64, /// addr to postgres #[arg(short = 'p', long)] - pub enable_postgres: bool + pub enable_postgres: bool, } diff --git a/src/lib.rs b/src/lib.rs index 041530c7..7916cd4e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ use const_env::from_env; use solana_transaction_status::TransactionConfirmationStatus; +pub mod block_store; pub mod bridge; pub mod cli; pub mod configs; @@ -9,7 +10,6 @@ pub mod errors; pub mod rpc; pub mod tpu_manager; pub mod workers; -pub mod block_store; #[from_env] pub const DEFAULT_RPC_ADDR: &str = "http://0.0.0.0:8899"; diff --git a/src/tpu_manager.rs b/src/tpu_manager.rs index 0eafe1c0..a4fe623b 100644 --- a/src/tpu_manager.rs +++ b/src/tpu_manager.rs @@ -16,7 +16,7 @@ pub struct TpuManager { error_count: Arc, rpc_client: Arc, tpu_client: Arc>, - ws_addr: String, + pub ws_addr: String, fanout_slots: u64, } diff --git a/src/workers/block_listenser.rs b/src/workers/block_listenser.rs index 280b6a56..b60a5183 100644 --- a/src/workers/block_listenser.rs +++ b/src/workers/block_listenser.rs @@ -19,11 +19,14 @@ use solana_transaction_status::{ TransactionStatus, UiConfirmedBlock, UiTransactionStatusMeta, }; use tokio::{ - sync::{mpsc::Sender, RwLock}, + sync::{mpsc::Sender}, task::JoinHandle, }; -use crate::workers::{PostgresBlock, PostgresMsg, PostgresUpdateTx}; +use crate::{ + block_store::{BlockStore}, + workers::{PostgresBlock, PostgresMsg, PostgresUpdateTx}, +}; use super::{PostgresMpscSend, TxProps, TxSender}; @@ -32,10 +35,8 @@ use super::{PostgresMpscSend, TxProps, TxSender}; #[derive(Clone)] pub struct BlockListener { pub_sub_client: Arc, - commitment_config: CommitmentConfig, tx_sender: TxSender, - block_store: Arc>, - latest_block_hash: Arc>, + block_store: BlockStore, pub signature_subscribers: Arc>, } @@ -51,25 +52,18 @@ pub struct BlockListnerNotificatons { } impl BlockListener { - pub async fn new( + pub fn new( pub_sub_client: Arc, - rpc_client: Arc, + _rpc_client: Arc, tx_sender: TxSender, - commitment_config: CommitmentConfig, - ) -> anyhow::Result { - - Ok(Self { + block_store: BlockStore, + ) -> Self { + Self { pub_sub_client, tx_sender, - latest_block_hash: Arc::new(RwLock::new(latest_block_hash.clone())), - block_store: Arc::new({ - let map = DashMap::new(); - map.insert(latest_block_hash, BlockInformation { slot, block_height }); - map - }), - commitment_config, + block_store, signature_subscribers: Default::default(), - }) + } } pub async fn num_of_sigs_commited(&self, sigs: &[String]) -> usize { @@ -82,31 +76,6 @@ impl BlockListener { num_of_sigs_commited } - pub async fn get_latest_block_info(&self) -> (String, BlockInformation) { - let blockhash = &*self.latest_block_hash.read().await; - - ( - blockhash.to_owned(), - self.block_store - .get(blockhash) - .expect("Race Condition: Latest block not in block store") - .value() - .to_owned(), - ) - } - - pub async fn get_block_info(&self, blockhash: &str) -> Option { - let Some(info) = self.block_store.get(blockhash) else { - return None; - }; - - Some(info.value().to_owned()) - } - - pub async fn get_latest_blockhash(&self) -> String { - self.latest_block_hash.read().await.to_owned() - } - pub fn signature_subscribe(&self, signature: String, sink: SubscriptionSink) { let _ = self.signature_subscribers.insert(signature, sink); } @@ -115,9 +84,13 @@ impl BlockListener { self.signature_subscribers.remove(&signature); } - pub fn listen(self, postgres: Option) -> JoinHandle> { + pub fn listen( + self, + commitment_config: CommitmentConfig, + postgres: Option, + ) -> JoinHandle> { tokio::spawn(async move { - let commitment = self.commitment_config.commitment; + let commitment = commitment_config.commitment; let comfirmation_status = match commitment { CommitmentLevel::Finalized => TransactionConfirmationStatus::Finalized, @@ -131,7 +104,7 @@ impl BlockListener { .block_subscribe( RpcBlockSubscribeFilter::All, Some(RpcBlockSubscribeConfig { - commitment: Some(self.commitment_config), + commitment: Some(commitment_config), encoding: None, transaction_details: Some( solana_transaction_status::TransactionDetails::Full, @@ -164,12 +137,13 @@ impl BlockListener { let parent_slot = block.parent_slot; - // Write to block store first in order to prevent - // any race condition i.e prevent some one to - // ask the map what it doesn't have rn self.block_store - .insert(blockhash.clone(), BlockInformation { slot, block_height }); - *self.latest_block_hash.write().await = blockhash; + .add_block( + blockhash.clone(), + BlockInformation { slot, block_height }, + commitment_config, + ) + .await; if let Some(postgres) = &postgres { let Some(rewards) = block.rewards else { @@ -182,12 +156,12 @@ impl BlockListener { continue; }; - let leader_id = &leader_reward.pubkey; + let _leader_id = &leader_reward.pubkey; postgres .send(PostgresMsg::PostgresBlock(PostgresBlock { slot: slot as i64, - leader_id, //FIX: + leader_id: 0, //FIX: parent_slot: parent_slot as i64, })) .expect("Error sending block to postgres service"); diff --git a/src/workers/cleaner.rs b/src/workers/cleaner.rs index 3a744d4e..1009140a 100644 --- a/src/workers/cleaner.rs +++ b/src/workers/cleaner.rs @@ -7,16 +7,16 @@ use super::{BlockListener, TxSender}; /// Background worker which cleans up memory #[derive(Clone)] -pub struct Cleaner { +pub struct Cleaner { tx_sender: TxSender, - block_listeners: [BlockListener; N], + block_listenser: BlockListener, } -impl Cleaner { - pub fn new(tx_sender: TxSender, block_listeners: [BlockListener; N]) -> Self { +impl Cleaner { + pub fn new(tx_sender: TxSender, block_listenser: BlockListener) -> Self { Self { tx_sender, - block_listeners, + block_listenser, } } @@ -38,21 +38,19 @@ impl Cleaner { /// Clean Signature Subscribers from Block Listeners pub fn clean_block_listeners(&self) { - for block_listenser in &self.block_listeners { - let mut to_remove = vec![]; + let mut to_remove = vec![]; - for subscriber in block_listenser.signature_subscribers.iter() { - if subscriber.value().is_closed() { - to_remove.push(subscriber.key().to_owned()); - } + for subscriber in self.block_listenser.signature_subscribers.iter() { + if subscriber.value().is_closed() { + to_remove.push(subscriber.key().to_owned()); } - - for to_remove in &to_remove { - block_listenser.signature_subscribers.remove(to_remove); - } - - info!("Cleaned {} Signature Subscribers", to_remove.len()); } + + for to_remove in &to_remove { + self.block_listenser.signature_subscribers.remove(to_remove); + } + + info!("Cleaned {} Signature Subscribers", to_remove.len()); } pub fn start(self, ttl_duration: Duration) -> JoinHandle> { diff --git a/tests/workers.rs b/tests/workers.rs index b535443b..5d056724 100644 --- a/tests/workers.rs +++ b/tests/workers.rs @@ -3,6 +3,7 @@ use std::{sync::Arc, time::Duration}; use bench::helpers::BenchHelper; use futures::future::try_join_all; use lite_rpc::{ + block_store::BlockStore, encoding::BinaryEncoding, tpu_manager::TpuManager, workers::{BlockListener, TxSender}, @@ -35,20 +36,21 @@ async fn send_and_confirm_txs() { let pub_sub_client = Arc::new(PubsubClient::new(DEFAULT_WS_ADDR).await.unwrap()); let tx_sender = TxSender::new(tpu_client); + let block_store = BlockStore::new(&rpc_client).await.unwrap(); let block_listener = BlockListener::new( pub_sub_client.clone(), rpc_client.clone(), tx_sender.clone(), - CommitmentConfig::confirmed(), - ) - .await - .unwrap(); + block_store, + ); let (tx_send, tx_recv) = mpsc::unbounded_channel(); let services = try_join_all(vec![ - block_listener.clone().listen(None), + block_listener + .clone() + .listen(CommitmentConfig::confirmed(), None), tx_sender.clone().execute( tx_recv, DEFAULT_TX_BATCH_SIZE, From ec15e98b7095b5ec2b783749ce7623b48fc89650 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Fri, 3 Feb 2023 15:42:41 +0530 Subject: [PATCH 19/27] test --- src/block_store.rs | 2 ++ src/workers/block_listenser.rs | 11 ++++------- tests/diff.rs | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 tests/diff.rs diff --git a/src/block_store.rs b/src/block_store.rs index 323a63a4..c9da7320 100644 --- a/src/block_store.rs +++ b/src/block_store.rs @@ -1,6 +1,7 @@ use std::sync::Arc; use dashmap::DashMap; +use log::info; use solana_rpc_client::nonblocking::rpc_client::RpcClient; use solana_sdk::commitment_config::CommitmentConfig; use tokio::sync::RwLock; @@ -91,6 +92,7 @@ impl BlockStore { block_info: BlockInformation, commitment_config: CommitmentConfig, ) { + info!("{commitment_config:?} {blockhash:?}, {block_info:?}"); // Write to block store first in order to prevent // any race condition i.e prevent some one to // ask the map what it doesn't have rn diff --git a/src/workers/block_listenser.rs b/src/workers/block_listenser.rs index b60a5183..8044e122 100644 --- a/src/workers/block_listenser.rs +++ b/src/workers/block_listenser.rs @@ -18,13 +18,10 @@ use solana_transaction_status::{ option_serializer::OptionSerializer, RewardType, TransactionConfirmationStatus, TransactionStatus, UiConfirmedBlock, UiTransactionStatusMeta, }; -use tokio::{ - sync::{mpsc::Sender}, - task::JoinHandle, -}; +use tokio::{sync::mpsc::Sender, task::JoinHandle}; use crate::{ - block_store::{BlockStore}, + block_store::BlockStore, workers::{PostgresBlock, PostgresMsg, PostgresUpdateTx}, }; @@ -40,7 +37,7 @@ pub struct BlockListener { pub signature_subscribers: Arc>, } -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct BlockInformation { pub slot: u64, pub block_height: u64, @@ -119,7 +116,7 @@ impl BlockListener { info!("Listening to {commitment:?} blocks"); while let Some(block) = recv.as_mut().next().await { - let slot = block.value.slot; + let slot = block.context.slot; let Some(block) = block.value.block else { continue; diff --git a/tests/diff.rs b/tests/diff.rs new file mode 100644 index 00000000..4605333c --- /dev/null +++ b/tests/diff.rs @@ -0,0 +1,34 @@ +use lite_rpc::{DEFAULT_LITE_RPC_ADDR, DEFAULT_RPC_ADDR}; +use solana_rpc_client::nonblocking::rpc_client::RpcClient; +use solana_sdk::commitment_config::CommitmentConfig; + +#[tokio::test] +async fn diff_rpc() -> anyhow::Result<()> { + let rpc_client = RpcClient::new(DEFAULT_RPC_ADDR.to_string()); + let lite_rpc_client = RpcClient::new(DEFAULT_LITE_RPC_ADDR.to_string()); + + check_block_hash(&rpc_client, &lite_rpc_client, CommitmentConfig::confirmed()).await?; + check_block_hash(&rpc_client, &lite_rpc_client, CommitmentConfig::finalized()).await?; + + Ok(()) +} + +async fn check_block_hash( + rpc_client: &RpcClient, + lite_rpc_client: &RpcClient, + commitment_config: CommitmentConfig, +) -> anyhow::Result<()> { + let rpc_blockhash = rpc_client + .get_latest_blockhash_with_commitment(commitment_config) + .await?; + let lite_blockhash = lite_rpc_client + .get_latest_blockhash_with_commitment(commitment_config) + .await?; + + println!("{commitment_config:?} {rpc_blockhash:?} {lite_blockhash:?}"); + + assert_eq!(rpc_blockhash.0, lite_blockhash.0); + assert_eq!(rpc_blockhash.1, lite_blockhash.1); + + Ok(()) +} From f1e4215c82c061d57f52d8311208e32a700860a7 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Sat, 4 Feb 2023 13:06:39 +0530 Subject: [PATCH 20/27] rm extra argument from block listner --- src/bridge.rs | 1 - src/workers/block_listenser.rs | 3 +-- tests/workers.rs | 7 +------ 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/bridge.rs b/src/bridge.rs index 98bf0e8d..f3b0d336 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -59,7 +59,6 @@ impl LiteBridge { let block_listner = BlockListener::new( pub_sub_client.clone(), - rpc_client.clone(), tx_sender.clone(), block_store.clone(), ); diff --git a/src/workers/block_listenser.rs b/src/workers/block_listenser.rs index 8044e122..e19c3d8a 100644 --- a/src/workers/block_listenser.rs +++ b/src/workers/block_listenser.rs @@ -6,7 +6,7 @@ use futures::StreamExt; use jsonrpsee::SubscriptionSink; use log::info; use solana_pubsub_client::nonblocking::pubsub_client::PubsubClient; -use solana_rpc_client::{nonblocking::rpc_client::RpcClient, rpc_client::SerializableTransaction}; +use solana_rpc_client::rpc_client::SerializableTransaction; use solana_rpc_client_api::{ config::{RpcBlockSubscribeConfig, RpcBlockSubscribeFilter}, response::{Response as RpcResponse, RpcResponseContext}, @@ -51,7 +51,6 @@ pub struct BlockListnerNotificatons { impl BlockListener { pub fn new( pub_sub_client: Arc, - _rpc_client: Arc, tx_sender: TxSender, block_store: BlockStore, ) -> Self { diff --git a/tests/workers.rs b/tests/workers.rs index 5d056724..d1dd5c08 100644 --- a/tests/workers.rs +++ b/tests/workers.rs @@ -38,12 +38,7 @@ async fn send_and_confirm_txs() { let tx_sender = TxSender::new(tpu_client); let block_store = BlockStore::new(&rpc_client).await.unwrap(); - let block_listener = BlockListener::new( - pub_sub_client.clone(), - rpc_client.clone(), - tx_sender.clone(), - block_store, - ); + let block_listener = BlockListener::new(pub_sub_client.clone(), tx_sender.clone(), block_store); let (tx_send, tx_recv) = mpsc::unbounded_channel(); From 2ec0fc06afcf0eb0630a9cfa211f31c34d6b2726 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Sat, 4 Feb 2023 17:15:20 +0530 Subject: [PATCH 21/27] prometheus --- Cargo.lock | 259 +++++++++--------- Cargo.toml | 3 +- src/block_store.rs | 3 +- src/bridge.rs | 7 +- src/cli.rs | 5 +- src/main.rs | 2 + src/workers/block_listenser.rs | 45 ++- src/workers/mod.rs | 4 +- .../{prometheus.rs => prometheus_sync.rs} | 32 +-- src/workers/tx_sender.rs | 9 + 10 files changed, 207 insertions(+), 162 deletions(-) rename src/workers/{prometheus.rs => prometheus_sync.rs} (56%) diff --git a/Cargo.lock b/Cargo.lock index 0a047fc0..f55bea5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -364,7 +364,7 @@ dependencies = [ "serde", "serde_json", "solana-rpc-client", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "tokio", "tracing-subscriber", ] @@ -1144,12 +1144,6 @@ dependencies = [ "syn 0.15.44", ] -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - [[package]] name = "eager" version = "0.1.0" @@ -1333,12 +1327,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "ftoa" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca45aac12b6c561b6289bc68957cb1db3dccf870e1951d590202de5e24f1dd35" - [[package]] name = "futures" version = "0.3.26" @@ -1639,6 +1627,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "856b5cb0902c2b6d65d5fd97dfa30f9b70c7538e770b98eab5ed52d8db923e01" + [[package]] name = "histogram" version = "0.6.9" @@ -1717,9 +1711,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" dependencies = [ "bytes", "futures-channel", @@ -1819,7 +1813,6 @@ checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", "hashbrown 0.12.3", - "serde", ] [[package]] @@ -1870,14 +1863,14 @@ checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" [[package]] name = "is-terminal" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.0", "io-lifetimes", "rustix", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -2205,17 +2198,18 @@ dependencies = [ "dashmap", "futures", "jsonrpsee", + "lazy_static", "log", "native-tls", "postgres-native-tls", + "prometheus", "serde", "serde_json", - "serde_prometheus", "solana-pubsub-client", "solana-quic-client", "solana-rpc-client", "solana-rpc-client-api", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-tpu-client", "solana-transaction-status", "solana-version", @@ -2286,6 +2280,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + [[package]] name = "merlin" version = "3.0.0" @@ -2312,9 +2315,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.6.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2e212582ede878b109755efd0773a4f0f4ec851584cf0aefbeb4d9ecc114822" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] @@ -2893,6 +2896,27 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "memchr", + "parking_lot", + "protobuf", + "thiserror", +] + +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + [[package]] name = "qstring" version = "0.7.2" @@ -3233,16 +3257,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.7" +version = "0.36.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" +checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" dependencies = [ "bitflags", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -3434,21 +3458,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_prometheus" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fcd6131bac47a32328d1ba1ee15a27f8d91ab2e5920dba71dbe93d2648f6b1" -dependencies = [ - "ftoa", - "indexmap", - "itoa 0.4.8", - "lazy_static", - "regex", - "serde", - "snafu", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3608,27 +3617,6 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" -[[package]] -name = "snafu" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab12d3c261b2308b0d80c26fffb58d17eba81a4be97890101f416b478c79ca7" -dependencies = [ - "doc-comment", - "snafu-derive", -] - -[[package]] -name = "snafu-derive" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1508efa03c362e23817f96cde18abed596a25219a8b2c66e8db33c03543d315b" -dependencies = [ - "proc-macro2 1.0.50", - "quote 1.0.23", - "syn 1.0.107", -] - [[package]] name = "socket2" version = "0.4.7" @@ -3671,7 +3659,7 @@ dependencies = [ "serde_json", "solana-address-lookup-table-program", "solana-config-program", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "spl-token", "spl-token-2022", "thiserror", @@ -3690,11 +3678,11 @@ dependencies = [ "num-traits", "rustc_version 0.4.0", "serde", - "solana-frozen-abi 1.15.0", - "solana-frozen-abi-macro 1.15.0", - "solana-program 1.15.0", + "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-program-runtime", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "thiserror", ] @@ -3708,14 +3696,14 @@ dependencies = [ "serde", "serde_derive", "solana-program-runtime", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", ] [[package]] name = "solana-frozen-abi" -version = "1.14.13" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f44a019070a6cec4d3ad8605c5caa65bdaa13f00b5f1849340f44ffea63b625b" +checksum = "ffc55e72b77452b4469a7f46c3526cbddb4a43382370d5c1112dc108569cfe16" dependencies = [ "ahash", "blake3", @@ -3740,7 +3728,7 @@ dependencies = [ "serde_derive", "serde_json", "sha2 0.10.6", - "solana-frozen-abi-macro 1.14.13", + "solana-frozen-abi-macro 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "subtle", "thiserror", ] @@ -3773,16 +3761,16 @@ dependencies = [ "serde_derive", "serde_json", "sha2 0.10.6", - "solana-frozen-abi-macro 1.15.0", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "subtle", "thiserror", ] [[package]] name = "solana-frozen-abi-macro" -version = "1.14.13" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be23cc7a382f54dfe1348edb94610e5cc146b8eb21563cdd04062a403c75ba62" +checksum = "a7084605b674cf344312c3a2a9c0de05126c2ff4d3d77cc6746f236ca3c4cb53" dependencies = [ "proc-macro2 1.0.50", "quote 1.0.23", @@ -3803,9 +3791,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.14.13" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447d16a70a1b5383736ef44801050c0e1affd022303b22ed899352f958c2de4b" +checksum = "dae1169570b4f086a42f340b86b698b8b64dfa0f931f2a4f0f3c5b18195d6711" dependencies = [ "env_logger", "lazy_static", @@ -3828,7 +3816,7 @@ version = "1.15.0" source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "log", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", ] [[package]] @@ -3841,7 +3829,7 @@ dependencies = [ "lazy_static", "log", "reqwest", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", ] [[package]] @@ -3858,8 +3846,8 @@ dependencies = [ "serde", "serde_derive", "socket2", - "solana-logger 1.15.0", - "solana-sdk 1.15.0", + "solana-logger 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-version", "tokio", "url", @@ -3887,16 +3875,20 @@ dependencies = [ "serde", "solana-metrics", "solana-rayon-threadlimit", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-vote-program", ] [[package]] name = "solana-program" -version = "1.14.13" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0937481f080f5dd495fae456c94718a7bacf30fb5fdabb02dcb8a9622e446d5" +checksum = "3442ab665ded18fd8526213027a2c05035164b7696e7bf535b7c2d7fa75536fe" dependencies = [ + "ark-bn254", + "ark-ec", + "ark-ff", + "array-bytes", "base64 0.13.1", "bincode", "bitflags", @@ -3917,7 +3909,8 @@ dependencies = [ "libc", "libsecp256k1", "log", - "memoffset 0.6.5", + "memoffset 0.8.0", + "num-bigint 0.4.3", "num-derive", "num-traits", "parking_lot", @@ -3931,9 +3924,9 @@ dependencies = [ "serde_json", "sha2 0.10.6", "sha3 0.10.6", - "solana-frozen-abi 1.14.13", - "solana-frozen-abi-macro 1.14.13", - "solana-sdk-macro 1.14.13", + "solana-frozen-abi 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi-macro 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk-macro 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", "tiny-bip39", "wasm-bindgen", @@ -3984,9 +3977,9 @@ dependencies = [ "serde_json", "sha2 0.10.6", "sha3 0.10.6", - "solana-frozen-abi 1.15.0", - "solana-frozen-abi-macro 1.15.0", - "solana-sdk-macro 1.15.0", + "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "thiserror", "tiny-bip39", "wasm-bindgen", @@ -4011,11 +4004,11 @@ dependencies = [ "rand 0.7.3", "rustc_version 0.4.0", "serde", - "solana-frozen-abi 1.15.0", - "solana-frozen-abi-macro 1.15.0", + "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-measure", "solana-metrics", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana_rbpf", "thiserror", ] @@ -4035,7 +4028,7 @@ dependencies = [ "serde_json", "solana-account-decoder", "solana-rpc-client-api", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "thiserror", "tokio", "tokio-stream", @@ -4063,7 +4056,7 @@ dependencies = [ "solana-metrics", "solana-net-utils", "solana-rpc-client-api", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-streamer", "solana-tpu-client", "thiserror", @@ -4097,7 +4090,7 @@ dependencies = [ "serde_json", "solana-account-decoder", "solana-rpc-client-api", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-transaction-status", "solana-version", "solana-vote-program", @@ -4118,7 +4111,7 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-transaction-status", "solana-version", "spl-token-2022", @@ -4127,9 +4120,9 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.14.13" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "390e7481c56dda2ceab2652beeda30a533e9667b34861a2eb4eec92fa1d826d7" +checksum = "73788ea1793a23a3d24d1d9ed81a64dbbdd02dac058e0e363a604135e351e670" dependencies = [ "assert_matches", "base64 0.13.1", @@ -4154,6 +4147,7 @@ dependencies = [ "memmap2", "num-derive", "num-traits", + "num_enum", "pbkdf2 0.11.0", "qstring", "rand 0.7.3", @@ -4164,13 +4158,14 @@ dependencies = [ "serde_bytes", "serde_derive", "serde_json", + "serde_with", "sha2 0.10.6", "sha3 0.10.6", - "solana-frozen-abi 1.14.13", - "solana-frozen-abi-macro 1.14.13", - "solana-logger 1.14.13", - "solana-program 1.14.13", - "solana-sdk-macro 1.14.13", + "solana-frozen-abi 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi-macro 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-logger 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-program 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk-macro 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", "uriparse", "wasm-bindgen", @@ -4218,11 +4213,11 @@ dependencies = [ "serde_with", "sha2 0.10.6", "sha3 0.10.6", - "solana-frozen-abi 1.15.0", - "solana-frozen-abi-macro 1.15.0", - "solana-logger 1.15.0", - "solana-program 1.15.0", - "solana-sdk-macro 1.15.0", + "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-logger 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "thiserror", "uriparse", "wasm-bindgen", @@ -4230,9 +4225,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.14.13" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d0acbad862093ea123f3a27364336dcb0c8373522cd6810496a34e932c56c1" +checksum = "e9e216372c12c4bd820afd02ab90564472e14e1ff609b6737e9d832749370656" dependencies = [ "bs58", "proc-macro2 1.0.50", @@ -4277,7 +4272,7 @@ dependencies = [ "rustls", "solana-metrics", "solana-perf", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "thiserror", "tokio", "x509-parser", @@ -4302,7 +4297,7 @@ dependencies = [ "solana-pubsub-client", "solana-rpc-client", "solana-rpc-client-api", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "thiserror", "tokio", ] @@ -4324,7 +4319,7 @@ dependencies = [ "serde_json", "solana-account-decoder", "solana-address-lookup-table-program", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "spl-associated-token-account", "spl-memo", "spl-token", @@ -4342,9 +4337,9 @@ dependencies = [ "semver 1.0.16", "serde", "serde_derive", - "solana-frozen-abi 1.15.0", - "solana-frozen-abi-macro 1.15.0", - "solana-sdk 1.15.0", + "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", ] [[package]] @@ -4359,20 +4354,20 @@ dependencies = [ "rustc_version 0.4.0", "serde", "serde_derive", - "solana-frozen-abi 1.15.0", - "solana-frozen-abi-macro 1.15.0", + "solana-frozen-abi 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", + "solana-frozen-abi-macro 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-metrics", - "solana-program 1.15.0", + "solana-program 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "solana-program-runtime", - "solana-sdk 1.15.0", + "solana-sdk 1.15.0 (git+https://github.com/blockworks-foundation/solana?branch=lite_rpc)", "thiserror", ] [[package]] name = "solana-zk-token-sdk" -version = "1.14.13" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cebca4083e982ae01583d1a590c4d679e6f648a4761364ddfb43026d2c433142" +checksum = "ffa4276fd41317c7367f665684410430c8ddae065af6e997b98a26a201ca2c1e" dependencies = [ "aes-gcm-siv", "arrayref", @@ -4392,8 +4387,8 @@ dependencies = [ "serde", "serde_json", "sha3 0.9.1", - "solana-program 1.14.13", - "solana-sdk 1.14.13", + "solana-program 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "subtle", "thiserror", "zeroize", @@ -4444,7 +4439,7 @@ dependencies = [ "borsh", "num-derive", "num-traits", - "solana-program 1.14.13", + "solana-program 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "spl-token", "spl-token-2022", "thiserror", @@ -4456,7 +4451,7 @@ version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325" dependencies = [ - "solana-program 1.14.13", + "solana-program 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4470,7 +4465,7 @@ dependencies = [ "num-derive", "num-traits", "num_enum", - "solana-program 1.14.13", + "solana-program 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", ] @@ -4485,7 +4480,7 @@ dependencies = [ "num-derive", "num-traits", "num_enum", - "solana-program 1.14.13", + "solana-program 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "solana-zk-token-sdk", "spl-memo", "spl-token", @@ -4674,9 +4669,9 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" diff --git a/Cargo.toml b/Cargo.toml index 7dbffb17..29458bc4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,4 +40,5 @@ tracing-subscriber = "0.3.16" tokio-postgres = "0.7.7" native-tls = "0.2.11" postgres-native-tls = "0.5.0" -serde_prometheus = "0.1.6" +prometheus = "0.13.3" +lazy_static = "1.4.0" diff --git a/src/block_store.rs b/src/block_store.rs index c9da7320..b9bd44c0 100644 --- a/src/block_store.rs +++ b/src/block_store.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use dashmap::DashMap; -use log::info; + use solana_rpc_client::nonblocking::rpc_client::RpcClient; use solana_sdk::commitment_config::CommitmentConfig; use tokio::sync::RwLock; @@ -92,7 +92,6 @@ impl BlockStore { block_info: BlockInformation, commitment_config: CommitmentConfig, ) { - info!("{commitment_config:?} {blockhash:?}, {block_info:?}"); // Write to block store first in order to prevent // any race condition i.e prevent some one to // ask the map what it doesn't have rn diff --git a/src/bridge.rs b/src/bridge.rs index f3b0d336..df15ddfd 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -17,6 +17,7 @@ use anyhow::bail; use log::info; use jsonrpsee::{server::ServerBuilder, types::SubscriptionResult, SubscriptionSink}; + use solana_pubsub_client::nonblocking::pubsub_client::PubsubClient; use solana_rpc_client::{nonblocking::rpc_client::RpcClient, rpc_client::SerializableTransaction}; use solana_rpc_client_api::{ @@ -82,6 +83,7 @@ impl LiteBridge { tx_send_interval: Duration, clean_interval: Duration, enable_postgres: bool, + prometheus_addr: T, ) -> anyhow::Result>>> { let (postgres, postgres_send) = if enable_postgres { let (postgres_send, postgres_recv) = mpsc::unbounded_channel(); @@ -104,9 +106,8 @@ impl LiteBridge { postgres_send.clone(), ); - let metrics_capture = MetricsCapture::new(self.tx_sender.clone()); - let prometheus_sync = PrometheusSync::new(metrics_capture.clone()).sync(); - let metrics_capture = metrics_capture.capture(); + let metrics_capture = MetricsCapture::new(self.tx_sender.clone()).capture(); + let prometheus_sync = PrometheusSync.sync(prometheus_addr); let finalized_block_listener = self .block_listner diff --git a/src/cli.rs b/src/cli.rs index ab4e03c2..ff60b117 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -27,7 +27,10 @@ pub struct Args { /// interval between clean #[arg(short = 'c', long, default_value_t = DEFAULT_CLEAN_INTERVAL_MS)] pub clean_interval_ms: u64, - /// addr to postgres + /// enable logging to postgres #[arg(short = 'p', long)] pub enable_postgres: bool, + /// enable metrics to prometheus at addr + #[arg(short = 'm', long, default_value_t = String::from("[::]:9091"))] + pub prometheus_addr: String, } diff --git a/src/main.rs b/src/main.rs index 680e50f0..f1b6d570 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,6 +19,7 @@ pub async fn main() -> anyhow::Result<()> { clean_interval_ms, fanout_size, enable_postgres, + prometheus_addr, } = Args::parse(); let tx_batch_interval_ms = Duration::from_millis(tx_batch_interval_ms); @@ -34,6 +35,7 @@ pub async fn main() -> anyhow::Result<()> { tx_batch_interval_ms, clean_interval_ms, enable_postgres, + prometheus_addr, ) .await?; diff --git a/src/workers/block_listenser.rs b/src/workers/block_listenser.rs index e19c3d8a..f0d86174 100644 --- a/src/workers/block_listenser.rs +++ b/src/workers/block_listenser.rs @@ -5,6 +5,7 @@ use dashmap::DashMap; use futures::StreamExt; use jsonrpsee::SubscriptionSink; use log::info; +use prometheus::{histogram_opts, opts, register_counter, register_histogram, Counter, Histogram}; use solana_pubsub_client::nonblocking::pubsub_client::PubsubClient; use solana_rpc_client::rpc_client::SerializableTransaction; use solana_rpc_client_api::{ @@ -27,6 +28,23 @@ use crate::{ use super::{PostgresMpscSend, TxProps, TxSender}; +lazy_static::lazy_static! { + static ref TT_RECV_CON_BLOCK: Histogram = register_histogram!(histogram_opts!( + "tt_recv_con_block", + "Time to receive confirmed block from block subscribe", + )) + .unwrap(); + static ref TT_RECV_FIN_BLOCK: Histogram = register_histogram!(histogram_opts!( + "tt_recv_fin_block", + "Time to receive finalized block from block subscribe", + )) + .unwrap(); + static ref TXS_CONFIRMED: Counter = + register_counter!(opts!("txs_confirmed", "Number of Transactions Confirmed")).unwrap(); + static ref TXS_FINALIZED: Counter = + register_counter!(opts!("txs_finalized", "Number of Transactions Finalized")).unwrap(); +} + /// Background worker which listen's to new blocks /// and keeps a track of confirmed txs #[derive(Clone)] @@ -114,7 +132,19 @@ impl BlockListener { info!("Listening to {commitment:?} blocks"); - while let Some(block) = recv.as_mut().next().await { + loop { + let timer = if commitment_config.is_finalized() { + TT_RECV_FIN_BLOCK.start_timer() + } else { + TT_RECV_CON_BLOCK.start_timer() + }; + + let Some(block) = recv.as_mut().next().await else { + bail!("PubSub broke"); + }; + + timer.observe_duration(); + let slot = block.context.slot; let Some(block) = block.value.block else { @@ -177,6 +207,17 @@ impl BlockListener { let sig = tx.get_signature().to_string(); if let Some(mut tx_status) = self.tx_sender.txs_sent.get_mut(&sig) { + // + // Metrics + // + if status.is_ok() { + if commitment_config.is_finalized() { + TXS_FINALIZED.inc(); + } else { + TXS_CONFIRMED.inc(); + } + } + tx_status.value_mut().status = Some(TransactionStatus { slot, confirmations: None, @@ -220,8 +261,6 @@ impl BlockListener { } } } - - bail!("Stopped Listening to {commitment:?} blocks") }) } } diff --git a/src/workers/mod.rs b/src/workers/mod.rs index 82e2c721..0cd4d788 100644 --- a/src/workers/mod.rs +++ b/src/workers/mod.rs @@ -2,12 +2,12 @@ mod block_listenser; mod cleaner; mod metrics_capture; mod postgres; -mod prometheus; +mod prometheus_sync; mod tx_sender; pub use block_listenser::*; pub use cleaner::*; pub use metrics_capture::*; pub use postgres::*; -pub use prometheus::*; +pub use prometheus_sync::*; pub use tx_sender::*; diff --git a/src/workers/prometheus.rs b/src/workers/prometheus_sync.rs similarity index 56% rename from src/workers/prometheus.rs rename to src/workers/prometheus_sync.rs index 069de9ce..17bd3aa8 100644 --- a/src/workers/prometheus.rs +++ b/src/workers/prometheus_sync.rs @@ -1,23 +1,13 @@ -use std::collections::HashMap; - +use prometheus::{Encoder, TextEncoder}; use tokio::{ io::AsyncWriteExt, - net::{TcpListener, TcpStream}, + net::{TcpListener, TcpStream, ToSocketAddrs}, task::JoinHandle, }; -use super::MetricsCapture; - -#[derive(Clone)] -pub struct PrometheusSync { - metrics_capture: MetricsCapture, -} +pub struct PrometheusSync; impl PrometheusSync { - pub fn new(metrics_capture: MetricsCapture) -> Self { - Self { metrics_capture } - } - fn create_response(payload: &str) -> String { format!( "HTTP/1.1 200 OK\r\nContent-Length: {}\r\n\r\n{}", @@ -27,10 +17,16 @@ impl PrometheusSync { } async fn handle_stream(&self, stream: &mut TcpStream) -> anyhow::Result<()> { - let metrics = self.metrics_capture.get_metrics().await; - let metrics = serde_prometheus::to_string(&metrics, Some("literpc"), HashMap::new())?; + let mut metrics_buffer = Vec::new(); + let encoder = TextEncoder::new(); - let response = Self::create_response(&metrics); + let metric_families = prometheus::gather(); + encoder + .encode(&metric_families, &mut metrics_buffer) + .unwrap(); + + let metrics_buffer = String::from_utf8(metrics_buffer).unwrap(); + let response = Self::create_response(&metrics_buffer); stream.writable().await?; stream.write_all(response.as_bytes()).await?; @@ -40,10 +36,10 @@ impl PrometheusSync { Ok(()) } - pub fn sync(self) -> JoinHandle> { + pub fn sync(self, addr: impl ToSocketAddrs + Send + 'static) -> JoinHandle> { #[allow(unreachable_code)] tokio::spawn(async move { - let listener = TcpListener::bind("[::]:9091").await?; + let listener = TcpListener::bind(addr).await?; loop { let Ok((mut stream, _addr)) = listener.accept().await else { diff --git a/src/workers/tx_sender.rs b/src/workers/tx_sender.rs index 4760174e..836e20a4 100644 --- a/src/workers/tx_sender.rs +++ b/src/workers/tx_sender.rs @@ -7,6 +7,7 @@ use anyhow::bail; use dashmap::DashMap; use log::{info, warn}; +use prometheus::{register_counter, Counter}; use solana_transaction_status::TransactionStatus; use tokio::{ sync::mpsc::{error::TryRecvError, UnboundedReceiver}, @@ -20,6 +21,11 @@ use crate::{ use super::PostgresMpscSend; +lazy_static::lazy_static! { + static ref TXS_SENT: Counter = + register_counter!("txs_sent", "Number of transactions forwarded to tpu").unwrap(); +} + pub type WireTransaction = Vec; /// Retry transactions to a maximum of `u16` times, keep a track of confirmed transactions @@ -77,6 +83,9 @@ impl TxSender { for (sig, _) in &sigs_and_slots { txs_sent.insert(sig.to_owned(), TxProps::default()); } + // metrics + TXS_SENT.inc_by(sigs_and_slots.len() as f64); + 1 } Err(err) => { From 819724c36015a3a1161047cd714a0558d2d6cc33 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Sun, 5 Feb 2023 14:29:25 +0530 Subject: [PATCH 22/27] fix get_latest_blockhash --- src/block_store.rs | 4 ++-- src/bridge.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/block_store.rs b/src/block_store.rs index b9bd44c0..800d2cdc 100644 --- a/src/block_store.rs +++ b/src/block_store.rs @@ -60,9 +60,9 @@ impl BlockStore { pub fn get_latest_blockhash(&self, commitment_config: CommitmentConfig) -> Arc> { if commitment_config.is_finalized() { - self.latest_confirmed_blockhash.clone() - } else { self.latest_finalized_blockhash.clone() + } else { + self.latest_confirmed_blockhash.clone() } } diff --git a/src/bridge.rs b/src/bridge.rs index df15ddfd..92e84134 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -75,6 +75,7 @@ impl LiteBridge { } /// List for `JsonRpc` requests + #[allow(clippy::too_many_arguments)] pub async fn start_services( mut self, http_addr: T, From 419820cde2d0fe25cd3a1da966d7e5a5b5aad463 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Sun, 5 Feb 2023 14:32:36 +0530 Subject: [PATCH 23/27] use idomatic rust --- src/bridge.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bridge.rs b/src/bridge.rs index 92e84134..b4ef1d27 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -25,7 +25,9 @@ use solana_rpc_client_api::{ response::{Response as RpcResponse, RpcBlockhash, RpcResponseContext, RpcVersionInfo}, }; use solana_sdk::{ - commitment_config::CommitmentConfig, hash::Hash, pubkey::Pubkey, + commitment_config::{self, CommitmentConfig}, + hash::Hash, + pubkey::Pubkey, transaction::VersionedTransaction, }; use solana_transaction_status::TransactionStatus; @@ -221,11 +223,9 @@ impl LiteRpcServer for LiteBridge { &self, config: Option, ) -> crate::rpc::Result> { - let commitment_config = if let Some(RpcContextConfig { commitment, .. }) = config { - commitment.unwrap_or_default() - } else { - CommitmentConfig::default() - }; + let commitment_config = config + .map(|config| config.commitment.unwrap_or_default()) + .unwrap_or_default(); let (blockhash, BlockInformation { slot, block_height }) = self .block_store From b890ee40520d6b6b3de2e5365a442d91f917fb81 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Sun, 5 Feb 2023 14:33:24 +0530 Subject: [PATCH 24/27] cargo fix and fmt --- src/bridge.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bridge.rs b/src/bridge.rs index b4ef1d27..2d73d9f3 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -25,7 +25,7 @@ use solana_rpc_client_api::{ response::{Response as RpcResponse, RpcBlockhash, RpcResponseContext, RpcVersionInfo}, }; use solana_sdk::{ - commitment_config::{self, CommitmentConfig}, + commitment_config::{CommitmentConfig}, hash::Hash, pubkey::Pubkey, transaction::VersionedTransaction, From a20d23e924a1cb7c3d36b9f384b2c25f02e273dd Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Sun, 5 Feb 2023 15:08:17 +0530 Subject: [PATCH 25/27] reset pub_sub client --- src/bridge.rs | 12 +- src/workers/block_listenser.rs | 335 +++++++++++++++++---------------- src/workers/tx_sender.rs | 2 +- tests/workers.rs | 5 +- 4 files changed, 176 insertions(+), 178 deletions(-) diff --git a/src/bridge.rs b/src/bridge.rs index 2d73d9f3..da7f3134 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -18,16 +18,13 @@ use log::info; use jsonrpsee::{server::ServerBuilder, types::SubscriptionResult, SubscriptionSink}; -use solana_pubsub_client::nonblocking::pubsub_client::PubsubClient; use solana_rpc_client::{nonblocking::rpc_client::RpcClient, rpc_client::SerializableTransaction}; use solana_rpc_client_api::{ config::{RpcContextConfig, RpcRequestAirdropConfig, RpcSignatureStatusConfig}, response::{Response as RpcResponse, RpcBlockhash, RpcResponseContext, RpcVersionInfo}, }; use solana_sdk::{ - commitment_config::{CommitmentConfig}, - hash::Hash, - pubkey::Pubkey, + commitment_config::CommitmentConfig, hash::Hash, pubkey::Pubkey, transaction::VersionedTransaction, }; use solana_transaction_status::TransactionStatus; @@ -51,7 +48,6 @@ pub struct LiteBridge { impl LiteBridge { pub async fn new(rpc_url: String, ws_addr: String, fanout_slots: u64) -> anyhow::Result { let rpc_client = Arc::new(RpcClient::new(rpc_url.clone())); - let pub_sub_client = Arc::new(PubsubClient::new(&ws_addr).await?); let tpu_manager = Arc::new(TpuManager::new(rpc_client.clone(), ws_addr, fanout_slots).await?); @@ -60,11 +56,7 @@ impl LiteBridge { let block_store = BlockStore::new(&rpc_client).await?; - let block_listner = BlockListener::new( - pub_sub_client.clone(), - tx_sender.clone(), - block_store.clone(), - ); + let block_listner = BlockListener::new(tx_sender.clone(), block_store.clone()); Ok(Self { rpc_client, diff --git a/src/workers/block_listenser.rs b/src/workers/block_listenser.rs index f0d86174..bd0172b7 100644 --- a/src/workers/block_listenser.rs +++ b/src/workers/block_listenser.rs @@ -4,7 +4,7 @@ use anyhow::{bail, Context}; use dashmap::DashMap; use futures::StreamExt; use jsonrpsee::SubscriptionSink; -use log::info; +use log::{info, warn}; use prometheus::{histogram_opts, opts, register_counter, register_histogram, Counter, Histogram}; use solana_pubsub_client::nonblocking::pubsub_client::PubsubClient; use solana_rpc_client::rpc_client::SerializableTransaction; @@ -49,7 +49,6 @@ lazy_static::lazy_static! { /// and keeps a track of confirmed txs #[derive(Clone)] pub struct BlockListener { - pub_sub_client: Arc, tx_sender: TxSender, block_store: BlockStore, pub signature_subscribers: Arc>, @@ -67,13 +66,8 @@ pub struct BlockListnerNotificatons { } impl BlockListener { - pub fn new( - pub_sub_client: Arc, - tx_sender: TxSender, - block_store: BlockStore, - ) -> Self { + pub fn new(tx_sender: TxSender, block_store: BlockStore) -> Self { Self { - pub_sub_client, tx_sender, block_store, signature_subscribers: Default::default(), @@ -98,168 +92,183 @@ impl BlockListener { self.signature_subscribers.remove(&signature); } + pub async fn listen_from_pubsub( + self, + pubsub_client: &PubsubClient, + commitment_config: CommitmentConfig, + postgres: &Option, + ) -> anyhow::Result<()> { + let commitment = commitment_config.commitment; + + let comfirmation_status = match commitment { + CommitmentLevel::Finalized => TransactionConfirmationStatus::Finalized, + _ => TransactionConfirmationStatus::Confirmed, + }; + + info!("Subscribing to {commitment:?} blocks"); + + let (mut recv, _) = pubsub_client + .block_subscribe( + RpcBlockSubscribeFilter::All, + Some(RpcBlockSubscribeConfig { + commitment: Some(commitment_config), + encoding: None, + transaction_details: Some(solana_transaction_status::TransactionDetails::Full), + show_rewards: None, + max_supported_transaction_version: None, + }), + ) + .await + .context("Error calling block_subscribe")?; + + info!("Listening to {commitment:?} blocks"); + + loop { + let timer = if commitment_config.is_finalized() { + TT_RECV_FIN_BLOCK.start_timer() + } else { + TT_RECV_CON_BLOCK.start_timer() + }; + + let Some(block) = recv.as_mut().next().await else { + bail!("PubSub broke"); + }; + + timer.observe_duration(); + + let slot = block.context.slot; + + let Some(block) = block.value.block else { + continue; + }; + + let Some(block_height) = block.block_height else { + continue; + }; + + let blockhash = block.blockhash; + + let Some(transactions) = block.transactions else { + continue; + }; + + let parent_slot = block.parent_slot; + + self.block_store + .add_block( + blockhash.clone(), + BlockInformation { slot, block_height }, + commitment_config, + ) + .await; + + if let Some(postgres) = &postgres { + let Some(rewards) = block.rewards else { + continue; + }; + + let Some(leader_reward) = rewards + .iter() + .find(|reward| Some(RewardType::Fee) == reward.reward_type) else { + continue; + }; + + let _leader_id = &leader_reward.pubkey; + + postgres + .send(PostgresMsg::PostgresBlock(PostgresBlock { + slot: slot as i64, + leader_id: 0, //FIX: + parent_slot: parent_slot as i64, + })) + .expect("Error sending block to postgres service"); + } + + for tx in transactions { + let Some(UiTransactionStatusMeta { err, status, compute_units_consumed ,.. }) = tx.meta else { + info!("tx with no meta"); + continue; + }; + + let Some(tx) = tx.transaction.decode() else { + info!("unable to decode tx"); + continue; + }; + + let sig = tx.get_signature().to_string(); + + if let Some(mut tx_status) = self.tx_sender.txs_sent.get_mut(&sig) { + // + // Metrics + // + if status.is_ok() { + if commitment_config.is_finalized() { + TXS_FINALIZED.inc(); + } else { + TXS_CONFIRMED.inc(); + } + } + + tx_status.value_mut().status = Some(TransactionStatus { + slot, + confirmations: None, + status, + err: err.clone(), + confirmation_status: Some(comfirmation_status.clone()), + }); + + // + // Write to postgres + // + if let Some(postgres) = &postgres { + let cu_consumed = match compute_units_consumed { + OptionSerializer::Some(cu_consumed) => Some(cu_consumed as i64), + _ => None, + }; + + postgres + .send(PostgresMsg::PostgresUpdateTx( + PostgresUpdateTx { + processed_slot: slot as i64, + cu_consumed, + cu_requested: None, //TODO: cu requested + }, + sig.clone(), + )) + .unwrap(); + } + }; + + // subscribers + if let Some((_sig, mut sink)) = self.signature_subscribers.remove(&sig) { + // none if transaction succeeded + sink.send(&RpcResponse { + context: RpcResponseContext { + slot, + api_version: None, + }, + value: serde_json::json!({ "err": err }), + })?; + } + } + } + } + pub fn listen( self, commitment_config: CommitmentConfig, postgres: Option, ) -> JoinHandle> { tokio::spawn(async move { - let commitment = commitment_config.commitment; - - let comfirmation_status = match commitment { - CommitmentLevel::Finalized => TransactionConfirmationStatus::Finalized, - _ => TransactionConfirmationStatus::Confirmed, - }; - - info!("Subscribing to {commitment:?} blocks"); - - let (mut recv, _) = self - .pub_sub_client - .block_subscribe( - RpcBlockSubscribeFilter::All, - Some(RpcBlockSubscribeConfig { - commitment: Some(commitment_config), - encoding: None, - transaction_details: Some( - solana_transaction_status::TransactionDetails::Full, - ), - show_rewards: None, - max_supported_transaction_version: None, - }), - ) - .await - .context("Error calling block_subscribe")?; - - info!("Listening to {commitment:?} blocks"); - loop { - let timer = if commitment_config.is_finalized() { - TT_RECV_FIN_BLOCK.start_timer() - } else { - TT_RECV_CON_BLOCK.start_timer() - }; - - let Some(block) = recv.as_mut().next().await else { - bail!("PubSub broke"); - }; - - timer.observe_duration(); - - let slot = block.context.slot; - - let Some(block) = block.value.block else { - continue; - }; - - let Some(block_height) = block.block_height else { - continue; - }; - - let blockhash = block.blockhash; - - let Some(transactions) = block.transactions else { - continue; - }; - - let parent_slot = block.parent_slot; - - self.block_store - .add_block( - blockhash.clone(), - BlockInformation { slot, block_height }, - commitment_config, - ) - .await; - - if let Some(postgres) = &postgres { - let Some(rewards) = block.rewards else { - continue; - }; - - let Some(leader_reward) = rewards - .iter() - .find(|reward| Some(RewardType::Fee) == reward.reward_type) else { - continue; - }; - - let _leader_id = &leader_reward.pubkey; - - postgres - .send(PostgresMsg::PostgresBlock(PostgresBlock { - slot: slot as i64, - leader_id: 0, //FIX: - parent_slot: parent_slot as i64, - })) - .expect("Error sending block to postgres service"); - } - - for tx in transactions { - let Some(UiTransactionStatusMeta { err, status, compute_units_consumed ,.. }) = tx.meta else { - info!("tx with no meta"); - continue; - }; - - let Some(tx) = tx.transaction.decode() else { - info!("unable to decode tx"); - continue; - }; - - let sig = tx.get_signature().to_string(); - - if let Some(mut tx_status) = self.tx_sender.txs_sent.get_mut(&sig) { - // - // Metrics - // - if status.is_ok() { - if commitment_config.is_finalized() { - TXS_FINALIZED.inc(); - } else { - TXS_CONFIRMED.inc(); - } - } - - tx_status.value_mut().status = Some(TransactionStatus { - slot, - confirmations: None, - status, - err: err.clone(), - confirmation_status: Some(comfirmation_status.clone()), - }); - - // - // Write to postgres - // - if let Some(postgres) = &postgres { - let cu_consumed = match compute_units_consumed { - OptionSerializer::Some(cu_consumed) => Some(cu_consumed as i64), - _ => None, - }; - - postgres - .send(PostgresMsg::PostgresUpdateTx( - PostgresUpdateTx { - processed_slot: slot as i64, - cu_consumed, - cu_requested: None, //TODO: cu requested - }, - sig.clone(), - )) - .unwrap(); - } - }; - - // subscribers - if let Some((_sig, mut sink)) = self.signature_subscribers.remove(&sig) { - // none if transaction succeeded - sink.send(&RpcResponse { - context: RpcResponseContext { - slot, - api_version: None, - }, - value: serde_json::json!({ "err": err }), - })?; - } - } + let ws_addr = &self.tx_sender.tpu_manager.ws_addr; + let pub_sub_client = PubsubClient::new(ws_addr).await?; + let err = self + .clone() + .listen_from_pubsub(&pub_sub_client, commitment_config, &postgres) + .await + .unwrap_err(); + warn!("{commitment_config:?} Block Subscribe error {err}"); } }) } diff --git a/src/workers/tx_sender.rs b/src/workers/tx_sender.rs index 836e20a4..318bfdd8 100644 --- a/src/workers/tx_sender.rs +++ b/src/workers/tx_sender.rs @@ -34,7 +34,7 @@ pub struct TxSender { /// Tx(s) forwarded to tpu pub txs_sent: Arc>, /// TpuClient to call the tpu port - tpu_manager: Arc, + pub tpu_manager: Arc, } /// Transaction Properties diff --git a/tests/workers.rs b/tests/workers.rs index d1dd5c08..6210dfe4 100644 --- a/tests/workers.rs +++ b/tests/workers.rs @@ -10,7 +10,6 @@ use lite_rpc::{ DEFAULT_LITE_RPC_ADDR, DEFAULT_RPC_ADDR, DEFAULT_TX_BATCH_INTERVAL_MS, DEFAULT_TX_BATCH_SIZE, DEFAULT_WS_ADDR, }; -use solana_pubsub_client::nonblocking::pubsub_client::PubsubClient; use solana_rpc_client::nonblocking::rpc_client::RpcClient; use solana_sdk::commitment_config::CommitmentConfig; @@ -33,12 +32,10 @@ async fn send_and_confirm_txs() { .unwrap(), ); - let pub_sub_client = Arc::new(PubsubClient::new(DEFAULT_WS_ADDR).await.unwrap()); - let tx_sender = TxSender::new(tpu_client); let block_store = BlockStore::new(&rpc_client).await.unwrap(); - let block_listener = BlockListener::new(pub_sub_client.clone(), tx_sender.clone(), block_store); + let block_listener = BlockListener::new(tx_sender.clone(), block_store); let (tx_send, tx_recv) = mpsc::unbounded_channel(); From 4ada8d864f6981ec774dea0aa56a2077e733462b Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Sun, 5 Feb 2023 15:43:29 +0530 Subject: [PATCH 26/27] more metriccs --- src/bridge.rs | 32 +++++++++++++++++++++++++ src/workers/block_listenser.rs | 44 ++++++++++++++++++++++++++-------- 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/src/bridge.rs b/src/bridge.rs index da7f3134..6c39f3d2 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -18,6 +18,7 @@ use log::info; use jsonrpsee::{server::ServerBuilder, types::SubscriptionResult, SubscriptionSink}; +use prometheus::{opts, register_counter, Counter}; use solana_rpc_client::{nonblocking::rpc_client::RpcClient, rpc_client::SerializableTransaction}; use solana_rpc_client_api::{ config::{RpcContextConfig, RpcRequestAirdropConfig, RpcSignatureStatusConfig}, @@ -34,6 +35,24 @@ use tokio::{ task::JoinHandle, }; +lazy_static::lazy_static! { + static ref RPC_SEND_TX: Counter = + register_counter!(opts!("rpc_send_tx", "RPC call send transaction")).unwrap(); + static ref RPC_GET_LATEST_BLOCKHASH: Counter = + register_counter!(opts!("rpc_get_latest_blockhash", "RPC call to get latest block hash")).unwrap(); + static ref RPC_IS_BLOCKHASH_VALID: Counter = + register_counter!(opts!("rpc_is_blockhash_valid", "RPC call to check if blockhash is vali calld")).unwrap(); + static ref RPC_GET_SIGNATURE_STATUSES: Counter = + register_counter!(opts!("rpc_get_signature_statuses", "RPC call to get signature statuses")).unwrap(); + static ref RPC_GET_VERSION: Counter = + register_counter!(opts!("rpc_get_version", "RPC call to version")).unwrap(); + static ref RPC_REQUEST_AIRDROP: Counter = + register_counter!(opts!("rpc_airdrop", "RPC call to request airdrop")).unwrap(); + static ref RPC_SIGNATURE_SUBSCRIBE: Counter = + register_counter!(opts!("rpc_signature_subscribe", "RPC call to subscribe to signature")).unwrap(); + +} + /// A bridge between clients and tpu pub struct LiteBridge { pub rpc_client: Arc, @@ -174,6 +193,8 @@ impl LiteRpcServer for LiteBridge { tx: String, send_transaction_config: Option, ) -> crate::rpc::Result { + RPC_SEND_TX.inc(); + let SendTransactionConfig { encoding, max_retries: _, @@ -215,6 +236,8 @@ impl LiteRpcServer for LiteBridge { &self, config: Option, ) -> crate::rpc::Result> { + RPC_GET_LATEST_BLOCKHASH.inc(); + let commitment_config = config .map(|config| config.commitment.unwrap_or_default()) .unwrap_or_default(); @@ -241,6 +264,8 @@ impl LiteRpcServer for LiteBridge { blockhash: String, config: Option, ) -> crate::rpc::Result> { + RPC_IS_BLOCKHASH_VALID.inc(); + let commitment = config.unwrap_or_default().commitment.unwrap_or_default(); let commitment = CommitmentConfig { commitment }; @@ -283,6 +308,8 @@ impl LiteRpcServer for LiteBridge { sigs: Vec, _config: Option, ) -> crate::rpc::Result>>> { + RPC_GET_SIGNATURE_STATUSES.inc(); + let sig_statuses = sigs .iter() .map(|sig| { @@ -308,6 +335,8 @@ impl LiteRpcServer for LiteBridge { } fn get_version(&self) -> crate::rpc::Result { + RPC_GET_VERSION.inc(); + let version = solana_version::Version::default(); Ok(RpcVersionInfo { solana_core: version.to_string(), @@ -321,6 +350,8 @@ impl LiteRpcServer for LiteBridge { lamports: u64, config: Option, ) -> crate::rpc::Result { + RPC_REQUEST_AIRDROP.inc(); + let pubkey = match Pubkey::from_str(&pubkey_str) { Ok(pubkey) => pubkey, Err(err) => { @@ -352,6 +383,7 @@ impl LiteRpcServer for LiteBridge { signature: String, _commitment_config: CommitmentConfig, ) -> SubscriptionResult { + RPC_SIGNATURE_SUBSCRIBE.inc(); sink.accept()?; self.block_listner.signature_subscribe(signature, sink); Ok(()) diff --git a/src/workers/block_listenser.rs b/src/workers/block_listenser.rs index bd0172b7..78ff4a8b 100644 --- a/src/workers/block_listenser.rs +++ b/src/workers/block_listenser.rs @@ -39,6 +39,14 @@ lazy_static::lazy_static! { "Time to receive finalized block from block subscribe", )) .unwrap(); + static ref FIN_BLOCKS_RECV: Counter = + register_counter!(opts!("fin_blocks_recv", "Number of Finalized Blocks Received")).unwrap(); + static ref CON_BLOCKS_RECV: Counter = + register_counter!(opts!("con_blocks_recv", "Number of Confirmed Blocks Received")).unwrap(); + static ref INCOMPLETE_FIN_BLOCKS_RECV: Counter = + register_counter!(opts!("incomplete_fin_blocks_recv", "Number of Incomplete Finalized Blocks Received")).unwrap(); + static ref INCOMPLETE_CON_BLOCKS_RECV: Counter = + register_counter!(opts!("incomplete_con_blocks_recv", "Number of Incomplete Confirmed Blocks Received")).unwrap(); static ref TXS_CONFIRMED: Counter = register_counter!(opts!("txs_confirmed", "Number of Transactions Confirmed")).unwrap(); static ref TXS_FINALIZED: Counter = @@ -92,6 +100,14 @@ impl BlockListener { self.signature_subscribers.remove(&signature); } + fn increment_invalid_block_metric(commitment_config: CommitmentConfig) { + if commitment_config.is_finalized() { + INCOMPLETE_FIN_BLOCKS_RECV.inc(); + } else { + INCOMPLETE_CON_BLOCKS_RECV.inc(); + } + } + pub async fn listen_from_pubsub( self, pubsub_client: &PubsubClient, @@ -131,27 +147,35 @@ impl BlockListener { }; let Some(block) = recv.as_mut().next().await else { - bail!("PubSub broke"); - }; + bail!("PubSub broke"); + }; timer.observe_duration(); + if commitment_config.is_finalized() { + FIN_BLOCKS_RECV.inc(); + } else { + CON_BLOCKS_RECV.inc(); + }; + let slot = block.context.slot; let Some(block) = block.value.block else { - continue; - }; + Self::increment_invalid_block_metric(commitment_config); + continue; + }; let Some(block_height) = block.block_height else { - continue; - }; - - let blockhash = block.blockhash; + Self::increment_invalid_block_metric(commitment_config); + continue; + }; let Some(transactions) = block.transactions else { - continue; - }; + Self::increment_invalid_block_metric(commitment_config); + continue; + }; + let blockhash = block.blockhash; let parent_slot = block.parent_slot; self.block_store From 008310a2860942411ae1453d04d34a40254627f3 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Sun, 5 Feb 2023 16:01:55 +0530 Subject: [PATCH 27/27] cargo upgrade and fmt --- Cargo.lock | 94 ++++++++++++++++++++++++------------------------ Cargo.toml | 4 +-- bench/Cargo.toml | 4 +-- 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f55bea5a..fe8015ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -100,9 +100,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" +checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" [[package]] name = "ark-bn254" @@ -235,7 +235,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", "synstructure", @@ -247,7 +247,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -297,7 +297,7 @@ version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -451,7 +451,7 @@ dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "syn 1.0.107", ] @@ -461,7 +461,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -472,7 +472,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -557,7 +557,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -673,7 +673,7 @@ checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -773,7 +773,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a4f51209740b5e1589e702b3044cdd4562cef41b6da404904192ffffb852d62" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -953,7 +953,7 @@ dependencies = [ "cc", "codespan-reporting", "once_cell", - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "scratch", "syn 1.0.107", @@ -971,7 +971,7 @@ version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bbeb29798b407ccd82a3324ade1a7286e0d29851475990b612670f6f5124d2" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -994,7 +994,7 @@ checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "strsim", "syn 1.0.107", @@ -1065,7 +1065,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -1116,7 +1116,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -1221,7 +1221,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -1396,7 +1396,7 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -2025,7 +2025,7 @@ checksum = "baa6da1e4199c10d7b1d0a6e5e8bd8e55f351163b6f4b3cbb044672a69bd4c1c" dependencies = [ "heck", "proc-macro-crate 1.3.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -2447,7 +2447,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -2520,7 +2520,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2be1598bf1c313dcdd12092e3f1920f463462525a21b7b4e11b4168353d0123e" dependencies = [ "proc-macro-crate 1.3.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -2573,7 +2573,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -2729,7 +2729,7 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -2861,7 +2861,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", "version_check", @@ -2873,7 +2873,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "version_check", ] @@ -2889,9 +2889,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" dependencies = [ "unicode-ident", ] @@ -2991,7 +2991,7 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", ] [[package]] @@ -3350,7 +3350,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -3429,9 +3429,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718dc5fff5b36f99093fc49b280cfc96ce6fc824317783bff5a1fed0c7a64819" +checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" dependencies = [ "serde", ] @@ -3442,16 +3442,16 @@ version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] [[package]] name = "serde_json" -version = "1.0.91" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" +checksum = "7434af0dc1cbd59268aa98b4c22c131c0584d2232f6fb166efb993e2832e896a" dependencies = [ "itoa 1.0.5", "ryu", @@ -3487,7 +3487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1966009f3c05f095697c537312f5415d1e3ed31ce0a56942bac4c771c5c335e" dependencies = [ "darling", - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -3772,7 +3772,7 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7084605b674cf344312c3a2a9c0de05126c2ff4d3d77cc6746f236ca3c4cb53" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "rustc_version 0.4.0", "syn 1.0.107", @@ -3783,7 +3783,7 @@ name = "solana-frozen-abi-macro" version = "1.15.0" source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "rustc_version 0.4.0", "syn 1.0.107", @@ -4230,7 +4230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9e216372c12c4bd820afd02ab90564472e14e1ff609b6737e9d832749370656" dependencies = [ "bs58", - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "rustversion", "syn 1.0.107", @@ -4242,7 +4242,7 @@ version = "1.15.0" source = "git+https://github.com/blockworks-foundation/solana?branch=lite_rpc#04daf93c153bdce7f461ad284843c21c63ca621f" dependencies = [ "bs58", - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "rustversion", "syn 1.0.107", @@ -4526,7 +4526,7 @@ version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "unicode-ident", ] @@ -4537,7 +4537,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", "unicode-xid 0.2.4", @@ -4587,7 +4587,7 @@ version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -4699,7 +4699,7 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -4859,7 +4859,7 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", ] @@ -5107,7 +5107,7 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", "wasm-bindgen-shared", @@ -5141,7 +5141,7 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", "wasm-bindgen-backend", @@ -5346,7 +5346,7 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.51", "quote 1.0.23", "syn 1.0.107", "synstructure", diff --git a/Cargo.toml b/Cargo.toml index 29458bc4..d8e42770 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ solana-pubsub-client= { git = "https://github.com/blockworks-foundation/solana", solana-transaction-status = { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } solana-version= { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } serde = { version = "1.0.152", features = ["derive"] } -serde_json = "1.0.91" +serde_json = "1.0.92" tokio = { version = "1.25.0", features = ["full"]} bincode = "1.3.3" bs58 = "0.4.0" @@ -30,7 +30,7 @@ base64 = "0.21.0" thiserror = "1.0.38" futures = "0.3.26" bytes = "1.4.0" -anyhow = "1.0.68" +anyhow = "1.0.69" log = "0.4.17" clap = { version = "4.1.4", features = ["derive"] } dashmap = "5.4.0" diff --git a/bench/Cargo.toml b/bench/Cargo.toml index e7d577b9..e32a927f 100644 --- a/bench/Cargo.toml +++ b/bench/Cargo.toml @@ -7,9 +7,9 @@ edition = "2021" solana-sdk = { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } solana-rpc-client = { git = "https://github.com/blockworks-foundation/solana", branch="lite_rpc" } log = "0.4.17" -anyhow = "1.0.68" +anyhow = "1.0.69" serde = "1.0.152" -serde_json = "1.0.91" +serde_json = "1.0.92" csv = "1.1.6" clap = { version = "4.1.4", features = ["derive"] } tokio = { version = "1.25.0", features = ["full", "fs"]}