From 8596db8f533445fd756f1dcc1d08165987e75ecf Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Mon, 26 Jul 2021 12:32:17 -0600 Subject: [PATCH] Bump jsonrpc crates and remove old tokio (#18779) * Bump jsonrpc crates and replace old tokio * Bump tokio * getBlockTime * getBlocks * getBlocksWithLimit, getInflationReward * getBlock * getFirstAvailableBlock * getTransaction * getSignaturesForAddress * getSignatureStatuses * Remove superfluous runtime --- Cargo.lock | 455 +++++------------------- client/Cargo.toml | 4 +- core/Cargo.toml | 6 +- core/tests/rpc.rs | 10 +- crate-features/Cargo.toml | 1 - programs/bpf/Cargo.lock | 531 ++++------------------------- rpc/Cargo.toml | 15 +- rpc/src/rpc.rs | 332 ++++++++++-------- rpc/src/rpc_service.rs | 47 +-- validator/Cargo.toml | 10 +- validator/src/admin_rpc_service.rs | 5 +- validator/src/dashboard.rs | 2 +- 12 files changed, 379 insertions(+), 1039 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba0bc9a71..636185f2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -189,7 +189,7 @@ dependencies = [ "instant", "pin-project 1.0.7", "rand 0.8.3", - "tokio 1.8.1", + "tokio", ] [[package]] @@ -824,17 +824,6 @@ dependencies = [ "crossbeam-utils 0.8.1", ] -[[package]] -name = "crossbeam-deque" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" -dependencies = [ - "crossbeam-epoch 0.8.2", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - [[package]] name = "crossbeam-deque" version = "0.8.0" @@ -842,25 +831,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.1", + "crossbeam-epoch", "crossbeam-utils 0.8.1", ] -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg 1.0.0", - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "lazy_static", - "maybe-uninit", - "memoffset 0.5.4", - "scopeguard", -] - [[package]] name = "crossbeam-epoch" version = "0.9.1" @@ -871,21 +845,10 @@ dependencies = [ "const_fn", "crossbeam-utils 0.8.1", "lazy_static", - "memoffset 0.6.1", + "memoffset", "scopeguard", ] -[[package]] -name = "crossbeam-queue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - [[package]] name = "crossbeam-utils" version = "0.7.2" @@ -1546,7 +1509,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.4", + "pin-project-lite", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -1656,7 +1619,7 @@ dependencies = [ "simpl", "smpl_jwt", "time 0.2.25", - "tokio 1.8.1", + "tokio", ] [[package]] @@ -1670,25 +1633,6 @@ dependencies = [ "scroll", ] -[[package]] -name = "h2" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b7246d7e4b979c03fa093da39cfb3617a96bbeee6310af63991668d7e843ff" -dependencies = [ - "bytes 0.5.4", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "log 0.4.14", - "slab", - "tokio 0.2.22", - "tokio-util 0.3.1", -] - [[package]] name = "h2" version = "0.3.0" @@ -1703,8 +1647,8 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.8.1", - "tokio-util 0.6.3", + "tokio", + "tokio-util", "tracing", "tracing-futures", ] @@ -1842,16 +1786,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" -dependencies = [ - "bytes 0.5.4", - "http", -] - [[package]] name = "http-body" version = "0.4.2" @@ -1860,7 +1794,7 @@ checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9" dependencies = [ "bytes 1.0.1", "http", - "pin-project-lite 0.2.4", + "pin-project-lite", ] [[package]] @@ -1900,30 +1834,6 @@ dependencies = [ "url 1.7.2", ] -[[package]] -name = "hyper" -version = "0.13.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" -dependencies = [ - "bytes 0.5.4", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.2.5", - "http", - "http-body 0.3.1", - "httparse", - "httpdate", - "itoa", - "pin-project 1.0.7", - "socket2", - "tokio 0.2.22", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "0.14.3" @@ -1934,15 +1844,15 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.3.0", + "h2", "http", - "http-body 0.4.2", + "http-body", "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.4", + "pin-project-lite", "socket2", - "tokio 1.8.1", + "tokio", "tower-service", "tracing", "want", @@ -1958,7 +1868,7 @@ dependencies = [ "hyper 0.14.3", "log 0.4.14", "rustls", - "tokio 1.8.1", + "tokio", "tokio-rustls", "webpki", ] @@ -1970,8 +1880,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ "hyper 0.14.3", - "pin-project-lite 0.2.4", - "tokio 1.8.1", + "pin-project-lite", + "tokio", "tokio-io-timeout", ] @@ -1984,7 +1894,7 @@ dependencies = [ "bytes 1.0.1", "hyper 0.14.3", "native-tls", - "tokio 1.8.1", + "tokio", "tokio-native-tls", ] @@ -2104,9 +2014,9 @@ dependencies = [ [[package]] name = "jsonrpc-client-transports" -version = "17.1.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2f81014e2706fde057e9dcb1036cf6bbf9418d972c597be5c7158c984656722" +checksum = "d2b99d4207e2a04fb4581746903c2bb7eb376f88de9c699d0f3e10feeac0cd3a" dependencies = [ "derive_more", "futures 0.3.15", @@ -2117,16 +2027,16 @@ dependencies = [ "parity-tokio-ipc", "serde", "serde_json", - "tokio 0.2.22", + "tokio", "url 1.7.2", "websocket", ] [[package]] name = "jsonrpc-core" -version = "17.1.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4467ab6dfa369b69e52bd0692e480c4d117410538526a57a304a0f2250fd95e" +checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" dependencies = [ "futures 0.3.15", "futures-executor", @@ -2139,9 +2049,9 @@ dependencies = [ [[package]] name = "jsonrpc-core-client" -version = "17.1.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c366c092d6bccc6e7ab44dd635a0f22ab2f201215339915fb7ff9508404f431" +checksum = "b51da17abecbdab3e3d4f26b01c5ec075e88d3abe3ab3b05dc9aa69392764ec0" dependencies = [ "futures 0.3.15", "jsonrpc-client-transports", @@ -2149,9 +2059,9 @@ dependencies = [ [[package]] name = "jsonrpc-derive" -version = "17.1.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34f6326966ebac440db89eba788f5a0e5ac2614b4b4bfbdc049a971e71040f32" +checksum = "5b939a78fa820cdfcb7ee7484466746a7377760970f6f9c6fe19f9edcc8a38d2" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", @@ -2161,12 +2071,12 @@ dependencies = [ [[package]] name = "jsonrpc-http-server" -version = "17.1.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522a047cac0958097ee71d047dd71cb84979fd2fa21c7a68fbe12736bef870a2" +checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff" dependencies = [ "futures 0.3.15", - "hyper 0.13.10", + "hyper 0.14.3", "jsonrpc-core", "jsonrpc-server-utils", "log 0.4.14", @@ -2177,9 +2087,9 @@ dependencies = [ [[package]] name = "jsonrpc-ipc-server" -version = "17.1.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b1d782052ef17051d12681bcc2fa2e9e1aabf3f634588125493d63ddcca6fe1" +checksum = "382bb0206323ca7cda3dcd7e245cea86d37d02457a02a975e3378fb149a48845" dependencies = [ "futures 0.3.15", "jsonrpc-core", @@ -2192,9 +2102,9 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" -version = "17.1.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14739e5523a40739882cc34a44ab2dd9356bce5ce102513f5984a9efbe342f3d" +checksum = "240f87695e6c6f62fb37f05c02c04953cf68d6408b8c1c89de85c7a0125b1011" dependencies = [ "futures 0.3.15", "jsonrpc-core", @@ -2207,26 +2117,27 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" -version = "17.1.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bce68fa279a2822b3619369cd024f8a4f8e5ce485468834f8679a3c7919aae2d" +checksum = "fa4fdea130485b572c39a460d50888beb00afb3e35de23ccd7fad8ff19f0e0d4" dependencies = [ - "bytes 0.5.4", + "bytes 1.0.1", "futures 0.3.15", "globset", "jsonrpc-core", "lazy_static", "log 0.4.14", - "tokio 0.2.22", - "tokio-util 0.3.1", + "tokio", + "tokio-stream", + "tokio-util", "unicase 2.6.0", ] [[package]] name = "jsonrpc-ws-server" -version = "17.1.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d267a8649ec37e4452dd7b3f48827c9cdf36de3a3539cf73242c222ba2eb50" +checksum = "f892c7d766369475ab7b0669f417906302d7c0fb521285c0a0c92e52e7c8e946" dependencies = [ "futures 0.3.15", "jsonrpc-core", @@ -2469,15 +2380,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" -dependencies = [ - "autocfg 1.0.0", -] - [[package]] name = "memoffset" version = "0.6.1" @@ -2556,29 +2458,6 @@ dependencies = [ "slab", ] -[[package]] -name = "mio-named-pipes" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" -dependencies = [ - "log 0.4.14", - "mio 0.6.22", - "miow 0.3.7", - "winapi 0.3.8", -] - -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio 0.6.22", -] - [[package]] name = "miow" version = "0.2.2" @@ -2866,25 +2745,23 @@ dependencies = [ [[package]] name = "parity-tokio-ipc" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7f6c69d7687501b2205fe51ade1d7b8797bb3aa141fe5bf13dd78c0483bc89" +checksum = "9981e32fb75e004cc148f5fb70342f393830e0a4aa62e3cc93b50976218d42b6" dependencies = [ "futures 0.3.15", "libc", "log 0.4.14", - "mio-named-pipes", - "miow 0.3.7", "rand 0.7.3", - "tokio 0.2.22", + "tokio", "winapi 0.3.8", ] [[package]] name = "parity-ws" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e02a625dd75084c2a7024f07c575b61b782f729d18702dabb3cdbf31911dc61" +checksum = "d0ab8a461779bd022964cae2b4989fa9c99deb270bec162da2125ec03c09fcaa" dependencies = [ "byteorder", "bytes 0.4.12", @@ -3083,12 +2960,6 @@ dependencies = [ "syn 1.0.67", ] -[[package]] -name = "pin-project-lite" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7505eeebd78492e0f6108f7171c4948dbb120ee8119d9d77d0afa5469bef67f" - [[package]] name = "pin-project-lite" version = "0.2.4" @@ -3521,7 +3392,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" dependencies = [ "autocfg 1.0.0", - "crossbeam-deque 0.8.0", + "crossbeam-deque", "either", "rayon-core", ] @@ -3533,7 +3404,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" dependencies = [ "crossbeam-channel", - "crossbeam-deque 0.8.0", + "crossbeam-deque", "crossbeam-utils 0.8.1", "lazy_static", "num_cpus", @@ -3646,7 +3517,7 @@ dependencies = [ "futures-core", "futures-util", "http", - "http-body 0.4.2", + "http-body", "hyper 0.14.3", "hyper-rustls", "hyper-tls", @@ -3657,12 +3528,12 @@ dependencies = [ "mime 0.3.16", "native-tls", "percent-encoding 2.1.0", - "pin-project-lite 0.2.4", + "pin-project-lite", "rustls", "serde", "serde_json", "serde_urlencoded", - "tokio 1.8.1", + "tokio", "tokio-native-tls", "tokio-rustls", "url 2.2.2", @@ -3981,7 +3852,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0bccbcf40c8938196944a3da0e133e031a33f4d6b72db3bda3cc556e361905d" dependencies = [ "lazy_static", - "parking_lot 0.11.1", + "parking_lot 0.10.2", "serial_test_derive 0.5.1", ] @@ -4272,7 +4143,7 @@ dependencies = [ "solana-runtime", "solana-sdk", "tarpc", - "tokio 1.8.1", + "tokio", "tokio-serde", ] @@ -4284,7 +4155,7 @@ dependencies = [ "serde", "solana-sdk", "tarpc", - "tokio 1.8.1", + "tokio", ] [[package]] @@ -4300,7 +4171,7 @@ dependencies = [ "solana-runtime", "solana-sdk", "tarpc", - "tokio 1.8.1", + "tokio", "tokio-serde", "tokio-stream", ] @@ -4517,7 +4388,7 @@ dependencies = [ "solana-version", "solana-vote-program", "thiserror", - "tokio 1.8.1", + "tokio", "tungstenite", "url 2.2.2", ] @@ -4617,7 +4488,7 @@ dependencies = [ "systemstat", "tempfile", "thiserror", - "tokio 0.2.22", + "tokio", "trees", ] @@ -4640,7 +4511,6 @@ dependencies = [ "serde", "syn 0.15.44", "syn 1.0.67", - "tokio 0.1.22", "winapi 0.3.8", ] @@ -4727,7 +4597,7 @@ dependencies = [ "solana-version", "spl-memo", "thiserror", - "tokio 1.8.1", + "tokio", ] [[package]] @@ -4963,7 +4833,7 @@ dependencies = [ "solana-vote-program", "tempfile", "thiserror", - "tokio 1.8.1", + "tokio", "tokio-stream", "trees", ] @@ -5002,7 +4872,7 @@ dependencies = [ "solana-version", "solana-vote-program", "tempfile", - "tokio 1.8.1", + "tokio", ] [[package]] @@ -5143,7 +5013,7 @@ dependencies = [ "solana-logger 1.8.0", "solana-sdk", "solana-version", - "tokio 1.8.1", + "tokio", "url 2.2.2", ] @@ -5329,7 +5199,7 @@ dependencies = [ "solana-sdk", "solana-vote-program", "thiserror", - "tokio 1.8.1", + "tokio", ] [[package]] @@ -5403,9 +5273,8 @@ dependencies = [ "solana-vote-program", "spl-token", "symlink", - "tokio 0.2.22", - "tokio 1.8.1", - "tokio-util 0.3.1", + "tokio", + "tokio-util", ] [[package]] @@ -6091,9 +5960,9 @@ dependencies = [ "static_assertions", "tarpc-plugins", "thiserror", - "tokio 1.8.1", + "tokio", "tokio-serde", - "tokio-util 0.6.3", + "tokio-util", "tracing", "tracing-opentelemetry", ] @@ -6294,57 +6163,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "0.1.22" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "mio 0.6.22", - "num_cpus", - "tokio-codec", - "tokio-current-thread", - "tokio-executor", - "tokio-fs", - "tokio-io", - "tokio-reactor", - "tokio-sync", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", - "tokio-udp", - "tokio-uds", -] - -[[package]] -name = "tokio" -version = "0.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" -dependencies = [ - "bytes 0.5.4", - "fnv", - "futures-core", - "iovec", - "lazy_static", - "libc", - "memchr", - "mio 0.6.22", - "mio-named-pipes", - "mio-uds", - "num_cpus", - "pin-project-lite 0.1.5", - "signal-hook-registry", - "slab", - "tokio-macros 0.2.6", - "winapi 0.3.8", -] - -[[package]] -name = "tokio" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c8b05dc14c75ea83d63dd391100353789f5f24b8b3866542a5e85c8be8e985" +checksum = "c2602b8af3767c285202012822834005f596c811042315fa7e9f5b12b2a43207" dependencies = [ "autocfg 1.0.0", "bytes 1.0.1", @@ -6354,9 +6175,9 @@ dependencies = [ "num_cpus", "once_cell", "parking_lot 0.11.1", - "pin-project-lite 0.2.4", + "pin-project-lite", "signal-hook-registry", - "tokio-macros 1.2.0", + "tokio-macros", "winapi 0.3.8", ] @@ -6371,16 +6192,6 @@ dependencies = [ "tokio-io", ] -[[package]] -name = "tokio-current-thread" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" -dependencies = [ - "futures 0.1.29", - "tokio-executor", -] - [[package]] name = "tokio-executor" version = "0.1.10" @@ -6391,17 +6202,6 @@ dependencies = [ "futures 0.1.29", ] -[[package]] -name = "tokio-fs" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" -dependencies = [ - "futures 0.1.29", - "tokio-io", - "tokio-threadpool", -] - [[package]] name = "tokio-io" version = "0.1.13" @@ -6419,19 +6219,8 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90c49f106be240de154571dd31fbe48acb10ba6c6dd6f6517ad603abffa42de9" dependencies = [ - "pin-project-lite 0.2.4", - "tokio 1.8.1", -] - -[[package]] -name = "tokio-macros" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" -dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.67", + "pin-project-lite", + "tokio", ] [[package]] @@ -6452,7 +6241,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", - "tokio 1.8.1", + "tokio", ] [[package]] @@ -6481,7 +6270,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ "rustls", - "tokio 1.8.1", + "tokio", "webpki", ] @@ -6507,8 +6296,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" dependencies = [ "futures-core", - "pin-project-lite 0.2.4", - "tokio 1.8.1", + "pin-project-lite", + "tokio", ] [[package]] @@ -6535,35 +6324,6 @@ dependencies = [ "tokio-reactor", ] -[[package]] -name = "tokio-threadpool" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" -dependencies = [ - "crossbeam-deque 0.7.3", - "crossbeam-queue", - "crossbeam-utils 0.7.2", - "futures 0.1.29", - "lazy_static", - "log 0.4.14", - "num_cpus", - "slab", - "tokio-executor", -] - -[[package]] -name = "tokio-timer" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.29", - "slab", - "tokio-executor", -] - [[package]] name = "tokio-tls" version = "0.2.1" @@ -6575,53 +6335,6 @@ dependencies = [ "tokio-io", ] -[[package]] -name = "tokio-udp" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "log 0.4.14", - "mio 0.6.22", - "tokio-codec", - "tokio-io", - "tokio-reactor", -] - -[[package]] -name = "tokio-uds" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5076db410d6fdc6523df7595447629099a1fdc47b3d9f896220780fa48faf798" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "iovec", - "libc", - "log 0.4.14", - "mio 0.6.22", - "mio-uds", - "tokio-codec", - "tokio-io", - "tokio-reactor", -] - -[[package]] -name = "tokio-util" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" -dependencies = [ - "bytes 0.5.4", - "futures-core", - "futures-sink", - "log 0.4.14", - "pin-project-lite 0.1.5", - "tokio 0.2.22", -] - [[package]] name = "tokio-util" version = "0.6.3" @@ -6632,9 +6345,9 @@ dependencies = [ "futures-core", "futures-sink", "log 0.4.14", - "pin-project-lite 0.2.4", + "pin-project-lite", "slab", - "tokio 1.8.1", + "tokio", ] [[package]] @@ -6658,19 +6371,19 @@ dependencies = [ "bytes 1.0.1", "futures-core", "futures-util", - "h2 0.3.0", + "h2", "http", - "http-body 0.4.2", + "http-body", "hyper 0.14.3", "hyper-timeout", "percent-encoding 2.1.0", "pin-project 1.0.7", "prost", "prost-derive", - "tokio 1.8.1", + "tokio", "tokio-rustls", "tokio-stream", - "tokio-util 0.6.3", + "tokio-util", "tower", "tower-layer", "tower-service", @@ -6702,9 +6415,9 @@ dependencies = [ "pin-project 1.0.7", "rand 0.8.3", "slab", - "tokio 1.8.1", + "tokio", "tokio-stream", - "tokio-util 0.6.3", + "tokio-util", "tower-layer", "tower-service", "tracing", @@ -6730,7 +6443,7 @@ checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" dependencies = [ "cfg-if 1.0.0", "log 0.4.14", - "pin-project-lite 0.2.4", + "pin-project-lite", "tracing-attributes", "tracing-core", ] diff --git a/client/Cargo.toml b/client/Cargo.toml index e4d884797..5a66c56ee 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -15,7 +15,7 @@ bincode = "1.3.3" bs58 = "0.4.0" clap = "2.33.0" indicatif = "0.16.2" -jsonrpc-core = "17.0.0" +jsonrpc-core = "18.0.0" log = "0.4.14" net2 = "0.2.37" rayon = "1.5.1" @@ -39,7 +39,7 @@ url = "2.2.2" [dev-dependencies] assert_matches = "1.5.0" -jsonrpc-http-server = "17.0.0" +jsonrpc-http-server = "18.0.0" solana-logger = { path = "../logger", version = "=1.8.0" } [package.metadata.docs.rs] diff --git a/core/Cargo.toml b/core/Cargo.toml index 1f617fb34..e9a05dd41 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -74,8 +74,8 @@ solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.8.0" } trees = "0.4.2" [dev-dependencies] -jsonrpc-core = "17.1.0" -jsonrpc-core-client = { version = "17.1.0", features = ["ipc", "ws"] } +jsonrpc-core = "18.0.0" +jsonrpc-core-client = { version = "18.0.0", features = ["ipc", "ws"] } matches = "0.1.6" num_cpus = "1.13.0" reqwest = { version = "0.11.4", default-features = false, features = ["blocking", "rustls-tls", "json"] } @@ -86,7 +86,7 @@ solana-version = { path = "../version", version = "=1.8.0" } static_assertions = "1.1.0" symlink = "0.1.0" systemstat = "0.1.8" -tokio_02 = { version = "0.2", package = "tokio", features = ["full"] } +tokio = { version = "1", features = ["full"] } [build-dependencies] rustc_version = "0.4" diff --git a/core/tests/rpc.rs b/core/tests/rpc.rs index 77e1deabf..6efefdf28 100644 --- a/core/tests/rpc.rs +++ b/core/tests/rpc.rs @@ -30,7 +30,7 @@ use std::{ thread::sleep, time::{Duration, Instant}, }; -use tokio_02::runtime::Runtime; +use tokio::runtime::Runtime; macro_rules! json_req { ($method: expr, $params: expr) => {{ @@ -169,7 +169,7 @@ fn test_rpc_slot_updates() { let connect = ws::try_connect::(&rpc_pubsub_url).unwrap(); let client = connect.await.unwrap(); - tokio_02::spawn(async move { + tokio::spawn(async move { let mut update_sub = client.slots_updates_subscribe().unwrap(); loop { let response = update_sub.next().await.unwrap(); @@ -279,7 +279,7 @@ fn test_rpc_subscriptions() { ) .unwrap_or_else(|err| panic!("sig sub err: {:#?}", err)); - tokio_02::spawn(async move { + tokio::spawn(async move { let response = sig_sub.next().await.unwrap(); status_sender .send((sig.clone(), response.unwrap())) @@ -299,7 +299,7 @@ fn test_rpc_subscriptions() { }), ) .unwrap_or_else(|err| panic!("acct sub err: {:#?}", err)); - tokio_02::spawn(async move { + tokio::spawn(async move { let response = client_sub.next().await.unwrap(); account_sender.send(response.unwrap()).unwrap(); }); @@ -309,7 +309,7 @@ fn test_rpc_subscriptions() { let mut slot_sub = client .slot_subscribe() .unwrap_or_else(|err| panic!("sig sub err: {:#?}", err)); - tokio_02::spawn(async move { + tokio::spawn(async move { let _response = slot_sub.next().await.unwrap(); ready_sender.send(()).unwrap(); }); diff --git a/crate-features/Cargo.toml b/crate-features/Cargo.toml index 8193bb957..89b6e3033 100644 --- a/crate-features/Cargo.toml +++ b/crate-features/Cargo.toml @@ -25,7 +25,6 @@ serde = { version = "1.0.100", features = ["rc"] } ed25519-dalek = { version = "=1.0.1", features = ["serde"] } syn_0_15 = { package = "syn", version = "0.15.42", features = ["extra-traits", "fold", "full"] } syn_1_0 = { package = "syn", version = "1.0.3", features = ["extra-traits", "fold", "full"] } -tokio = { version = "0.1.22",features=["bytes", "codec", "default", "fs", "io", "mio", "num_cpus", "reactor", "rt-full", "sync", "tcp", "timer", "tokio-codec", "tokio-current-thread", "tokio-executor", "tokio-io", "tokio-io", "tokio-reactor", "tokio-tcp", "tokio-tcp", "tokio-threadpool", "tokio-timer", "tokio-udp", "tokio-uds", "udp", "uds"] } winapi = { version = "0.3.8", features=["basetsd", "consoleapi", "errhandlingapi", "fileapi", "handleapi", "impl-debug", "impl-default", "knownfolders", "libloaderapi", "memoryapi", "minwinbase", "minwindef", "ntdef", "ntsecapi", "ntstatus", "objbase", "processenv", "processthreadsapi", "profileapi", "shlobj", "std", "synchapi", "sysinfoapi", "timezoneapi", "utilapiset", "winbase", "wincon", "windef", "winerror", "winnls", "winnt", "winreg", "winsock2", "winuser", "ws2def", "ws2ipdef", "ws2tcpip", "wtypesbase"] } [package.metadata.docs.rs] diff --git a/programs/bpf/Cargo.lock b/programs/bpf/Cargo.lock index 498571cdb..272f973f1 100644 --- a/programs/bpf/Cargo.lock +++ b/programs/bpf/Cargo.lock @@ -54,7 +54,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" dependencies = [ - "winapi 0.3.8", + "winapi", ] [[package]] @@ -106,7 +106,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -354,7 +354,7 @@ dependencies = [ "num-traits", "serde", "time", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -381,15 +381,6 @@ dependencies = [ "vec_map", ] -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - [[package]] name = "combine" version = "3.8.1" @@ -415,7 +406,7 @@ dependencies = [ "regex", "terminal_size", "unicode-width", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -455,18 +446,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.1", -] - -[[package]] -name = "crossbeam-deque" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" -dependencies = [ - "crossbeam-epoch 0.8.2", - "crossbeam-utils 0.7.2", - "maybe-uninit", + "crossbeam-utils", ] [[package]] @@ -476,23 +456,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.1", - "crossbeam-utils 0.8.1", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "lazy_static", - "maybe-uninit", - "memoffset 0.5.4", - "scopeguard", + "crossbeam-epoch", + "crossbeam-utils", ] [[package]] @@ -503,34 +468,12 @@ checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d" dependencies = [ "cfg-if 1.0.0", "const_fn", - "crossbeam-utils 0.8.1", + "crossbeam-utils", "lazy_static", - "memoffset 0.6.1", + "memoffset", "scopeguard", ] -[[package]] -name = "crossbeam-queue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "lazy_static", -] - [[package]] name = "crossbeam-utils" version = "0.8.1" @@ -692,7 +635,7 @@ checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -857,7 +800,7 @@ dependencies = [ "cfg-if 0.1.10", "libc", "redox_syscall 0.1.56", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -888,28 +831,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - -[[package]] -name = "futures" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" - [[package]] name = "futures" version = "0.3.12" @@ -1031,7 +952,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e692e296bfac1d2533ef168d0b60ff5897b8b70a4009276834014dd8924cc028" dependencies = [ "libc", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -1087,7 +1008,7 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.8.1", + "tokio", "tokio-util", "tracing", ] @@ -1240,7 +1161,7 @@ dependencies = [ "itoa", "pin-project", "socket2", - "tokio 1.8.1", + "tokio", "tower-service", "tracing", "want", @@ -1256,7 +1177,7 @@ dependencies = [ "hyper", "log", "rustls", - "tokio 1.8.1", + "tokio", "tokio-rustls", "webpki", ] @@ -1362,11 +1283,13 @@ dependencies = [ [[package]] name = "jsonrpc-core" -version = "17.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07569945133257ff557eb37b015497104cea61a2c9edaf126c1cbd6e8332397f" +checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" dependencies = [ - "futures 0.3.12", + "futures", + "futures-executor", + "futures-util", "log", "serde", "serde_derive", @@ -1379,16 +1302,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -1411,7 +1324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" dependencies = [ "cfg-if 1.0.0", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -1487,15 +1400,6 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - [[package]] name = "lock_api" version = "0.4.2" @@ -1520,12 +1424,6 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "memchr" version = "2.4.0" @@ -1550,15 +1448,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.6.1" @@ -1584,25 +1473,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "mio" -version = "0.6.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow 0.2.2", - "net2", - "slab", - "winapi 0.2.8", -] - [[package]] name = "mio" version = "0.7.13" @@ -1611,32 +1481,9 @@ checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" dependencies = [ "libc", "log", - "miow 0.3.7", + "miow", "ntapi", - "winapi 0.3.8", -] - -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio 0.6.22", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "winapi", ] [[package]] @@ -1645,7 +1492,7 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" dependencies = [ - "winapi 0.3.8", + "winapi", ] [[package]] @@ -1656,7 +1503,7 @@ checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" dependencies = [ "cfg-if 0.1.10", "libc", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -1677,7 +1524,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a31937dea023539c72ddae0e3571deadc1414b300483fa7aaec176168cfa9d2" dependencies = [ - "winapi 0.3.8", + "winapi", ] [[package]] @@ -1771,7 +1618,7 @@ version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" dependencies = [ - "parking_lot 0.11.1", + "parking_lot", ] [[package]] @@ -1787,7 +1634,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91cea1dfd50064e52db033179952d18c770cbc5dfefc8eba45d619357ba3914" dependencies = [ "async-trait", - "futures 0.3.12", + "futures", "js-sys", "lazy_static", "percent-encoding", @@ -1820,17 +1667,6 @@ dependencies = [ "syn 1.0.67", ] -[[package]] -name = "parking_lot" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" -dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.6.2", - "rustc_version 0.2.3", -] - [[package]] name = "parking_lot" version = "0.11.1" @@ -1838,23 +1674,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", - "lock_api 0.4.2", - "parking_lot_core 0.8.2", -] - -[[package]] -name = "parking_lot_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" -dependencies = [ - "cfg-if 0.1.10", - "cloudabi", - "libc", - "redox_syscall 0.1.56", - "rustc_version 0.2.3", - "smallvec 0.6.14", - "winapi 0.3.8", + "lock_api", + "parking_lot_core", ] [[package]] @@ -1867,8 +1688,8 @@ dependencies = [ "instant", "libc", "redox_syscall 0.1.56", - "smallvec 1.6.1", - "winapi 0.3.8", + "smallvec", + "winapi", ] [[package]] @@ -2139,7 +1960,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" dependencies = [ "autocfg", - "crossbeam-deque 0.8.0", + "crossbeam-deque", "either", "rayon-core", ] @@ -2151,8 +1972,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" dependencies = [ "crossbeam-channel", - "crossbeam-deque 0.8.0", - "crossbeam-utils 0.8.1", + "crossbeam-deque", + "crossbeam-utils", "lazy_static", "num_cpus", ] @@ -2205,7 +2026,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" dependencies = [ - "winapi 0.3.8", + "winapi", ] [[package]] @@ -2234,7 +2055,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "tokio 1.8.1", + "tokio", "tokio-rustls", "url", "wasm-bindgen", @@ -2256,7 +2077,7 @@ dependencies = [ "spin", "untrusted", "web-sys", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -2266,7 +2087,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" dependencies = [ "libc", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -2522,15 +2343,6 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" -[[package]] -name = "smallvec" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] - [[package]] name = "smallvec" version = "1.6.1" @@ -2546,7 +2358,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall 0.1.56", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -2577,13 +2389,13 @@ dependencies = [ "bincode", "borsh", "borsh-derive", - "futures 0.3.12", - "mio 0.7.13", + "futures", + "mio", "solana-banks-interface", "solana-program 1.8.0", "solana-sdk", "tarpc", - "tokio 1.8.1", + "tokio", "tokio-serde", ] @@ -2591,7 +2403,7 @@ dependencies = [ name = "solana-banks-interface" version = "1.8.0" dependencies = [ - "mio 0.7.13", + "mio", "serde", "solana-sdk", "tarpc", @@ -2602,15 +2414,15 @@ name = "solana-banks-server" version = "1.8.0" dependencies = [ "bincode", - "futures 0.3.12", + "futures", "log", - "mio 0.7.13", + "mio", "solana-banks-interface", "solana-metrics", "solana-runtime", "solana-sdk", "tarpc", - "tokio 1.8.1", + "tokio", "tokio-serde", "tokio-stream", ] @@ -2644,7 +2456,7 @@ dependencies = [ "elf", "itertools 0.10.1", "log", - "miow 0.3.7", + "miow", "net2", "solana-account-decoder", "solana-bpf-loader-program", @@ -3016,7 +2828,7 @@ dependencies = [ "solana-version", "solana-vote-program", "thiserror", - "tokio 1.8.1", + "tokio", "tungstenite", "url", ] @@ -3060,8 +2872,7 @@ dependencies = [ "serde", "syn 0.15.44", "syn 1.0.67", - "tokio 0.1.22", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -3082,7 +2893,7 @@ dependencies = [ "solana-version", "spl-memo", "thiserror", - "tokio 1.8.1", + "tokio", ] [[package]] @@ -3201,7 +3012,7 @@ dependencies = [ "solana-logger 1.8.0", "solana-sdk", "solana-version", - "tokio 1.8.1", + "tokio", "url", ] @@ -3283,7 +3094,7 @@ dependencies = [ "chrono", "chrono-humanize", "log", - "mio 0.7.13", + "mio", "serde", "serde_derive", "solana-banks-client", @@ -3294,7 +3105,7 @@ dependencies = [ "solana-sdk", "solana-vote-program", "thiserror", - "tokio 1.8.1", + "tokio", ] [[package]] @@ -3316,7 +3127,7 @@ dependencies = [ "log", "num-derive", "num-traits", - "parking_lot 0.11.1", + "parking_lot", "qstring", "semver 1.0.3", "solana-sdk", @@ -3670,7 +3481,7 @@ checksum = "82cb992a07637db1bcc0e4511d0c58c3f3a03f509d7c6cc2826f7646deac2032" dependencies = [ "anyhow", "fnv", - "futures 0.3.12", + "futures", "humantime", "opentelemetry", "pin-project", @@ -3679,7 +3490,7 @@ dependencies = [ "static_assertions", "tarpc-plugins", "thiserror", - "tokio 1.8.1", + "tokio", "tokio-serde", "tokio-util", "tracing", @@ -3708,7 +3519,7 @@ dependencies = [ "rand 0.8.2", "redox_syscall 0.2.4", "remove_dir_all", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -3727,7 +3538,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bd2d183bd3fac5f5fe38ddbeb4dc9aec4a39a9d7d59e7491d900302da01cbe1" dependencies = [ "libc", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -3775,7 +3586,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "winapi 0.3.8", + "winapi", ] [[package]] @@ -3811,30 +3622,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" -[[package]] -name = "tokio" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "mio 0.6.22", - "num_cpus", - "tokio-codec", - "tokio-current-thread", - "tokio-executor", - "tokio-fs", - "tokio-io", - "tokio-reactor", - "tokio-sync", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", - "tokio-udp", - "tokio-uds", -] - [[package]] name = "tokio" version = "1.8.1" @@ -3845,67 +3632,14 @@ dependencies = [ "bytes 1.0.1", "libc", "memchr", - "mio 0.7.13", + "mio", "num_cpus", "once_cell", - "parking_lot 0.11.1", + "parking_lot", "pin-project-lite 0.2.4", "signal-hook-registry", "tokio-macros", - "winapi 0.3.8", -] - -[[package]] -name = "tokio-codec" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "tokio-io", -] - -[[package]] -name = "tokio-current-thread" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" -dependencies = [ - "futures 0.1.29", - "tokio-executor", -] - -[[package]] -name = "tokio-executor" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.29", -] - -[[package]] -name = "tokio-fs" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" -dependencies = [ - "futures 0.1.29", - "tokio-io", - "tokio-threadpool", -] - -[[package]] -name = "tokio-io" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "log", + "winapi", ] [[package]] @@ -3919,25 +3653,6 @@ dependencies = [ "syn 1.0.67", ] -[[package]] -name = "tokio-reactor" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.29", - "lazy_static", - "log", - "mio 0.6.22", - "num_cpus", - "parking_lot 0.9.0", - "slab", - "tokio-executor", - "tokio-io", - "tokio-sync", -] - [[package]] name = "tokio-rustls" version = "0.22.0" @@ -3945,7 +3660,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ "rustls", - "tokio 1.8.1", + "tokio", "webpki", ] @@ -3972,93 +3687,7 @@ checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" dependencies = [ "futures-core", "pin-project-lite 0.2.4", - "tokio 1.8.1", -] - -[[package]] -name = "tokio-sync" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" -dependencies = [ - "fnv", - "futures 0.1.29", -] - -[[package]] -name = "tokio-tcp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "iovec", - "mio 0.6.22", - "tokio-io", - "tokio-reactor", -] - -[[package]] -name = "tokio-threadpool" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" -dependencies = [ - "crossbeam-deque 0.7.3", - "crossbeam-queue", - "crossbeam-utils 0.7.2", - "futures 0.1.29", - "lazy_static", - "log", - "num_cpus", - "slab", - "tokio-executor", -] - -[[package]] -name = "tokio-timer" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.29", - "slab", - "tokio-executor", -] - -[[package]] -name = "tokio-udp" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "log", - "mio 0.6.22", - "tokio-codec", - "tokio-io", - "tokio-reactor", -] - -[[package]] -name = "tokio-uds" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5076db410d6fdc6523df7595447629099a1fdc47b3d9f896220780fa48faf798" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "iovec", - "libc", - "log", - "mio 0.6.22", - "mio-uds", - "tokio-codec", - "tokio-io", - "tokio-reactor", + "tokio", ] [[package]] @@ -4073,7 +3702,7 @@ dependencies = [ "log", "pin-project-lite 0.2.4", "slab", - "tokio 1.8.1", + "tokio", ] [[package]] @@ -4282,7 +3911,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" dependencies = [ "same-file", - "winapi 0.3.8", + "winapi", "winapi-util", ] @@ -4405,12 +4034,6 @@ dependencies = [ "webpki", ] -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.8" @@ -4421,12 +4044,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -4439,7 +4056,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.8", + "winapi", ] [[package]] @@ -4454,17 +4071,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" dependencies = [ - "winapi 0.3.8", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", + "winapi", ] [[package]] diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 31eb22484..02ffcefbc 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -15,12 +15,12 @@ bincode = "1.3.3" bs58 = "0.4.0" crossbeam-channel = "0.5" itertools = "0.10.1" -jsonrpc-core = "17.1.0" -jsonrpc-core-client = { version = "17.1.0", features = ["ipc", "ws"] } -jsonrpc-derive = "17.1.0" -jsonrpc-http-server = "17.1.0" -jsonrpc-pubsub = "17.1.0" -jsonrpc-ws-server = "17.1.0" +jsonrpc-core = "18.0.0" +jsonrpc-core-client = { version = "18.0.0", features = ["ipc", "ws"] } +jsonrpc-derive = "18.0.0" +jsonrpc-http-server = "18.0.0" +jsonrpc-pubsub = "18.0.0" +jsonrpc-ws-server = "18.0.0" libc = "0.2.98" log = "0.4.14" regex = "1.5.4" @@ -46,8 +46,7 @@ solana-version = { path = "../version", version = "=1.8.0" } solana-vote-program = { path = "../programs/vote", version = "=1.8.0" } spl-token-v2-0 = { package = "spl-token", version = "=3.2.0", features = ["no-entrypoint"] } tokio = { version = "1", features = ["full"] } -tokio_02 = { version = "0.2", package = "tokio", features = ["full"] } -tokio-util = { version = "0.3", features = ["codec"] } # This crate needs to stay in sync with tokio_02, until that dependency can be removed +tokio-util = { version = "0.6", features = ["codec"] } [dev-dependencies] serial_test = "0.4.0" diff --git a/rpc/src/rpc.rs b/rpc/src/rpc.rs index 2bedab22d..891e24e18 100644 --- a/rpc/src/rpc.rs +++ b/rpc/src/rpc.rs @@ -9,7 +9,7 @@ use { send_transaction_service::{SendTransactionService, TransactionInfo}, }, bincode::{config::Options, serialize}, - jsonrpc_core::{types::error, Error, Metadata, Result}, + jsonrpc_core::{futures::future, types::error, BoxFuture, Error, Metadata, Result}, jsonrpc_derive::rpc, serde::{Deserialize, Serialize}, solana_account_decoder::{ @@ -91,7 +91,6 @@ use { }, time::Duration, }, - tokio::runtime::Runtime, }; type RpcCustomResult = std::result::Result; @@ -157,7 +156,6 @@ pub struct JsonRpcRequestProcessor { cluster_info: Arc, genesis_hash: Hash, transaction_sender: Arc>>, - runtime: Arc, bigtable_ledger_storage: Option, optimistically_confirmed_bank: Arc>, largest_accounts_cache: Arc>, @@ -243,7 +241,6 @@ impl JsonRpcRequestProcessor { health: Arc, cluster_info: Arc, genesis_hash: Hash, - runtime: Arc, bigtable_ledger_storage: Option, optimistically_confirmed_bank: Arc>, largest_accounts_cache: Arc>, @@ -264,7 +261,6 @@ impl JsonRpcRequestProcessor { cluster_info, genesis_hash, transaction_sender: Arc::new(Mutex::new(sender)), - runtime, bigtable_ledger_storage, optimistically_confirmed_bank, largest_accounts_cache, @@ -309,7 +305,6 @@ impl JsonRpcRequestProcessor { cluster_info, genesis_hash, transaction_sender: Arc::new(Mutex::new(sender)), - runtime: Arc::new(Runtime::new().expect("Runtime")), bigtable_ledger_storage: None, optimistically_confirmed_bank: Arc::new(RwLock::new(OptimisticallyConfirmedBank { bank: bank.clone(), @@ -404,14 +399,14 @@ impl JsonRpcRequestProcessor { }) } - pub fn get_inflation_reward( + pub async fn get_inflation_reward( &self, addresses: Vec, config: Option, ) -> Result>> { let config = config.unwrap_or_default(); let epoch_schedule = self.get_epoch_schedule(); - let first_available_block = self.get_first_available_block(); + let first_available_block = self.get_first_available_block().await; let epoch = config.epoch.unwrap_or_else(|| { epoch_schedule .get_epoch(self.get_slot(config.commitment)) @@ -436,16 +431,20 @@ impl JsonRpcRequestProcessor { } let first_confirmed_block_in_epoch = *self - .get_blocks_with_limit(first_slot_in_epoch, 1, config.commitment)? + .get_blocks_with_limit(first_slot_in_epoch, 1, config.commitment) + .await? .get(0) .ok_or(RpcCustomError::BlockNotAvailable { slot: first_slot_in_epoch, })?; - let first_confirmed_block = if let Ok(Some(first_confirmed_block)) = self.get_block( - first_confirmed_block_in_epoch, - Some(RpcBlockConfig::rewards_with_commitment(config.commitment).into()), - ) { + let first_confirmed_block = if let Ok(Some(first_confirmed_block)) = self + .get_block( + first_confirmed_block_in_epoch, + Some(RpcBlockConfig::rewards_with_commitment(config.commitment).into()), + ) + .await + { first_confirmed_block } else { return Err(RpcCustomError::BlockNotAvailable { @@ -929,7 +928,7 @@ impl JsonRpcRequestProcessor { Ok(()) } - pub fn get_block( + pub async fn get_block( &self, slot: Slot, config: Option>, @@ -956,9 +955,8 @@ impl JsonRpcRequestProcessor { self.check_blockstore_root(&result, slot)?; if result.is_err() { if let Some(bigtable_ledger_storage) = &self.bigtable_ledger_storage { - let bigtable_result = self - .runtime - .block_on(bigtable_ledger_storage.get_confirmed_block(slot)); + let bigtable_result = + bigtable_ledger_storage.get_confirmed_block(slot).await; self.check_bigtable_result(&bigtable_result)?; return Ok(bigtable_result.ok().map(|confirmed_block| { confirmed_block.configure(encoding, transaction_details, show_rewards) @@ -1004,7 +1002,7 @@ impl JsonRpcRequestProcessor { Err(RpcCustomError::BlockNotAvailable { slot }.into()) } - pub fn get_blocks( + pub async fn get_blocks( &self, start_slot: Slot, end_slot: Option, @@ -1043,12 +1041,9 @@ impl JsonRpcRequestProcessor { // [start_slot..end_slot] can be fetched from BigTable. This range should not ever run // into unfinalized confirmed blocks due to MAX_GET_CONFIRMED_BLOCKS_RANGE if let Some(bigtable_ledger_storage) = &self.bigtable_ledger_storage { - return self - .runtime - .block_on( - bigtable_ledger_storage - .get_confirmed_blocks(start_slot, (end_slot - start_slot) as usize + 1), // increment limit by 1 to ensure returned range is inclusive of both start_slot and end_slot - ) + return bigtable_ledger_storage + .get_confirmed_blocks(start_slot, (end_slot - start_slot) as usize + 1) // increment limit by 1 to ensure returned range is inclusive of both start_slot and end_slot + .await .map(|mut bigtable_blocks| { bigtable_blocks.retain(|&slot| slot <= end_slot); bigtable_blocks @@ -1085,7 +1080,7 @@ impl JsonRpcRequestProcessor { Ok(blocks) } - pub fn get_blocks_with_limit( + pub async fn get_blocks_with_limit( &self, start_slot: Slot, limit: usize, @@ -1108,9 +1103,9 @@ impl JsonRpcRequestProcessor { // range can be fetched from BigTable. This range should not ever run into unfinalized // confirmed blocks due to MAX_GET_CONFIRMED_BLOCKS_RANGE if let Some(bigtable_ledger_storage) = &self.bigtable_ledger_storage { - return Ok(self - .runtime - .block_on(bigtable_ledger_storage.get_confirmed_blocks(start_slot, limit)) + return Ok(bigtable_ledger_storage + .get_confirmed_blocks(start_slot, limit) + .await .unwrap_or_default()); } } @@ -1149,7 +1144,7 @@ impl JsonRpcRequestProcessor { Ok(blocks) } - pub fn get_block_time(&self, slot: Slot) -> Result> { + pub async fn get_block_time(&self, slot: Slot) -> Result> { if slot <= self .block_commitment_cache @@ -1161,9 +1156,7 @@ impl JsonRpcRequestProcessor { self.check_blockstore_root(&result, slot)?; if result.is_err() || matches!(result, Ok(None)) { if let Some(bigtable_ledger_storage) = &self.bigtable_ledger_storage { - let bigtable_result = self - .runtime - .block_on(bigtable_ledger_storage.get_confirmed_block(slot)); + let bigtable_result = bigtable_ledger_storage.get_confirmed_block(slot).await; self.check_bigtable_result(&bigtable_result)?; return Ok(bigtable_result .ok() @@ -1208,7 +1201,7 @@ impl JsonRpcRequestProcessor { Some(status) } - pub fn get_signature_statuses( + pub async fn get_signature_statuses( &self, signatures: Vec, config: Option, @@ -1228,7 +1221,8 @@ impl JsonRpcRequestProcessor { let status = if let Some(status) = self.get_transaction_status(signature, &bank) { Some(status) } else if self.config.enable_rpc_transaction_history && search_transaction_history { - self.blockstore + if let Some(status) = self + .blockstore .get_rooted_transaction_status(signature) .map_err(|_| Error::internal_error())? .filter(|(slot, _status_meta)| { @@ -1248,16 +1242,17 @@ impl JsonRpcRequestProcessor { confirmation_status: Some(TransactionConfirmationStatus::Finalized), } }) - .or_else(|| { - if let Some(bigtable_ledger_storage) = &self.bigtable_ledger_storage { - self.runtime - .block_on(bigtable_ledger_storage.get_signature_status(&signature)) - .map(Some) - .unwrap_or(None) - } else { - None - } - }) + { + Some(status) + } else if let Some(bigtable_ledger_storage) = &self.bigtable_ledger_storage { + bigtable_ledger_storage + .get_signature_status(&signature) + .await + .map(Some) + .unwrap_or(None) + } else { + None + } } else { None }; @@ -1303,7 +1298,7 @@ impl JsonRpcRequestProcessor { }) } - pub fn get_transaction( + pub async fn get_transaction( &self, signature: Signature, config: Option>, @@ -1351,9 +1346,9 @@ impl JsonRpcRequestProcessor { } None => { if let Some(bigtable_ledger_storage) = &self.bigtable_ledger_storage { - return Ok(self - .runtime - .block_on(bigtable_ledger_storage.get_confirmed_transaction(&signature)) + return Ok(bigtable_ledger_storage + .get_confirmed_transaction(&signature) + .await .unwrap_or(None) .map(|confirmed| confirmed.encode(encoding))); } @@ -1389,7 +1384,7 @@ impl JsonRpcRequestProcessor { } } - pub fn get_signatures_for_address( + pub async fn get_signatures_for_address( &self, address: Pubkey, mut before: Option, @@ -1425,14 +1420,14 @@ impl JsonRpcRequestProcessor { before = results.last().map(|x| x.signature); } - let bigtable_results = self.runtime.block_on( - bigtable_ledger_storage.get_confirmed_signatures_for_address( + let bigtable_results = bigtable_ledger_storage + .get_confirmed_signatures_for_address( &address, before.as_ref(), until.as_ref(), limit, - ), - ); + ) + .await; match bigtable_results { Ok(bigtable_results) => { results.extend(bigtable_results.into_iter().map(|x| x.0)); @@ -1467,16 +1462,16 @@ impl JsonRpcRequestProcessor { } } - pub fn get_first_available_block(&self) -> Slot { + pub async fn get_first_available_block(&self) -> Slot { let slot = self .blockstore .get_first_available_block() .unwrap_or_default(); if let Some(bigtable_ledger_storage) = &self.bigtable_ledger_storage { - let bigtable_slot = self - .runtime - .block_on(bigtable_ledger_storage.get_first_available_block()) + let bigtable_slot = bigtable_ledger_storage + .get_first_available_block() + .await .unwrap_or(None) .unwrap_or(slot); @@ -1957,6 +1952,28 @@ fn verify_token_account_filter( } } +fn verify_and_parse_signatures_for_address_params( + address: String, + before: Option, + until: Option, + limit: Option, +) -> Result<(Pubkey, Option, Option, usize)> { + let address = verify_pubkey(&address)?; + let before = before + .map(|ref before| verify_signature(before)) + .transpose()?; + let until = until.map(|ref until| verify_signature(until)).transpose()?; + let limit = limit.unwrap_or(MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS2_LIMIT); + + if limit == 0 || limit > MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS2_LIMIT { + return Err(Error::invalid_params(format!( + "Invalid limit; max {}", + MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS2_LIMIT + ))); + } + Ok((address, before, until, limit)) +} + fn check_is_at_least_confirmed(commitment: CommitmentConfig) -> Result<()> { if !commitment.is_at_least_confirmed() { return Err(Error::invalid_params( @@ -2955,7 +2972,7 @@ pub mod rpc_full { meta: Self::Metadata, address_strs: Vec, config: Option, - ) -> Result>>; + ) -> BoxFuture>>>; #[rpc(meta, name = "getClusterNodes")] fn get_cluster_nodes(&self, meta: Self::Metadata) -> Result>; @@ -2976,7 +2993,7 @@ pub mod rpc_full { meta: Self::Metadata, signature_strs: Vec, config: Option, - ) -> Result>>>; + ) -> BoxFuture>>>>; #[rpc(meta, name = "getMaxRetransmitSlot")] fn get_max_retransmit_slot(&self, meta: Self::Metadata) -> Result; @@ -3018,11 +3035,14 @@ pub mod rpc_full { meta: Self::Metadata, slot: Slot, config: Option>, - ) -> Result>; + ) -> BoxFuture>>; #[rpc(meta, name = "getBlockTime")] - fn get_block_time(&self, meta: Self::Metadata, slot: Slot) - -> Result>; + fn get_block_time( + &self, + meta: Self::Metadata, + slot: Slot, + ) -> BoxFuture>>; #[rpc(meta, name = "getBlocks")] fn get_blocks( @@ -3031,7 +3051,7 @@ pub mod rpc_full { start_slot: Slot, config: Option, commitment: Option, - ) -> Result>; + ) -> BoxFuture>>; #[rpc(meta, name = "getBlocksWithLimit")] fn get_blocks_with_limit( @@ -3040,7 +3060,7 @@ pub mod rpc_full { start_slot: Slot, limit: usize, commitment: Option, - ) -> Result>; + ) -> BoxFuture>>; #[rpc(meta, name = "getTransaction")] fn get_transaction( @@ -3048,7 +3068,7 @@ pub mod rpc_full { meta: Self::Metadata, signature_str: String, config: Option>, - ) -> Result>; + ) -> BoxFuture>>; #[rpc(meta, name = "getSignaturesForAddress")] fn get_signatures_for_address( @@ -3056,10 +3076,10 @@ pub mod rpc_full { meta: Self::Metadata, address: String, config: Option, - ) -> Result>; + ) -> BoxFuture>>; #[rpc(meta, name = "getFirstAvailableBlock")] - fn get_first_available_block(&self, meta: Self::Metadata) -> Result; + fn get_first_available_block(&self, meta: Self::Metadata) -> BoxFuture>; } pub struct FullImpl; @@ -3151,22 +3171,27 @@ pub mod rpc_full { meta: Self::Metadata, signature_strs: Vec, config: Option, - ) -> Result>>> { + ) -> BoxFuture>>>> { debug!( "get_signature_statuses rpc request received: {:?}", signature_strs.len() ); if signature_strs.len() > MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS { - return Err(Error::invalid_params(format!( + return Box::pin(future::err(Error::invalid_params(format!( "Too many inputs provided; max {}", MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS - ))); + )))); } let mut signatures: Vec = vec![]; for signature_str in signature_strs { - signatures.push(verify_signature(&signature_str)?); + match verify_signature(&signature_str) { + Ok(signature) => { + signatures.push(signature); + } + Err(err) => return Box::pin(future::err(err)), + } } - meta.get_signature_statuses(signatures, config) + Box::pin(async move { meta.get_signature_statuses(signatures, config).await }) } fn get_max_retransmit_slot(&self, meta: Self::Metadata) -> Result { @@ -3425,9 +3450,9 @@ pub mod rpc_full { meta: Self::Metadata, slot: Slot, config: Option>, - ) -> Result> { + ) -> BoxFuture>> { debug!("get_block rpc request received: {:?}", slot); - meta.get_block(slot, config) + Box::pin(async move { meta.get_block(slot, config).await }) } fn get_blocks( @@ -3436,14 +3461,17 @@ pub mod rpc_full { start_slot: Slot, config: Option, commitment: Option, - ) -> Result> { + ) -> BoxFuture>> { let (end_slot, maybe_commitment) = config.map(|config| config.unzip()).unwrap_or_default(); debug!( "get_blocks rpc request received: {}-{:?}", start_slot, end_slot ); - meta.get_blocks(start_slot, end_slot, commitment.or(maybe_commitment)) + Box::pin(async move { + meta.get_blocks(start_slot, end_slot, commitment.or(maybe_commitment)) + .await + }) } fn get_blocks_with_limit( @@ -3452,20 +3480,23 @@ pub mod rpc_full { start_slot: Slot, limit: usize, commitment: Option, - ) -> Result> { + ) -> BoxFuture>> { debug!( "get_blocks_with_limit rpc request received: {}-{}", start_slot, limit, ); - meta.get_blocks_with_limit(start_slot, limit, commitment) + Box::pin(async move { + meta.get_blocks_with_limit(start_slot, limit, commitment) + .await + }) } fn get_block_time( &self, meta: Self::Metadata, slot: Slot, - ) -> Result> { - meta.get_block_time(slot) + ) -> BoxFuture>> { + Box::pin(async move { meta.get_block_time(slot).await }) } fn get_transaction( @@ -3473,10 +3504,13 @@ pub mod rpc_full { meta: Self::Metadata, signature_str: String, config: Option>, - ) -> Result> { + ) -> BoxFuture>> { debug!("get_transaction rpc request received: {:?}", signature_str); - let signature = verify_signature(&signature_str)?; - meta.get_transaction(signature, config) + let signature = verify_signature(&signature_str); + if let Err(err) = signature { + return Box::pin(future::err(err)); + } + Box::pin(async move { meta.get_transaction(signature.unwrap(), config).await }) } fn get_signatures_for_address( @@ -3484,35 +3518,28 @@ pub mod rpc_full { meta: Self::Metadata, address: String, config: Option, - ) -> Result> { - let address = verify_pubkey(&address)?; - + ) -> BoxFuture>> { let config = config.unwrap_or_default(); - let before = config - .before - .map(|ref before| verify_signature(before)) - .transpose()?; - let until = config - .until - .map(|ref until| verify_signature(until)) - .transpose()?; - let limit = config - .limit - .unwrap_or(MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS2_LIMIT); + let commitment = config.commitment; + let verification = verify_and_parse_signatures_for_address_params( + address, + config.before, + config.until, + config.limit, + ); - if limit == 0 || limit > MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS2_LIMIT { - return Err(Error::invalid_params(format!( - "Invalid limit; max {}", - MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS2_LIMIT - ))); + match verification { + Err(err) => Box::pin(future::err(err)), + Ok((address, before, until, limit)) => Box::pin(async move { + meta.get_signatures_for_address(address, before, until, limit, commitment) + .await + }), } - - meta.get_signatures_for_address(address, before, until, limit, config.commitment) } - fn get_first_available_block(&self, meta: Self::Metadata) -> Result { + fn get_first_available_block(&self, meta: Self::Metadata) -> BoxFuture> { debug!("get_first_available_block rpc request received"); - Ok(meta.get_first_available_block()) + Box::pin(async move { Ok(meta.get_first_available_block().await) }) } fn get_inflation_reward( @@ -3520,7 +3547,7 @@ pub mod rpc_full { meta: Self::Metadata, address_strs: Vec, config: Option, - ) -> Result>> { + ) -> BoxFuture>>> { debug!( "get_inflation_reward rpc request received: {:?}", address_strs.len() @@ -3528,10 +3555,15 @@ pub mod rpc_full { let mut addresses: Vec = vec![]; for address_str in address_strs { - addresses.push(verify_pubkey(&address_str)?); + match verify_pubkey(&address_str) { + Ok(pubkey) => { + addresses.push(pubkey); + } + Err(err) => return Box::pin(future::err(err)), + } } - meta.get_inflation_reward(addresses, config) + Box::pin(async move { meta.get_inflation_reward(addresses, config).await }) } } } @@ -3551,7 +3583,7 @@ pub mod rpc_deprecated_v1_7 { meta: Self::Metadata, slot: Slot, config: Option>, - ) -> Result>; + ) -> BoxFuture>>; // DEPRECATED #[rpc(meta, name = "getConfirmedBlocks")] @@ -3561,7 +3593,7 @@ pub mod rpc_deprecated_v1_7 { start_slot: Slot, config: Option, commitment: Option, - ) -> Result>; + ) -> BoxFuture>>; // DEPRECATED #[rpc(meta, name = "getConfirmedBlocksWithLimit")] @@ -3571,7 +3603,7 @@ pub mod rpc_deprecated_v1_7 { start_slot: Slot, limit: usize, commitment: Option, - ) -> Result>; + ) -> BoxFuture>>; // DEPRECATED #[rpc(meta, name = "getConfirmedTransaction")] @@ -3580,7 +3612,7 @@ pub mod rpc_deprecated_v1_7 { meta: Self::Metadata, signature_str: String, config: Option>, - ) -> Result>; + ) -> BoxFuture>>; // DEPRECATED #[rpc(meta, name = "getConfirmedSignaturesForAddress2")] @@ -3589,7 +3621,7 @@ pub mod rpc_deprecated_v1_7 { meta: Self::Metadata, address: String, config: Option, - ) -> Result>; + ) -> BoxFuture>>; } pub struct DeprecatedV1_7Impl; @@ -3601,9 +3633,12 @@ pub mod rpc_deprecated_v1_7 { meta: Self::Metadata, slot: Slot, config: Option>, - ) -> Result> { + ) -> BoxFuture>> { debug!("get_confirmed_block rpc request received: {:?}", slot); - meta.get_block(slot, config.map(|config| config.convert())) + Box::pin(async move { + meta.get_block(slot, config.map(|config| config.convert())) + .await + }) } fn get_confirmed_blocks( @@ -3612,14 +3647,17 @@ pub mod rpc_deprecated_v1_7 { start_slot: Slot, config: Option, commitment: Option, - ) -> Result> { + ) -> BoxFuture>> { let (end_slot, maybe_commitment) = config.map(|config| config.unzip()).unwrap_or_default(); debug!( "get_confirmed_blocks rpc request received: {}-{:?}", start_slot, end_slot ); - meta.get_blocks(start_slot, end_slot, commitment.or(maybe_commitment)) + Box::pin(async move { + meta.get_blocks(start_slot, end_slot, commitment.or(maybe_commitment)) + .await + }) } fn get_confirmed_blocks_with_limit( @@ -3628,12 +3666,15 @@ pub mod rpc_deprecated_v1_7 { start_slot: Slot, limit: usize, commitment: Option, - ) -> Result> { + ) -> BoxFuture>> { debug!( "get_confirmed_blocks_with_limit rpc request received: {}-{}", start_slot, limit, ); - meta.get_blocks_with_limit(start_slot, limit, commitment) + Box::pin(async move { + meta.get_blocks_with_limit(start_slot, limit, commitment) + .await + }) } fn get_confirmed_transaction( @@ -3641,13 +3682,19 @@ pub mod rpc_deprecated_v1_7 { meta: Self::Metadata, signature_str: String, config: Option>, - ) -> Result> { + ) -> BoxFuture>> { debug!( "get_confirmed_transaction rpc request received: {:?}", signature_str ); - let signature = verify_signature(&signature_str)?; - meta.get_transaction(signature, config.map(|config| config.convert())) + let signature = verify_signature(&signature_str); + if let Err(err) = signature { + return Box::pin(future::err(err)); + } + Box::pin(async move { + meta.get_transaction(signature.unwrap(), config.map(|config| config.convert())) + .await + }) } fn get_confirmed_signatures_for_address2( @@ -3655,30 +3702,23 @@ pub mod rpc_deprecated_v1_7 { meta: Self::Metadata, address: String, config: Option, - ) -> Result> { - let address = verify_pubkey(&address)?; - + ) -> BoxFuture>> { let config = config.unwrap_or_default(); - let before = config - .before - .map(|ref before| verify_signature(before)) - .transpose()?; - let until = config - .until - .map(|ref until| verify_signature(until)) - .transpose()?; - let limit = config - .limit - .unwrap_or(MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS2_LIMIT); + let commitment = config.commitment; + let verification = verify_and_parse_signatures_for_address_params( + address, + config.before, + config.until, + config.limit, + ); - if limit == 0 || limit > MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS2_LIMIT { - return Err(Error::invalid_params(format!( - "Invalid limit; max {}", - MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS2_LIMIT - ))); + match verification { + Err(err) => Box::pin(future::err(err)), + Ok((address, before, until, limit)) => Box::pin(async move { + meta.get_signatures_for_address(address, before, until, limit, commitment) + .await + }), } - - meta.get_signatures_for_address(address, before, until, limit, config.commitment) } } } @@ -4195,7 +4235,6 @@ pub mod tests { RpcHealth::stub(), cluster_info.clone(), Hash::default(), - Arc::new(tokio::runtime::Runtime::new().unwrap()), None, OptimisticallyConfirmedBank::locked_from_bank_forks_root(&bank_forks), Arc::new(RwLock::new(LargestAccountsCache::new(30))), @@ -5762,7 +5801,6 @@ pub mod tests { health.clone(), cluster_info, Hash::default(), - Arc::new(tokio::runtime::Runtime::new().unwrap()), None, OptimisticallyConfirmedBank::locked_from_bank_forks_root(&bank_forks), Arc::new(RwLock::new(LargestAccountsCache::new(30))), @@ -6045,7 +6083,6 @@ pub mod tests { RpcHealth::stub(), cluster_info, Hash::default(), - Arc::new(tokio::runtime::Runtime::new().unwrap()), None, OptimisticallyConfirmedBank::locked_from_bank_forks_root(&bank_forks), Arc::new(RwLock::new(LargestAccountsCache::new(30))), @@ -7471,7 +7508,6 @@ pub mod tests { RpcHealth::stub(), cluster_info, Hash::default(), - Arc::new(tokio::runtime::Runtime::new().unwrap()), None, optimistically_confirmed_bank.clone(), Arc::new(RwLock::new(LargestAccountsCache::new(30))), diff --git a/rpc/src/rpc_service.rs b/rpc/src/rpc_service.rs index af9452657..e09150070 100644 --- a/rpc/src/rpc_service.rs +++ b/rpc/src/rpc_service.rs @@ -41,7 +41,6 @@ use { sync::{mpsc::channel, Arc, Mutex, RwLock}, thread::{self, Builder, JoinHandle}, }, - tokio::runtime, tokio_util::codec::{BytesCodec, FramedRead}, }; @@ -120,10 +119,8 @@ impl RpcRequestMiddleware { } #[cfg(unix)] - async fn open_no_follow(path: impl AsRef) -> std::io::Result { - // Stuck on tokio 0.2 until the jsonrpc crates upgrade - use tokio_02::fs::os::unix::OpenOptionsExt; - tokio_02::fs::OpenOptions::new() + async fn open_no_follow(path: impl AsRef) -> std::io::Result { + tokio::fs::OpenOptions::new() .read(true) .write(false) .create(false) @@ -133,10 +130,9 @@ impl RpcRequestMiddleware { } #[cfg(not(unix))] - async fn open_no_follow(path: impl AsRef) -> std::io::Result { + async fn open_no_follow(path: impl AsRef) -> std::io::Result { // TODO: Is there any way to achieve the same on Windows? - // Stuck on tokio 0.2 until the jsonrpc crates upgrade - tokio_02::fs::File::open(path).await + tokio::fs::File::open(path).await } fn process_file_get(&self, path: &str) -> RequestMiddlewareAction { @@ -309,9 +305,17 @@ impl JsonRpcService { ))); let tpu_address = cluster_info.my_contact_info().tpu; + + // sadly, some parts of our current rpc implemention block the jsonrpc's + // _socket-listening_ event loop for too long, due to (blocking) long IO or intesive CPU, + // causing no further processing of incoming requests and ultimatily innocent clients timing-out. + // So create a (shared) multi-threaded event_loop for jsonrpc and set its .threads() to 1, + // so that we avoid the single-threaded event loops from being created automatically by + // jsonrpc for threads when .threads(N > 1) is given. let runtime = Arc::new( - runtime::Builder::new_multi_thread() - .thread_name("rpc-runtime") + tokio::runtime::Builder::new_multi_thread() + .worker_threads(rpc_threads) + .thread_name("sol-rpc-el") .enable_all() .build() .expect("Runtime"), @@ -367,7 +371,6 @@ impl JsonRpcService { health.clone(), cluster_info.clone(), genesis_hash, - runtime, bigtable_ledger_storage, optimistically_confirmed_bank, largest_accounts_cache, @@ -392,23 +395,6 @@ impl JsonRpcService { let ledger_path = ledger_path.to_path_buf(); - // sadly, some parts of our current rpc implemention block the jsonrpc's - // _socket-listening_ event loop for too long, due to (blocking) long IO or intesive CPU, - // causing no further processing of incoming requests and ultimatily innocent clients timing-out. - // So create a (shared) multi-threaded event_loop for jsonrpc and set its .threads() to 1, - // so that we avoid the single-threaded event loops from being created automatically by - // jsonrpc for threads when .threads(N > 1) is given. - let event_loop = { - // Stuck on tokio 0.2 until the jsonrpc crates upgrade - tokio_02::runtime::Builder::new() - .core_threads(rpc_threads) - .threaded_scheduler() - .enable_all() - .thread_name("sol-rpc-el") - .build() - .unwrap() - }; - let (close_handle_sender, close_handle_receiver) = channel(); let thread_hdl = Builder::new() .name("solana-jsonrpc".to_string()) @@ -436,7 +422,7 @@ impl JsonRpcService { io, move |_req: &hyper::Request| request_processor.clone(), ) - .event_loop_executor(event_loop.handle().clone()) + .event_loop_executor(runtime.handle().clone()) .threads(1) .cors(DomainsValidation::AllowOnly(vec![ AccessControlAllowOrigin::Any, @@ -517,6 +503,7 @@ mod tests { io::Write, net::{IpAddr, Ipv4Addr}, }, + tokio::runtime::Runtime, }; #[test] @@ -655,7 +642,7 @@ mod tests { #[test] fn test_process_file_get() { - let mut runtime = tokio_02::runtime::Runtime::new().unwrap(); + let runtime = Runtime::new().unwrap(); let ledger_path = get_tmp_ledger_path!(); std::fs::create_dir(&ledger_path).unwrap(); diff --git a/validator/Cargo.toml b/validator/Cargo.toml index 7ca5289fe..75c72c535 100644 --- a/validator/Cargo.toml +++ b/validator/Cargo.toml @@ -19,11 +19,11 @@ console = "0.14.1" core_affinity = "0.5.10" fd-lock = "3.0.0" indicatif = "0.16.2" -jsonrpc-core = "17.1.0" -jsonrpc-core-client = { version = "17.1.0", features = ["ipc", "ws"] } -jsonrpc-derive = "17.1.0" -jsonrpc-ipc-server = "17.1.0" -jsonrpc-server-utils= "17.1.0" +jsonrpc-core = "18.0.0" +jsonrpc-core-client = { version = "18.0.0", features = ["ipc", "ws"] } +jsonrpc-derive = "18.0.0" +jsonrpc-ipc-server = "18.0.0" +jsonrpc-server-utils= "18.0.0" log = "0.4.14" num_cpus = "1.13.0" rand = "0.7.0" diff --git a/validator/src/admin_rpc_service.rs b/validator/src/admin_rpc_service.rs index 63905b80a..9dd3a5f93 100644 --- a/validator/src/admin_rpc_service.rs +++ b/validator/src/admin_rpc_service.rs @@ -172,10 +172,9 @@ impl AdminRpc for AdminRpcImpl { pub fn run(ledger_path: &Path, metadata: AdminRpcRequestMetadata) { let admin_rpc_path = ledger_path.join("admin.rpc"); - let event_loop = tokio::runtime::Builder::new() - .threaded_scheduler() - .enable_all() + let event_loop = tokio::runtime::Builder::new_multi_thread() .thread_name("sol-adminrpc-el") + .enable_all() .build() .unwrap(); diff --git a/validator/src/dashboard.rs b/validator/src/dashboard.rs index a924f30f9..94085fd84 100644 --- a/validator/src/dashboard.rs +++ b/validator/src/dashboard.rs @@ -64,7 +64,7 @@ impl Dashboard { } = self; drop(progress_bar); - let mut runtime = admin_rpc_service::runtime(); + let runtime = admin_rpc_service::runtime(); while !exit.load(Ordering::Relaxed) { let progress_bar = new_spinner_progress_bar(); progress_bar.set_message("Connecting...");