From ad4e97f391a666092c04e7a5b25c8c3080603e4b Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Wed, 12 Jun 2024 18:57:18 +0200 Subject: [PATCH 1/6] update solana from 1.17.28 -> 1.18.9 --- Cargo.lock | 279 +++++++++++++++++++++++++++++++---------------------- Cargo.toml | 32 +++--- 2 files changed, 180 insertions(+), 131 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34ef03e7..f01422c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -76,9 +76,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.5" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom 0.2.12", @@ -574,7 +574,7 @@ dependencies = [ "bincode", "clap 4.5.4", "csv", - "dashmap 5.5.3", + "dashmap", "dirs", "futures", "itertools 0.10.5", @@ -689,6 +689,16 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "borsh" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" +dependencies = [ + "borsh-derive 1.5.1", + "cfg_aliases", +] + [[package]] name = "borsh-derive" version = "0.9.3" @@ -715,6 +725,20 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "borsh-derive" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" +dependencies = [ + "once_cell", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.55", + "syn_derive", +] + [[package]] name = "borsh-derive-internal" version = "0.9.3" @@ -866,6 +890,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.37" @@ -1223,7 +1253,7 @@ dependencies = [ "anyhow", "bincode", "clap 4.5.4", - "dashmap 5.5.3", + "dashmap", "futures", "itertools 0.10.5", "log", @@ -1273,16 +1303,6 @@ dependencies = [ "syn 2.0.55", ] -[[package]] -name = "dashmap" -version = "4.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" -dependencies = [ - "cfg-if", - "num_cpus", -] - [[package]] name = "dashmap" version = "5.5.3" @@ -1793,7 +1813,7 @@ dependencies = [ [[package]] name = "geyser-grpc-connector" version = "0.10.6+yellowstone.1.13" -source = "git+https://github.com/blockworks-foundation/geyser-grpc-connector.git?tag=v0.10.6+yellowstone.1.13+solana.1.17.28#20f29c1e21e1682f124c0a3386cd4a85b1854f01" +source = "git+https://github.com/blockworks-foundation/geyser-grpc-connector.git?tag=v0.10.6+yellowstone.1.13+solana.1.18.9#bb6aa57f0f707ca2c4c5b84c5ead4a60658f7f69" dependencies = [ "anyhow", "async-stream", @@ -1926,7 +1946,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.5", + "ahash 0.8.11", ] [[package]] @@ -2583,7 +2603,7 @@ dependencies = [ "chrono", "clap 4.5.4", "const_env", - "dashmap 5.5.3", + "dashmap", "dotenv", "futures", "futures-util", @@ -3372,6 +3392,29 @@ dependencies = [ "toml_edit 0.21.1", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" version = "1.0.79" @@ -4250,9 +4293,9 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4e29f060cabd0e1bd90a63f8e1517ddd3365d3dc2eaa05f9a9fa542f4adeaaa" +checksum = "6c5f49893e9e7cd1a45869e03ad6d767666544e47aa39cff5bcfd10c9b156177" dependencies = [ "Inflector", "base64 0.21.7", @@ -4275,14 +4318,14 @@ dependencies = [ [[package]] name = "solana-address-lookup-table-program" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a93d1c1a0c13de20e13a0c9bd7275b00bb901b8b7c55424fea98f71cb37778" +checksum = "3602b15a5c70a16cac6008d3556098b7990c5ab72b047a996f5ea4e988871975" dependencies = [ "bincode", "bytemuck", "log", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits 0.2.18", "rustc_version", "serde", @@ -4296,9 +4339,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e5cdc0ae0c8ae79c39a4a362066d0d61764bc7ea7e033961fd7510fd24da2a" +checksum = "ce8528b2853d64e0b27889948e9f41b264d758074be9d9b8ba4e0ddce7c476dd" dependencies = [ "chrono", "clap 2.34.0", @@ -4313,13 +4356,13 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e2301c2af7e5a1dba0855f710329a2bb993829ed9fdf8f6207d02ee6fc54a4" +checksum = "914b2b8e68c4b57a916400a77a66078a96b2914d7b218572ef8dff5a84e48ea2" dependencies = [ "async-trait", "bincode", - "dashmap 4.0.2", + "dashmap", "futures", "futures-util", "indexmap 2.2.6", @@ -4346,9 +4389,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595118948b966b110aad3f9d8d8464958abe379ecfa7a813b4fc82659c8259bc" +checksum = "617228f9569238e544b526c422b632de368a5ce748a7af04f7f762bd937f42f3" dependencies = [ "bincode", "chrono", @@ -4360,9 +4403,9 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d363d6bb43e618b6010b47c2eb0579777ce4ed388ca15b84a610a738edf0b97e" +checksum = "cec06c0772e0ebc54d22626ddb433eb798404fdc21b0175ac504f5fff4e50612" dependencies = [ "async-trait", "bincode", @@ -4382,17 +4425,13 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96734b05823c8b515f8e3cc02641a27aee2c9760b1a43c74cb20f2a1ab0ab76c" +checksum = "cc46edad65d122c8b8634aa9ad11276a804c1aa2404755577fdfdea67484b620" dependencies = [ - "ahash 0.8.5", - "blake3", "block-buffer 0.10.4", "bs58", "bv", - "byteorder", - "cc", "either", "generic-array", "im", @@ -4403,7 +4442,6 @@ dependencies = [ "serde", "serde_bytes", "serde_derive", - "serde_json", "sha2 0.10.8", "solana-frozen-abi-macro", "subtle", @@ -4412,9 +4450,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a0f1291a464fd046135d019d57a81be165ee3d23aa7df880b47dac683a0582a" +checksum = "c71c603d2203da423cfd8862572ffca7165268e76cab181035f50d106c3710eb" dependencies = [ "proc-macro2", "quote", @@ -4433,7 +4471,7 @@ dependencies = [ "bs58", "bytes", "chrono", - "dashmap 5.5.3", + "dashmap", "futures", "itertools 0.10.5", "lazy_static", @@ -4473,7 +4511,7 @@ dependencies = [ "bs58", "bytes", "chrono", - "dashmap 5.5.3", + "dashmap", "futures", "itertools 0.10.5", "lazy_static", @@ -4516,7 +4554,7 @@ dependencies = [ "bs58", "bytes", "chrono", - "dashmap 5.5.3", + "dashmap", "futures", "itertools 0.10.5", "lazy_static", @@ -4584,7 +4622,7 @@ dependencies = [ "bincode", "bytes", "chrono", - "dashmap 5.5.3", + "dashmap", "futures", "futures-util", "itertools 0.10.5", @@ -4620,7 +4658,7 @@ dependencies = [ "bs58", "bytes", "chrono", - "dashmap 5.5.3", + "dashmap", "derive_more", "futures", "geyser-grpc-connector", @@ -4662,7 +4700,7 @@ dependencies = [ "bs58", "bytes", "chrono", - "dashmap 5.5.3", + "dashmap", "futures", "itertools 0.10.5", "log", @@ -4690,7 +4728,7 @@ dependencies = [ name = "solana-lite-rpc-prioritization-fees" version = "0.2.4" dependencies = [ - "dashmap 5.5.3", + "dashmap", "itertools 0.10.5", "jsonrpsee", "lazy_static", @@ -4717,7 +4755,7 @@ dependencies = [ "bytes", "chrono", "clap 4.5.4", - "dashmap 5.5.3", + "dashmap", "dotenv", "futures", "itertools 0.10.5", @@ -4758,7 +4796,7 @@ dependencies = [ "clap 4.5.4", "countmap", "crossbeam-channel", - "dashmap 5.5.3", + "dashmap", "dotenv", "futures", "itertools 0.10.5", @@ -4799,7 +4837,7 @@ dependencies = [ "chrono", "countmap", "crossbeam-channel", - "dashmap 5.5.3", + "dashmap", "futures", "itertools 0.10.5", "lazy_static", @@ -4837,7 +4875,7 @@ dependencies = [ "bs58", "bytes", "chrono", - "dashmap 5.5.3", + "dashmap", "derive_more", "futures", "itertools 0.10.5", @@ -4857,9 +4895,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5977c8f24b83cf50e7139ffdb25d70bad6a177f18ccc79ca2293d6a987fa81c" +checksum = "f5b3eef85d82c2c3030acb1d3272d77984d118d2a026d9b1a2cecc6e4c6602eb" dependencies = [ "env_logger", "lazy_static", @@ -4868,9 +4906,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a39ef01b2c65552d05013b2642ffd73258f2c80e3a59e44c499762047df9456" +checksum = "bd072023ab870dcb7d524980d9481317bfd29c1dfd74a067747c8d1d249d1075" dependencies = [ "log", "solana-sdk", @@ -4878,9 +4916,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad30ff3775412f2929d440446aef8b070676920bc5df495ea6398a8f28ce91f" +checksum = "6f594ca2a2698983b515580925d10be20b079617154bbed07d6cd455d1661b90" dependencies = [ "crossbeam-channel", "gethostname", @@ -4893,9 +4931,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafd5178a38a039e12c14780f1b6a74f1e672d62357343e0aee6d0fc7e5bd18" +checksum = "e632ad2071b8c911baf873403273c574bb11da95947e2f56db4e53ef06b771fe" dependencies = [ "bincode", "clap 3.2.25", @@ -4915,11 +4953,11 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d6293cddcc98ae092d00f43f741405da30aa083acb96666606130810b064f3" +checksum = "e3012434718bf3e76ef46cbf3be98a2de877afe7bff6571232d64cc67dce219a" dependencies = [ - "ahash 0.8.5", + "ahash 0.8.11", "bincode", "bv", "caps", @@ -4944,9 +4982,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6412447793f8a3ef7526655906728325093b472e481791ac5c584e8d272166dc" +checksum = "760e9e923050f30f03a159aec9ba1fe09ae7c7494ebd8ba74dc5b7429b11085b" dependencies = [ "ark-bn254", "ark-ec", @@ -4958,6 +4996,7 @@ dependencies = [ "blake3", "borsh 0.10.3", "borsh 0.9.3", + "borsh 1.5.1", "bs58", "bv", "bytemuck", @@ -4975,7 +5014,7 @@ dependencies = [ "log", "memoffset 0.9.1", "num-bigint 0.4.4", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits 0.2.18", "parking_lot", "rand 0.8.5", @@ -4998,9 +5037,9 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1977e741a6793fca27413507457d797df0f41bc0ae634247d112bc77ab2b0325" +checksum = "a61b65be846413bc504ecae468b6a3fa91b1b37631c80074c41ada8cdc36d165" dependencies = [ "base64 0.21.7", "bincode", @@ -5009,7 +5048,7 @@ dependencies = [ "itertools 0.10.5", "libc", "log", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits 0.2.18", "percentage", "rand 0.8.5", @@ -5026,9 +5065,9 @@ dependencies = [ [[package]] name = "solana-pubsub-client" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad21dd5d6fe09116dbc29aec279b7cf08d250b564899dc87437bd780ed26290" +checksum = "4173029a0e3a20930791886dce92c1a6d293a59754e418ac68547f3e14a8f025" dependencies = [ "crossbeam-channel", "futures-util", @@ -5051,9 +5090,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6201869768fe133ce9b8088e4f718f53ff164b8e5df3d0d46a6563a22545924f" +checksum = "8ae1b9224efc32579fe61a9e06dc8efb2a3cd167c458091cc093086304441285" dependencies = [ "async-mutex", "async-trait", @@ -5078,9 +5117,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f100d0c3214d67bb847a1eefc7079f6bb755534266423f4c994ad3b40c685ed" +checksum = "9460642bcb89090dcc15ecf11b6c4a1994c538ba49a4c5d99023365600631009" dependencies = [ "lazy_static", "num_cpus", @@ -5088,14 +5127,14 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3328c891079086b408a04e701470a346d517c9c51c0a96f2f166f616a3e1c3c8" +checksum = "c3de3b65d0fdbf0b2de6dc9aecac03d79ea7ef11c29efbdd67bf17a13d061a95" dependencies = [ "console", "dialoguer", "log", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits 0.2.18", "parking_lot", "qstring", @@ -5107,9 +5146,9 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfacf1163a375d98c29779a03ba278b2ef43494f77e33826a33f9460563c0887" +checksum = "b27d16eaebd5889c4dd873d715be0bad4651a0bc2509ba99ec6fc7d3b3416278" dependencies = [ "async-trait", "base64 0.21.7", @@ -5133,9 +5172,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fab293a88113511e66607d76bd027edfe0b1372b467fd76bbb5af03448539a2" +checksum = "d82323f7b130105a4789101b5e7d97142110774ee06aa84346effa661898d407" dependencies = [ "base64 0.21.7", "bs58", @@ -5155,9 +5194,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e43cb51374a6ec8fd401b3387334ef93e04f6d8ae87bbb29892aff42aeb1061" +checksum = "092867e337f366d1b719d28b4e02cffff4734cbbf9945daf5f172715db378e2c" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -5168,15 +5207,15 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de1ce8848de4198f9bc7e4574252be02b1ed86ecbc2fff506780d5f8d6e4c4a8" +checksum = "1788023924ebb072288868f8b4b72f5459c1ff653238d769700da9c8043a8aea" dependencies = [ "assert_matches", "base64 0.21.7", "bincode", "bitflags 2.5.0", - "borsh 0.10.3", + "borsh 1.5.1", "bs58", "bytemuck", "byteorder", @@ -5193,9 +5232,9 @@ dependencies = [ "libsecp256k1", "log", "memmap2", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits 0.2.18", - "num_enum 0.6.1", + "num_enum 0.7.2", "pbkdf2 0.11.0", "qstring", "qualifier_attr", @@ -5210,6 +5249,7 @@ dependencies = [ "serde_with", "sha2 0.10.8", "sha3 0.10.8", + "siphasher", "solana-frozen-abi", "solana-frozen-abi-macro", "solana-logger", @@ -5222,9 +5262,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cc46bbda0a5472d8d0a4c846b22941436ac45c31456d3e885a387a5f264f7" +checksum = "6f3b24f46820e8912b81719a828a3d05f4fbd2f6afdc13826b0327df065ab795" dependencies = [ "bs58", "proc-macro2", @@ -5241,9 +5281,9 @@ checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" [[package]] name = "solana-streamer" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f02b475fc20c55ebbcfa5638ff93f9b780414cc6185e3a6d0992bca0ae81ee" +checksum = "7403972b4233b87598c0a8e8fac26db549f8cb18076d385b8ef8deb1e36a6bc3" dependencies = [ "async-channel", "bytes", @@ -5263,7 +5303,6 @@ dependencies = [ "rand 0.8.5", "rcgen 0.10.0", "rustls", - "smallvec", "solana-metrics", "solana-perf", "solana-sdk", @@ -5274,9 +5313,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6ce2304764b8bb699db734fde9cd19ace038d3895d828a557ea0ec2a9e0ecd" +checksum = "f63740969c229c77306024ed3ad809fabc0a1269cfe75a9c982c7cbd20c38d26" dependencies = [ "bincode", "log", @@ -5289,9 +5328,9 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa3e2351625e26f55e5e08f8e5aadaa2380fd0649f25641d6ba3f3848dbe5c9a" +checksum = "0f910ac2556498a889d393309110bf4ec7607208104b40260df822e925fce933" dependencies = [ "async-trait", "bincode", @@ -5313,9 +5352,9 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0841bbd1845c87043e4184961e45cc7c08b36d96d0d146256b26ea5c74630a0f" +checksum = "a5fa023f9a09216e809bf28c1dc16c8dfce726dfa64133f9016e8a1f01267f39" dependencies = [ "Inflector", "base64 0.21.7", @@ -5338,9 +5377,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae54a100f0b0b5be065f5d05f2259f6d4a7b39f5866d579927f3ca35a01773b" +checksum = "0e15df3333f480774a47da0d3af3e7b9c78a3417f949bb99ed7a16dd33a906d4" dependencies = [ "async-trait", "solana-connection-cache", @@ -5353,9 +5392,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f69945e38d7440221e2fac0aaa57a9d72adb329b0de705ca5bd9ba981aedc16" +checksum = "99147bd36e5ccc2e046bc3ef8af9517da1f34c255536e3aeaf0abc383a9f37ed" dependencies = [ "log", "rustc_version", @@ -5369,13 +5408,13 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e574aafc3c5adc7106ab4605d8ad378c9a12f2cf1dec2e8ba1aa6fd97a5d5490" +checksum = "c6071a7f57e03c9d1b55ae4a96fbc55b0df0f97c3153df1dc0c9521ea823bb2b" dependencies = [ "bincode", "log", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits 0.2.18", "rustc_version", "serde", @@ -5391,9 +5430,9 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.17.31" +version = "1.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597dddc8ab46852dea7fc3d22e031fa4ffdb1b2291ac24d960605424a510a5f5" +checksum = "76cba1f80c9001dc788655f2d7d5671af55c7a0a49b95de819f2fc45d8b803b0" dependencies = [ "aes-gcm-siv", "base64 0.21.7", @@ -5405,7 +5444,7 @@ dependencies = [ "itertools 0.10.5", "lazy_static", "merlin", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits 0.2.18", "rand 0.7.3", "serde", @@ -5732,6 +5771,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.55", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -6787,9 +6838,8 @@ dependencies = [ [[package]] name = "yellowstone-grpc-client" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4f6d836d214cb8789002d039412da354049e9ffe983c643ec492c4d934698f" +version = "1.14.0+solana.1.18.9" +source = "git+https://github.com/rpcpool/yellowstone-grpc.git?tag=v1.13.0+solana.1.18.9#19017c4e327d118a2da34f8700ed9ee470c801b5" dependencies = [ "bytes", "futures", @@ -6802,9 +6852,8 @@ dependencies = [ [[package]] name = "yellowstone-grpc-proto" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c00b66d40d85c405f14b420d7674e98c70d06f6b673f36c9e0285f81b9b797d" +version = "1.13.0+solana.1.18.9" +source = "git+https://github.com/rpcpool/yellowstone-grpc.git?tag=v1.13.0+solana.1.18.9#19017c4e327d118a2da34f8700ed9ee470c801b5" dependencies = [ "anyhow", "bincode", diff --git a/Cargo.toml b/Cargo.toml index 804105a7..1315c41f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,19 +28,19 @@ license = "AGPL" edition = "2021" [workspace.dependencies] -solana-sdk = "~1.17.28" -solana-rpc-client = "~1.17.28" -solana-rpc-client-api = "~1.17.28" -solana-transaction-status = "~1.17.28" -solana-version = "~1.17.28" -solana-client = "~1.17.28" -solana-net-utils = "~1.17.28" -solana-pubsub-client = "~1.17.28" -solana-streamer = "~1.17.28" -solana-account-decoder = "~1.17.28" -solana-ledger = "~1.17.28" -solana-program = "~1.17.28" -solana-address-lookup-table-program = "~1.17.28" +solana-sdk = "~1.18.9" +solana-rpc-client = "~1.18.9" +solana-rpc-client-api = "~1.18.9" +solana-transaction-status = "~1.18.9" +solana-version = "~1.18.9" +solana-client = "~1.18.9" +solana-net-utils = "~1.18.9" +solana-pubsub-client = "~1.18.9" +solana-streamer = "~1.18.9" +solana-account-decoder = "~1.18.9" +solana-ledger = "~1.18.9" +solana-program = "~1.18.9" +solana-address-lookup-table-program = "~1.18.9" itertools = "0.10.5" rangetools = "0.1.4" serde = { version = "1.0.160", features = ["derive"] } @@ -87,9 +87,9 @@ solana-lite-rpc-accounts = {path = "accounts", version = "0.2.4"} solana-lite-rpc-accounts-on-demand = {path = "accounts-on-demand", version = "0.2.4"} bench = { path = "bench", version="0.2.4" } -yellowstone-grpc-proto = "1.13.0" -#geyser-grpc-connector = { path = "../../geyser-grpc-connector" } -geyser-grpc-connector = { tag = "v0.10.6+yellowstone.1.13+solana.1.17.28", git = "https://github.com/blockworks-foundation/geyser-grpc-connector.git" } +yellowstone-grpc-proto = { git = "https://github.com/rpcpool/yellowstone-grpc.git", tag = "v1.13.0+solana.1.18.9" } +#geyser-grpc-connector = { path = "../geyser-grpc-connector" } +geyser-grpc-connector = { tag = "v0.10.6+yellowstone.1.13+solana.1.18.9", git = "https://github.com/blockworks-foundation/geyser-grpc-connector.git" } async-trait = "0.1.68" From e4a751f5a188d1bef9f9b40569cb96a2286c739b Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Wed, 12 Jun 2024 19:07:19 +0200 Subject: [PATCH 2/6] remove legacy cu --- cluster-endpoints/src/grpc_subscription.rs | 18 +------------- .../src/rpc_polling/poll_blocks.rs | 24 +------------------ core/src/structures/identity_stakes.rs | 2 +- .../src/tpu_utils/tpu_connection_manager.rs | 1 - services/src/transaction_service.rs | 4 +--- 5 files changed, 4 insertions(+), 45 deletions(-) diff --git a/cluster-endpoints/src/grpc_subscription.rs b/cluster-endpoints/src/grpc_subscription.rs index 7f0150bf..f1772ee6 100644 --- a/cluster-endpoints/src/grpc_subscription.rs +++ b/cluster-endpoints/src/grpc_subscription.rs @@ -21,7 +21,6 @@ use solana_lite_rpc_core::{ use solana_sdk::program_utils::limited_deserialize; use solana_sdk::vote::instruction::VoteInstruction; use solana_sdk::{ - borsh0_10::try_from_slice_unchecked, commitment_config::CommitmentConfig, compute_budget::{self, ComputeBudgetInstruction}, hash::Hash, @@ -216,10 +215,7 @@ pub fn from_grpc_block_update( fn map_compute_budget_instructions(message: &VersionedMessage) -> (Option, Option) { let cu_requested_cell: OnceCell = OnceCell::new(); - let legacy_cu_requested_cell: OnceCell = OnceCell::new(); - let prioritization_fees_cell: OnceCell = OnceCell::new(); - let legacy_prio_fees_cell: OnceCell = OnceCell::new(); for compute_budget_ins in message.instructions().iter().filter(|instruction| { instruction @@ -227,7 +223,7 @@ fn map_compute_budget_instructions(message: &VersionedMessage) -> (Option, .eq(&compute_budget::id()) }) { if let Ok(budget_ins) = - try_from_slice_unchecked::(compute_budget_ins.data.as_slice()) + solana_sdk::borsh1::try_from_slice_unchecked::(compute_budget_ins.data.as_slice()) { match budget_ins { // aka cu requested @@ -242,16 +238,6 @@ fn map_compute_budget_instructions(message: &VersionedMessage) -> (Option, .set(price) .expect("prioritization_fees must be set only once"); } - // legacy - ComputeBudgetInstruction::RequestUnitsDeprecated { - units, - additional_fee, - } => { - let _ = legacy_cu_requested_cell.set(units); - if additional_fee > 0 { - let _ = legacy_prio_fees_cell.set(((units * 1000) / additional_fee) as u64); - }; - } _ => { trace!("skip compute budget instruction"); } @@ -261,11 +247,9 @@ fn map_compute_budget_instructions(message: &VersionedMessage) -> (Option, let cu_requested = cu_requested_cell .get() - .or(legacy_cu_requested_cell.get()) .cloned(); let prioritization_fees = prioritization_fees_cell .get() - .or(legacy_prio_fees_cell.get()) .cloned(); (cu_requested, prioritization_fees) } diff --git a/cluster-endpoints/src/rpc_polling/poll_blocks.rs b/cluster-endpoints/src/rpc_polling/poll_blocks.rs index e0238226..e4607539 100644 --- a/cluster-endpoints/src/rpc_polling/poll_blocks.rs +++ b/cluster-endpoints/src/rpc_polling/poll_blocks.rs @@ -11,7 +11,7 @@ use solana_lite_rpc_core::{ AnyhowJoinHandle, }; use solana_rpc_client_api::config::RpcBlockConfig; -use solana_sdk::borsh0_10::try_from_slice_unchecked; +use solana_sdk::borsh1::try_from_slice_unchecked; use solana_sdk::compute_budget::ComputeBudgetInstruction; use solana_sdk::program_utils::limited_deserialize; use solana_sdk::reward_type::RewardType; @@ -222,21 +222,6 @@ pub fn from_ui_block( _ => None, }; - let legacy_compute_budget = tx.message.instructions().iter().find_map(|i| { - if i.program_id(tx.message.static_account_keys()) - .eq(&compute_budget::id()) - { - if let Ok(ComputeBudgetInstruction::RequestUnitsDeprecated { - units, - additional_fee, - }) = try_from_slice_unchecked(i.data.as_slice()) - { - return Some((units, additional_fee)); - } - } - None - }); - let mut cu_requested = tx.message.instructions().iter().find_map(|i| { if i.program_id(tx.message.static_account_keys()) .eq(&compute_budget::id()) @@ -264,13 +249,6 @@ pub fn from_ui_block( None }); - if let Some((units, additional_fee)) = legacy_compute_budget { - cu_requested = Some(units); - if additional_fee > 0 { - prioritization_fees = Some(calc_prioritization_fees(units, additional_fee)) - } - }; - let blockhash = tx.message.recent_blockhash(); let is_vote_transaction = tx.message.instructions().iter().any(|i| { diff --git a/core/src/structures/identity_stakes.rs b/core/src/structures/identity_stakes.rs index fcb11569..0801dee7 100644 --- a/core/src/structures/identity_stakes.rs +++ b/core/src/structures/identity_stakes.rs @@ -56,7 +56,7 @@ impl IdentityStakes { if let Some(stakes) = map_of_stakes.get(&self.identity.to_string()) { let only_stakes = map_of_stakes.iter().map(|x| *x.1).collect_vec(); let identity_stakes = IdentityStakesData { - peer_type: ConnectionPeerType::Staked, + peer_type: ConnectionPeerType::Staked(*stakes), // Staked -> Staked(*stakes) .. not sure if that is correct stakes: *stakes, min_stakes: only_stakes.iter().min().map_or(0, |x| *x), max_stakes: only_stakes.iter().max().map_or(0, |x| *x), diff --git a/services/src/tpu_utils/tpu_connection_manager.rs b/services/src/tpu_utils/tpu_connection_manager.rs index fa211a56..bf977de1 100644 --- a/services/src/tpu_utils/tpu_connection_manager.rs +++ b/services/src/tpu_utils/tpu_connection_manager.rs @@ -87,7 +87,6 @@ impl ActiveConnection { let max_uni_stream_connections = compute_max_allowed_uni_streams( identity_stakes.peer_type, - identity_stakes.stakes, identity_stakes.total_stakes, ); let connection_pool = QuicConnectionPool::new( diff --git a/services/src/transaction_service.rs b/services/src/transaction_service.rs index a829d615..78d44d71 100644 --- a/services/src/transaction_service.rs +++ b/services/src/transaction_service.rs @@ -20,7 +20,6 @@ use solana_lite_rpc_core::{ AnyhowJoinHandle, }; use solana_sdk::{ - borsh0_10::try_from_slice_unchecked, compute_budget::{self, ComputeBudgetInstruction}, transaction::{Transaction, VersionedTransaction}, }; @@ -165,8 +164,7 @@ impl TransactionService { .program_id(tx.message.static_account_keys()) .eq(&compute_budget::id()) { - let ix_which = - try_from_slice_unchecked::(ix.data.as_slice()); + let ix_which = solana_sdk::borsh1::try_from_slice_unchecked::(ix.data.as_slice()); if let Ok(ComputeBudgetInstruction::SetComputeUnitPrice(fees)) = ix_which { prioritization_fee = fees; } From f77d13553dd0b34b4c237856460f4fb8d657f54b Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Thu, 13 Jun 2024 10:14:47 +0200 Subject: [PATCH 3/6] use yellowstone 1.15 --- Cargo.lock | 153 +++++++++--------- Cargo.toml | 32 ++-- .../src/grpc/grpc_accounts_streaming.rs | 32 ++-- cluster-endpoints/src/grpc_subscription.rs | 99 ------------ 4 files changed, 105 insertions(+), 211 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f01422c9..28a3167e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1813,7 +1813,6 @@ dependencies = [ [[package]] name = "geyser-grpc-connector" version = "0.10.6+yellowstone.1.13" -source = "git+https://github.com/blockworks-foundation/geyser-grpc-connector.git?tag=v0.10.6+yellowstone.1.13+solana.1.18.9#bb6aa57f0f707ca2c4c5b84c5ead4a60658f7f69" dependencies = [ "anyhow", "async-stream", @@ -1826,7 +1825,9 @@ dependencies = [ "log", "merge-streams", "solana-sdk", + "thiserror", "tokio", + "tonic", "tonic-health", "tracing", "url", @@ -3927,9 +3928,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", @@ -4293,9 +4294,9 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5f49893e9e7cd1a45869e03ad6d767666544e47aa39cff5bcfd10c9b156177" +checksum = "b94ceb26c7d19530cb1bb49bf0f817647cb5fee691dae6779e19d33ac1d4fda1" dependencies = [ "Inflector", "base64 0.21.7", @@ -4318,9 +4319,9 @@ dependencies = [ [[package]] name = "solana-address-lookup-table-program" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3602b15a5c70a16cac6008d3556098b7990c5ab72b047a996f5ea4e988871975" +checksum = "195a93b87bd6794326a3c628cfcc8abaf70e476c4284bfb73545c873ba47c746" dependencies = [ "bincode", "bytemuck", @@ -4339,9 +4340,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce8528b2853d64e0b27889948e9f41b264d758074be9d9b8ba4e0ddce7c476dd" +checksum = "32063b76137e13fba2f93fdf67f999d84ac587af962b48cb4115f272037b2fae" dependencies = [ "chrono", "clap 2.34.0", @@ -4356,9 +4357,9 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b2b8e68c4b57a916400a77a66078a96b2914d7b218572ef8dff5a84e48ea2" +checksum = "31f6eaf198c544d4f448e6a86a51f9af8b328f041a490a007164a75194edf341" dependencies = [ "async-trait", "bincode", @@ -4389,9 +4390,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617228f9569238e544b526c422b632de368a5ce748a7af04f7f762bd937f42f3" +checksum = "378259800dc9dad34828d8be4ce0de71146bac1cbbd310f8901f6f19d92c5ea3" dependencies = [ "bincode", "chrono", @@ -4403,9 +4404,9 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec06c0772e0ebc54d22626ddb433eb798404fdc21b0175ac504f5fff4e50612" +checksum = "58b04571089f55754f5a09493ae0bcf8d8d5c8d9cd05be3e77c502f6b68c1a3b" dependencies = [ "async-trait", "bincode", @@ -4425,9 +4426,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc46edad65d122c8b8634aa9ad11276a804c1aa2404755577fdfdea67484b620" +checksum = "780402262644f9efe9ac7d885812d245007fe65fd56a3dfed83ed30d61b44c74" dependencies = [ "block-buffer 0.10.4", "bs58", @@ -4450,9 +4451,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71c603d2203da423cfd8862572ffca7165268e76cab181035f50d106c3710eb" +checksum = "df836de37aba77234c7afa1d857dc450fb9983572e4c6f595c84cdda65a63792" dependencies = [ "proc-macro2", "quote", @@ -4895,9 +4896,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5b3eef85d82c2c3030acb1d3272d77984d118d2a026d9b1a2cecc6e4c6602eb" +checksum = "9906be6edd0e1b579510736c153dbc51e5968808098d1b1f8c89dbea960aba58" dependencies = [ "env_logger", "lazy_static", @@ -4906,9 +4907,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd072023ab870dcb7d524980d9481317bfd29c1dfd74a067747c8d1d249d1075" +checksum = "7dc77e7f99fa5e845437ac9a593cd4bd67b5f9e4ba4a9578355eef25d3e839e9" dependencies = [ "log", "solana-sdk", @@ -4916,9 +4917,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f594ca2a2698983b515580925d10be20b079617154bbed07d6cd455d1661b90" +checksum = "b0a9f68887ac31f84ef69365bdc2d7ca6bf19d50a9c6ee10806adb033e24e318" dependencies = [ "crossbeam-channel", "gethostname", @@ -4931,9 +4932,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e632ad2071b8c911baf873403273c574bb11da95947e2f56db4e53ef06b771fe" +checksum = "1ba07cceff31b644df6cd4acc909df077721fa047b624b9fa906d56bcc67435a" dependencies = [ "bincode", "clap 3.2.25", @@ -4953,9 +4954,9 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3012434718bf3e76ef46cbf3be98a2de877afe7bff6571232d64cc67dce219a" +checksum = "0b7fa87b3344f96afe1395b5bb822db2ad03cdc2dbe8338636d57c58102a520b" dependencies = [ "ahash 0.8.11", "bincode", @@ -4982,9 +4983,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760e9e923050f30f03a159aec9ba1fe09ae7c7494ebd8ba74dc5b7429b11085b" +checksum = "48ecc7af7594674687260a4d7bcfb0588cefdbe9d0f6c4e9f3140999107566c4" dependencies = [ "ark-bn254", "ark-ec", @@ -5037,9 +5038,9 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a61b65be846413bc504ecae468b6a3fa91b1b37631c80074c41ada8cdc36d165" +checksum = "0ef9218f50470228ebca12bb147650ca7052678aad915a4e19687ee215f8d947" dependencies = [ "base64 0.21.7", "bincode", @@ -5065,9 +5066,9 @@ dependencies = [ [[package]] name = "solana-pubsub-client" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4173029a0e3a20930791886dce92c1a6d293a59754e418ac68547f3e14a8f025" +checksum = "60325aaab2bcd99ca51e1ff5a4673027a03591353a944151690b38d5dadc2c0f" dependencies = [ "crossbeam-channel", "futures-util", @@ -5090,9 +5091,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae1b9224efc32579fe61a9e06dc8efb2a3cd167c458091cc093086304441285" +checksum = "d979690c6c392ffdb40a91e241a08ec3942eb217bddb0403b6174de0173ab61e" dependencies = [ "async-mutex", "async-trait", @@ -5117,9 +5118,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9460642bcb89090dcc15ecf11b6c4a1994c538ba49a4c5d99023365600631009" +checksum = "6902079fb9d0bd4c455b97f5e48e2412d98e0e1facf635ec6fc6b783c0f3e2af" dependencies = [ "lazy_static", "num_cpus", @@ -5127,9 +5128,9 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3de3b65d0fdbf0b2de6dc9aecac03d79ea7ef11c29efbdd67bf17a13d061a95" +checksum = "af88bad970c0dd63e98e7cc4c3c16a58acf32d4255aee79f611ea375592028ec" dependencies = [ "console", "dialoguer", @@ -5146,9 +5147,9 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b27d16eaebd5889c4dd873d715be0bad4651a0bc2509ba99ec6fc7d3b3416278" +checksum = "d1adab0dcdc851fc7bc6ca8c6926d9f56ed3982f1e4fabd67d362647b57143d3" dependencies = [ "async-trait", "base64 0.21.7", @@ -5172,9 +5173,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82323f7b130105a4789101b5e7d97142110774ee06aa84346effa661898d407" +checksum = "6d6764712822bbc0259bbb5413377798a11462221863d000082f39968ce5ad03" dependencies = [ "base64 0.21.7", "bs58", @@ -5194,9 +5195,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092867e337f366d1b719d28b4e02cffff4734cbbf9945daf5f172715db378e2c" +checksum = "49489fe59d308c10a2b3e3ecd3bee1107b9b67a325c99ffd278ba0870a5619cd" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -5207,9 +5208,9 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788023924ebb072288868f8b4b72f5459c1ff653238d769700da9c8043a8aea" +checksum = "73bb113fa17e0607343afdc795c2c5230981c5b51c99b2c54fba91755879d65b" dependencies = [ "assert_matches", "base64 0.21.7", @@ -5262,9 +5263,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3b24f46820e8912b81719a828a3d05f4fbd2f6afdc13826b0327df065ab795" +checksum = "8fcdb3a94e2f04d856d2fba6feb4f6887a1da21a3ee0b64b69c08d15dc22d46c" dependencies = [ "bs58", "proc-macro2", @@ -5281,9 +5282,9 @@ checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" [[package]] name = "solana-streamer" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7403972b4233b87598c0a8e8fac26db549f8cb18076d385b8ef8deb1e36a6bc3" +checksum = "c0e6132c9eefb372202e69e654e8c2a30b4c06635343dd6474467b9cca4b9dd9" dependencies = [ "async-channel", "bytes", @@ -5303,6 +5304,7 @@ dependencies = [ "rand 0.8.5", "rcgen 0.10.0", "rustls", + "smallvec", "solana-metrics", "solana-perf", "solana-sdk", @@ -5313,9 +5315,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63740969c229c77306024ed3ad809fabc0a1269cfe75a9c982c7cbd20c38d26" +checksum = "ca1c3ed492f61914aaa8074cf7a07f93bfd8d9adbf9846939e589b7b7c70fe39" dependencies = [ "bincode", "log", @@ -5328,9 +5330,9 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f910ac2556498a889d393309110bf4ec7607208104b40260df822e925fce933" +checksum = "c3fbfce5d27608f4853dcb0c0d964f59420710a7a4486409e7583717c610c3cf" dependencies = [ "async-trait", "bincode", @@ -5352,9 +5354,9 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fa023f9a09216e809bf28c1dc16c8dfce726dfa64133f9016e8a1f01267f39" +checksum = "6adbd8f3fccddeae87278a105dcf8a8792f8816c0f4fb5f7ae8f307af279ac49" dependencies = [ "Inflector", "base64 0.21.7", @@ -5377,9 +5379,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e15df3333f480774a47da0d3af3e7b9c78a3417f949bb99ed7a16dd33a906d4" +checksum = "b90f8ebd26cac3cd563bf839ff8511f27698f2d220e58f7538b5d6d80d8970ed" dependencies = [ "async-trait", "solana-connection-cache", @@ -5392,9 +5394,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99147bd36e5ccc2e046bc3ef8af9517da1f34c255536e3aeaf0abc383a9f37ed" +checksum = "ac8714cf9f6caefc403e19770ad73ed2e4c866b7201e31dd17a9e06b6a693a57" dependencies = [ "log", "rustc_version", @@ -5408,9 +5410,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6071a7f57e03c9d1b55ae4a96fbc55b0df0f97c3153df1dc0c9521ea823bb2b" +checksum = "b5de2428939c6e279901d4357bf02c809739e5b97164e8620e09a9e0b55c2327" dependencies = [ "bincode", "log", @@ -5430,9 +5432,9 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.18.9" +version = "1.18.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76cba1f80c9001dc788655f2d7d5671af55c7a0a49b95de819f2fc45d8b803b0" +checksum = "8dad1753ec3b189879c8756ac35471467116dfc93d7aeb68cfd28f22a02c850d" dependencies = [ "aes-gcm-siv", "base64 0.21.7", @@ -5860,18 +5862,18 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", @@ -6838,12 +6840,11 @@ dependencies = [ [[package]] name = "yellowstone-grpc-client" -version = "1.14.0+solana.1.18.9" -source = "git+https://github.com/rpcpool/yellowstone-grpc.git?tag=v1.13.0+solana.1.18.9#19017c4e327d118a2da34f8700ed9ee470c801b5" +version = "1.15.0+solana.1.18" +source = "git+https://github.com/rpcpool/yellowstone-grpc.git?tag=v1.15.0+solana.1.18#54698c77c727eb33e23c2ab95384c98c688540e2" dependencies = [ "bytes", "futures", - "http", "thiserror", "tonic", "tonic-health", @@ -6852,8 +6853,8 @@ dependencies = [ [[package]] name = "yellowstone-grpc-proto" -version = "1.13.0+solana.1.18.9" -source = "git+https://github.com/rpcpool/yellowstone-grpc.git?tag=v1.13.0+solana.1.18.9#19017c4e327d118a2da34f8700ed9ee470c801b5" +version = "1.14.0+solana.1.18" +source = "git+https://github.com/rpcpool/yellowstone-grpc.git?tag=v1.15.0+solana.1.18#54698c77c727eb33e23c2ab95384c98c688540e2" dependencies = [ "anyhow", "bincode", diff --git a/Cargo.toml b/Cargo.toml index 1315c41f..b6f6c5c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,19 +28,19 @@ license = "AGPL" edition = "2021" [workspace.dependencies] -solana-sdk = "~1.18.9" -solana-rpc-client = "~1.18.9" -solana-rpc-client-api = "~1.18.9" -solana-transaction-status = "~1.18.9" -solana-version = "~1.18.9" -solana-client = "~1.18.9" -solana-net-utils = "~1.18.9" -solana-pubsub-client = "~1.18.9" -solana-streamer = "~1.18.9" -solana-account-decoder = "~1.18.9" -solana-ledger = "~1.18.9" -solana-program = "~1.18.9" -solana-address-lookup-table-program = "~1.18.9" +solana-sdk = "~1.18.15" +solana-rpc-client = "~1.18.15" +solana-rpc-client-api = "~1.18.15" +solana-transaction-status = "~1.18.15" +solana-version = "~1.18.15" +solana-client = "~1.18.15" +solana-net-utils = "~1.18.15" +solana-pubsub-client = "~1.18.15" +solana-streamer = "~1.18.15" +solana-account-decoder = "~1.18.15" +solana-ledger = "~1.18.15" +solana-program = "~1.18.15" +solana-address-lookup-table-program = "~1.18.15" itertools = "0.10.5" rangetools = "0.1.4" serde = { version = "1.0.160", features = ["derive"] } @@ -87,9 +87,9 @@ solana-lite-rpc-accounts = {path = "accounts", version = "0.2.4"} solana-lite-rpc-accounts-on-demand = {path = "accounts-on-demand", version = "0.2.4"} bench = { path = "bench", version="0.2.4" } -yellowstone-grpc-proto = { git = "https://github.com/rpcpool/yellowstone-grpc.git", tag = "v1.13.0+solana.1.18.9" } -#geyser-grpc-connector = { path = "../geyser-grpc-connector" } -geyser-grpc-connector = { tag = "v0.10.6+yellowstone.1.13+solana.1.18.9", git = "https://github.com/blockworks-foundation/geyser-grpc-connector.git" } +yellowstone-grpc-proto = { git = "https://github.com/rpcpool/yellowstone-grpc.git", tag = "v1.15.0+solana.1.18" } +geyser-grpc-connector = { path = "../geyser-grpc-connector" } +#geyser-grpc-connector = { tag = "v0.10.6+yellowstone.1.13+solana.1.18.15", git = "https://github.com/blockworks-foundation/geyser-grpc-connector.git" } async-trait = "0.1.68" diff --git a/cluster-endpoints/src/grpc/grpc_accounts_streaming.rs b/cluster-endpoints/src/grpc/grpc_accounts_streaming.rs index 7713de61..f7ebd5b3 100644 --- a/cluster-endpoints/src/grpc/grpc_accounts_streaming.rs +++ b/cluster-endpoints/src/grpc/grpc_accounts_streaming.rs @@ -5,10 +5,9 @@ use std::{ sync::Arc, time::Duration, }; +use anyhow::anyhow; -use geyser_grpc_connector::yellowstone_grpc_util::{ - connect_with_timeout_with_buffers, GeyserGrpcClientBufferConfig, -}; +use geyser_grpc_connector::yellowstone_grpc_util::{connect_with_timeout_with_buffers, GeyserGrpcClientBufferConfig, GeyserGrpcWrappedResult}; use geyser_grpc_connector::{GeyserGrpcClient, GeyserGrpcClientResult, GrpcSourceConfig}; use itertools::Itertools; use solana_lite_rpc_core::{ @@ -103,19 +102,14 @@ pub fn start_account_streaming_tasks( let program_subscription = SubscribeRequest { accounts: subscribe_programs, - slots: Default::default(), - transactions: Default::default(), - blocks: Default::default(), - blocks_meta: Default::default(), - entry: Default::default(), - commitment: Some(processed_commitment.into()), accounts_data_slice: Default::default(), - ping: None, + commitment: Some(processed_commitment.into()), + ..Default::default() }; let mut client = create_connection(&grpc_config).await?; - let account_stream = client.subscribe_once2(program_subscription).await.unwrap(); + let account_stream = client.subscribe_once(program_subscription).await.unwrap(); // each account subscription batch will require individual stream let mut subscriptions = vec![account_stream]; @@ -139,17 +133,12 @@ pub fn start_account_streaming_tasks( let account_request = SubscribeRequest { accounts: accounts_subscription, - slots: Default::default(), - transactions: Default::default(), - blocks: Default::default(), - blocks_meta: Default::default(), - entry: Default::default(), - commitment: Some(processed_commitment.into()), accounts_data_slice: Default::default(), - ping: None, + commitment: Some(processed_commitment.into()), + ..Default::default() }; - let account_stream = client.subscribe_once2(account_request).await.unwrap(); + let account_stream = client.subscribe_once(account_request).await.unwrap(); subscriptions.push(account_stream); } let mut merged_stream = subscriptions.merge(); @@ -216,7 +205,7 @@ pub fn start_account_streaming_tasks( async fn create_connection( grpc_config: &GrpcSourceConfig, -) -> GeyserGrpcClientResult> { +) -> anyhow::Result> { connect_with_timeout_with_buffers( grpc_config.grpc_addr.clone(), grpc_config.grpc_x_token.clone(), @@ -230,6 +219,9 @@ async fn create_connection( }, ) .await + .map_err(|e| { + anyhow!("Failed to connect to grpc source: {e:?}") + }) } pub fn create_grpc_account_streaming( diff --git a/cluster-endpoints/src/grpc_subscription.rs b/cluster-endpoints/src/grpc_subscription.rs index f1772ee6..6eb0f352 100644 --- a/cluster-endpoints/src/grpc_subscription.rs +++ b/cluster-endpoints/src/grpc_subscription.rs @@ -254,105 +254,6 @@ fn map_compute_budget_instructions(message: &VersionedMessage) -> (Option, (cu_requested, prioritization_fees) } -pub fn create_block_processing_task( - grpc_addr: String, - grpc_x_token: Option, - block_sx: tokio::sync::mpsc::Sender, - commitment_level: CommitmentLevel, - mut exit_notify: broadcast::Receiver<()>, -) -> AnyhowJoinHandle { - tokio::spawn(async move { - 'main_loop: loop { - let mut blocks_subs = HashMap::new(); - blocks_subs.insert( - "block_client".to_string(), - SubscribeRequestFilterBlocks { - account_include: Default::default(), - include_transactions: Some(true), - include_accounts: Some(false), - include_entries: Some(false), - }, - ); - - // connect to grpc - let mut client = connect_with_timeout_with_buffers( - grpc_addr.clone(), - grpc_x_token.clone(), - None, - Some(Duration::from_secs(10)), - Some(Duration::from_secs(10)), - GeyserGrpcClientBufferConfig { - buffer_size: Some(65536), - conn_window: Some(5242880), - stream_window: Some(4194304), - }, - ) - .await?; - let mut stream = tokio::select! { - res = client - .subscribe_once( - HashMap::new(), - Default::default(), - HashMap::new(), - Default::default(), - blocks_subs, - Default::default(), - Some(commitment_level), - Default::default(), - None, - ) => { - res? - }, - _ = exit_notify.recv() => { - break; - } - }; - - loop { - tokio::select! { - message = stream.next() => { - let Some(Ok(message)) = message else { - break; - }; - - let Some(update) = message.update_oneof else { - continue; - }; - - match update { - UpdateOneof::Block(block) => { - log::trace!( - "received block, hash: {} slot: {}", - block.blockhash, - block.slot - ); - block_sx - .send(block) - .await - .context("Problem sending on block channel")?; - } - UpdateOneof::Ping(_) => { - log::trace!("GRPC Ping"); - } - _ => { - log::trace!("unknown GRPC notification"); - } - }; - }, - _ = exit_notify.recv() => { - break 'main_loop; - } - } - } - drop(stream); - drop(client); - log::error!("Grpc block subscription broken (resubscribing)"); - tokio::time::sleep(std::time::Duration::from_secs(1)).await; - } - Ok(()) - }) -} - pub fn create_grpc_subscription( rpc_client: Arc, grpc_sources: Vec, From c7c192e347c43916dfc265b6e49e81568e6ff8eb Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Thu, 13 Jun 2024 10:22:02 +0200 Subject: [PATCH 4/6] use tagged geyser-grpc-connector version --- Cargo.lock | 1 + Cargo.toml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28a3167e..aa745b06 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1813,6 +1813,7 @@ dependencies = [ [[package]] name = "geyser-grpc-connector" version = "0.10.6+yellowstone.1.13" +source = "git+https://github.com/blockworks-foundation/geyser-grpc-connector.git?tag=v0.10.6+yellowstone.1.15+solana.1.18#aa7a8daf6c05dfece2b33e020b53a112415e88cc" dependencies = [ "anyhow", "async-stream", diff --git a/Cargo.toml b/Cargo.toml index b6f6c5c5..8560baa5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ members = [ [workspace.package] version = "0.2.4" -authors = ["gmgalactus ", "Aniket Prajapati "] +authors = ["gmgalactus ", "GroovieGermanikus "] repository = "https://github.com/blockworks-foundation/lite-rpc" license = "AGPL" edition = "2021" @@ -88,8 +88,8 @@ solana-lite-rpc-accounts-on-demand = {path = "accounts-on-demand", version = "0. bench = { path = "bench", version="0.2.4" } yellowstone-grpc-proto = { git = "https://github.com/rpcpool/yellowstone-grpc.git", tag = "v1.15.0+solana.1.18" } -geyser-grpc-connector = { path = "../geyser-grpc-connector" } -#geyser-grpc-connector = { tag = "v0.10.6+yellowstone.1.13+solana.1.18.15", git = "https://github.com/blockworks-foundation/geyser-grpc-connector.git" } +#geyser-grpc-connector = { path = "../geyser-grpc-connector" } +geyser-grpc-connector = { tag = "v0.10.6+yellowstone.1.15+solana.1.18", git = "https://github.com/blockworks-foundation/geyser-grpc-connector.git" } async-trait = "0.1.68" From bd0655a3326f000869a4a947d4d255846d524ca2 Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Thu, 13 Jun 2024 10:37:20 +0200 Subject: [PATCH 5/6] clippy+fmt --- .../src/grpc/grpc_accounts_streaming.rs | 12 +-- cluster-endpoints/src/grpc_subscription.rs | 24 ++--- .../src/rpc_polling/poll_blocks.rs | 28 +++--- .../tests/quic_proxy_tpu_integrationtest.rs | 96 ++++++++++--------- services/src/transaction_service.rs | 4 +- 5 files changed, 81 insertions(+), 83 deletions(-) diff --git a/cluster-endpoints/src/grpc/grpc_accounts_streaming.rs b/cluster-endpoints/src/grpc/grpc_accounts_streaming.rs index f7ebd5b3..dc4a7f5b 100644 --- a/cluster-endpoints/src/grpc/grpc_accounts_streaming.rs +++ b/cluster-endpoints/src/grpc/grpc_accounts_streaming.rs @@ -1,3 +1,4 @@ +use anyhow::anyhow; use futures::StreamExt; use merge_streams::MergeStreams; use std::{ @@ -5,10 +6,11 @@ use std::{ sync::Arc, time::Duration, }; -use anyhow::anyhow; -use geyser_grpc_connector::yellowstone_grpc_util::{connect_with_timeout_with_buffers, GeyserGrpcClientBufferConfig, GeyserGrpcWrappedResult}; -use geyser_grpc_connector::{GeyserGrpcClient, GeyserGrpcClientResult, GrpcSourceConfig}; +use geyser_grpc_connector::yellowstone_grpc_util::{ + connect_with_timeout_with_buffers, GeyserGrpcClientBufferConfig, +}; +use geyser_grpc_connector::{GeyserGrpcClient, GrpcSourceConfig}; use itertools::Itertools; use solana_lite_rpc_core::{ commitment_utils::Commitment, @@ -219,9 +221,7 @@ async fn create_connection( }, ) .await - .map_err(|e| { - anyhow!("Failed to connect to grpc source: {e:?}") - }) + .map_err(|e| anyhow!("Failed to connect to grpc source: {e:?}")) } pub fn create_grpc_account_streaming( diff --git a/cluster-endpoints/src/grpc_subscription.rs b/cluster-endpoints/src/grpc_subscription.rs index 6eb0f352..57a55f38 100644 --- a/cluster-endpoints/src/grpc_subscription.rs +++ b/cluster-endpoints/src/grpc_subscription.rs @@ -3,11 +3,6 @@ use crate::grpc::grpc_accounts_streaming::create_grpc_account_streaming; use crate::grpc_multiplex::{ create_grpc_multiplex_blocks_subscription, create_grpc_multiplex_processed_slots_subscription, }; -use anyhow::Context; -use futures::StreamExt; -use geyser_grpc_connector::yellowstone_grpc_util::{ - connect_with_timeout_with_buffers, GeyserGrpcClientBufferConfig, -}; use geyser_grpc_connector::GrpcSourceConfig; use itertools::Itertools; use log::trace; @@ -35,13 +30,9 @@ use solana_sdk::{ }; use solana_transaction_status::{Reward, RewardType}; use std::cell::OnceCell; -use std::collections::HashMap; use std::sync::Arc; -use std::time::Duration; -use tokio::sync::{broadcast, Notify}; +use tokio::sync::Notify; use tracing::trace_span; -use yellowstone_grpc_proto::geyser::subscribe_update::UpdateOneof; -use yellowstone_grpc_proto::geyser::{CommitmentLevel, SubscribeRequestFilterBlocks}; use crate::rpc_polling::vote_accounts_and_cluster_info_polling::{ poll_cluster_info, poll_vote_accounts, @@ -222,8 +213,9 @@ fn map_compute_budget_instructions(message: &VersionedMessage) -> (Option, .program_id(message.static_account_keys()) .eq(&compute_budget::id()) }) { - if let Ok(budget_ins) = - solana_sdk::borsh1::try_from_slice_unchecked::(compute_budget_ins.data.as_slice()) + if let Ok(budget_ins) = solana_sdk::borsh1::try_from_slice_unchecked::< + ComputeBudgetInstruction, + >(compute_budget_ins.data.as_slice()) { match budget_ins { // aka cu requested @@ -245,12 +237,8 @@ fn map_compute_budget_instructions(message: &VersionedMessage) -> (Option, } } - let cu_requested = cu_requested_cell - .get() - .cloned(); - let prioritization_fees = prioritization_fees_cell - .get() - .cloned(); + let cu_requested = cu_requested_cell.get().cloned(); + let prioritization_fees = prioritization_fees_cell.get().cloned(); (cu_requested, prioritization_fees) } diff --git a/cluster-endpoints/src/rpc_polling/poll_blocks.rs b/cluster-endpoints/src/rpc_polling/poll_blocks.rs index e4607539..7bf513e9 100644 --- a/cluster-endpoints/src/rpc_polling/poll_blocks.rs +++ b/cluster-endpoints/src/rpc_polling/poll_blocks.rs @@ -222,7 +222,7 @@ pub fn from_ui_block( _ => None, }; - let mut cu_requested = tx.message.instructions().iter().find_map(|i| { + let cu_requested = tx.message.instructions().iter().find_map(|i| { if i.program_id(tx.message.static_account_keys()) .eq(&compute_budget::id()) { @@ -235,7 +235,7 @@ pub fn from_ui_block( None }); - let mut prioritization_fees = tx.message.instructions().iter().find_map(|i| { + let prioritization_fees = tx.message.instructions().iter().find_map(|i| { if i.program_id(tx.message.static_account_keys()) .eq(&compute_budget::id()) { @@ -327,17 +327,19 @@ fn map_block_info(produced_block: &ProducedBlock) -> BlockInfo { } } -#[inline] -fn calc_prioritization_fees(units: u32, additional_fee: u32) -> u64 { - (units as u64 * 1000) / additional_fee as u64 -} +#[cfg(test)] +mod tests { + #[inline] + fn calc_prioritization_fees(units: u32, additional_fee: u32) -> u64 { + (units as u64 * 1000) / additional_fee as u64 + } -#[test] -fn overflow_u32() { - // value high enough to overflow u32 if multiplied by 1000 - let units: u32 = 4_000_000_000; - let additional_fee: u32 = 100; - let prioritization_fees: u64 = calc_prioritization_fees(units, additional_fee); + #[test] + fn test_calc_prioritization_fees() { + let units: u32 = 100; + let additional_fee: u32 = 10; + let prioritization_fees: u64 = calc_prioritization_fees(units, additional_fee); - assert_eq!(40_000_000_000, prioritization_fees); + assert_eq!(1000, prioritization_fees); + } } diff --git a/quic-forward-proxy-integration-test/tests/quic_proxy_tpu_integrationtest.rs b/quic-forward-proxy-integration-test/tests/quic_proxy_tpu_integrationtest.rs index b9f61914..5cdc6319 100644 --- a/quic-forward-proxy-integration-test/tests/quic_proxy_tpu_integrationtest.rs +++ b/quic-forward-proxy-integration-test/tests/quic_proxy_tpu_integrationtest.rs @@ -15,7 +15,7 @@ use solana_sdk::pubkey::Pubkey; use solana_sdk::signature::{Keypair, Signature, Signer}; use solana_sdk::transaction::{Transaction, VersionedTransaction}; -use solana_streamer::nonblocking::quic::ConnectionPeerType; +use solana_streamer::nonblocking::quic::{ConnectionPeerType, SpawnNonBlockingServerResult}; use solana_streamer::packet::PacketBatch; use solana_streamer::quic::StreamStats; use solana_streamer::streamer::StakedNodes; @@ -424,21 +424,23 @@ async fn solana_quic_streamer_start() { let keypair = Keypair::new(); // gossip_host is used in the server certificate let gossip_host = "127.0.0.1".parse().unwrap(); - let (_, stats, t) = solana_streamer::nonblocking::quic::spawn_server( - "test-quic-server", - sock.try_clone().unwrap(), - &keypair, - gossip_host, - sender, - exit.clone(), - 1, - staked_nodes, - 10, - 10, - Duration::from_millis(1000), - Duration::from_millis(1000), - ) - .unwrap(); + let SpawnNonBlockingServerResult { stats, thread, .. } = + solana_streamer::nonblocking::quic::spawn_server( + "test-quic-server", + sock.try_clone().unwrap(), + &keypair, + gossip_host, + sender, + exit.clone(), + 1, + staked_nodes, + 10, + 10, + 9999, // max_streams_per_ms + Duration::from_millis(1000), + Duration::from_millis(1000), + ) + .unwrap(); let addr = sock.local_addr().unwrap().ip(); let port = sock.local_addr().unwrap().port(); @@ -447,7 +449,7 @@ async fn solana_quic_streamer_start() { // sleep(Duration::from_millis(500)).await; exit.store(true, Ordering::Relaxed); - t.await.unwrap(); + thread.await.unwrap(); stats.report("test-quic-streamer"); } @@ -499,13 +501,14 @@ async fn start_literpc_client_direct_mode( // get information about the optional validator identity stake // populated from get_stakes_for_identity() + let stakes = if test_case_params.stake_connection { + 30 + } else { + 0 + }; let identity_stakes = IdentityStakesData { - peer_type: ConnectionPeerType::Staked, - stakes: if test_case_params.stake_connection { - 30 - } else { - 0 - }, // stake of lite-rpc + peer_type: ConnectionPeerType::Staked(stakes), + stakes, // stake of lite-rpc min_stakes: 0, max_stakes: 40, total_stakes: 100, @@ -599,13 +602,14 @@ async fn start_literpc_client_proxy_mode( // get information about the optional validator identity stake // populated from get_stakes_for_identity() + let stake = if test_case_params.stake_connection { + 30 + } else { + 0 + }; let _identity_stakes = IdentityStakesData { - peer_type: ConnectionPeerType::Staked, - stakes: if test_case_params.stake_connection { - 30 - } else { - 0 - }, // stake of lite-rpc + peer_type: ConnectionPeerType::Staked(stake), // not sure if that is correct + stakes: stake, // stake of lite-rpc min_stakes: 0, max_stakes: 40, total_stakes: 100, @@ -705,21 +709,23 @@ impl SolanaQuicStreamer { let keypair = Keypair::new(); // gossip_host is used in the server certificate let gossip_host = "127.0.0.1".parse().unwrap(); - let (_, stats, jh) = solana_streamer::nonblocking::quic::spawn_server( - "test-quic-server", - udp_socket.try_clone().unwrap(), - &keypair, - gossip_host, - sender, - exit.clone(), - MAX_QUIC_CONNECTIONS_PER_PEER, - staked_nodes, - 10, - 10, - Duration::from_millis(1000), - Duration::from_millis(1000), - ) - .unwrap(); + let SpawnNonBlockingServerResult { stats, thread, .. } = + solana_streamer::nonblocking::quic::spawn_server( + "test-quic-server", + udp_socket.try_clone().unwrap(), + &keypair, + gossip_host, + sender, + exit.clone(), + MAX_QUIC_CONNECTIONS_PER_PEER, + staked_nodes, + 10, + 10, + 9999, // max_streams_per_ms + Duration::from_millis(1000), + Duration::from_millis(1000), + ) + .unwrap(); let addr = udp_socket.local_addr().unwrap().ip(); let port = udp_socket.local_addr().unwrap().port(); @@ -728,7 +734,7 @@ impl SolanaQuicStreamer { Self { sock: udp_socket, exit, - join_handler: jh, + join_handler: thread, stats, } } diff --git a/services/src/transaction_service.rs b/services/src/transaction_service.rs index 78d44d71..ce34caef 100644 --- a/services/src/transaction_service.rs +++ b/services/src/transaction_service.rs @@ -164,7 +164,9 @@ impl TransactionService { .program_id(tx.message.static_account_keys()) .eq(&compute_budget::id()) { - let ix_which = solana_sdk::borsh1::try_from_slice_unchecked::(ix.data.as_slice()); + let ix_which = solana_sdk::borsh1::try_from_slice_unchecked::< + ComputeBudgetInstruction, + >(ix.data.as_slice()); if let Ok(ComputeBudgetInstruction::SetComputeUnitPrice(fees)) = ix_which { prioritization_fee = fees; } From 1aae56ceabe0dc38e10e7db2548a487b7b347f28 Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Thu, 13 Jun 2024 10:41:17 +0200 Subject: [PATCH 6/6] delete obsolete test --- .../src/rpc_polling/poll_blocks.rs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/cluster-endpoints/src/rpc_polling/poll_blocks.rs b/cluster-endpoints/src/rpc_polling/poll_blocks.rs index 7bf513e9..b9d97329 100644 --- a/cluster-endpoints/src/rpc_polling/poll_blocks.rs +++ b/cluster-endpoints/src/rpc_polling/poll_blocks.rs @@ -326,20 +326,3 @@ fn map_block_info(produced_block: &ProducedBlock) -> BlockInfo { block_time: produced_block.block_time, } } - -#[cfg(test)] -mod tests { - #[inline] - fn calc_prioritization_fees(units: u32, additional_fee: u32) -> u64 { - (units as u64 * 1000) / additional_fee as u64 - } - - #[test] - fn test_calc_prioritization_fees() { - let units: u32 = 100; - let additional_fee: u32 = 10; - let prioritization_fees: u64 = calc_prioritization_fees(units, additional_fee); - - assert_eq!(1000, prioritization_fees); - } -}