Bump jsonrpc crates and remove old tokio (backport #18779) (#19453)

* 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

(cherry picked from commit 8596db8f53)

# Conflicts:
#	Cargo.lock
#	client/Cargo.toml
#	core/Cargo.toml
#	programs/bpf/Cargo.lock
#	rpc/Cargo.toml
#	rpc/src/rpc.rs
#	validator/Cargo.toml

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
mergify[bot]
2021-08-27 00:55:02 +00:00
committed by GitHub
parent c734db59cb
commit 52dfb4a09c
12 changed files with 340 additions and 927 deletions

455
Cargo.lock generated
View File

@ -190,7 +190,7 @@ dependencies = [
"instant",
"pin-project 1.0.1",
"rand 0.8.3",
"tokio 1.8.1",
"tokio",
]
[[package]]
@ -794,17 +794,6 @@ dependencies = [
"crossbeam-utils 0.8.5",
]
[[package]]
name = "crossbeam-deque"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed"
dependencies = [
"crossbeam-epoch 0.8.2",
"crossbeam-utils 0.7.2",
"maybe-uninit",
]
[[package]]
name = "crossbeam-deque"
version = "0.8.1"
@ -812,25 +801,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
dependencies = [
"cfg-if 1.0.0",
"crossbeam-epoch 0.9.5",
"crossbeam-epoch",
"crossbeam-utils 0.8.5",
]
[[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.5"
@ -840,21 +814,10 @@ dependencies = [
"cfg-if 1.0.0",
"crossbeam-utils 0.8.5",
"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"
@ -1604,7 +1567,7 @@ dependencies = [
"simpl",
"smpl_jwt",
"time 0.2.25",
"tokio 1.8.1",
"tokio",
]
[[package]]
@ -1618,25 +1581,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.11",
"slab",
"tokio 0.2.22",
"tokio-util 0.3.1",
]
[[package]]
name = "h2"
version = "0.3.3"
@ -1651,8 +1595,8 @@ dependencies = [
"http",
"indexmap",
"slab",
"tokio 1.8.1",
"tokio-util 0.6.3",
"tokio",
"tokio-util",
"tracing",
]
@ -1789,16 +1733,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"
@ -1807,7 +1741,7 @@ checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9"
dependencies = [
"bytes 1.0.1",
"http",
"pin-project-lite 0.2.7",
"pin-project-lite",
]
[[package]]
@ -1816,12 +1750,6 @@ version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68"
[[package]]
name = "httpdate"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47"
[[package]]
name = "httpdate"
version = "1.0.1"
@ -1853,30 +1781,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 0.3.2",
"itoa",
"pin-project 1.0.1",
"socket2 0.3.17",
"tokio 0.2.22",
"tower-service",
"tracing",
"want",
]
[[package]]
name = "hyper"
version = "0.14.11"
@ -1887,15 +1791,15 @@ dependencies = [
"futures-channel",
"futures-core",
"futures-util",
"h2 0.3.3",
"h2",
"http",
"http-body 0.4.2",
"http-body",
"httparse",
"httpdate 1.0.1",
"httpdate",
"itoa",
"pin-project-lite 0.2.7",
"pin-project-lite",
"socket2 0.4.1",
"tokio 1.8.1",
"tokio",
"tower-service",
"tracing",
"want",
@ -1911,7 +1815,7 @@ dependencies = [
"hyper 0.14.11",
"log 0.4.11",
"rustls",
"tokio 1.8.1",
"tokio",
"tokio-rustls",
"webpki",
]
@ -1923,8 +1827,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1"
dependencies = [
"hyper 0.14.11",
"pin-project-lite 0.2.7",
"tokio 1.8.1",
"pin-project-lite",
"tokio",
"tokio-io-timeout",
]
@ -1937,7 +1841,7 @@ dependencies = [
"bytes 1.0.1",
"hyper 0.14.11",
"native-tls",
"tokio 1.8.1",
"tokio",
"tokio-native-tls",
]
@ -2072,9 +1976,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.8",
@ -2085,16 +1989,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.8",
"futures-executor",
@ -2107,9 +2011,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.8",
"jsonrpc-client-transports",
@ -2117,9 +2021,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",
@ -2129,12 +2033,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.8",
"hyper 0.13.10",
"hyper 0.14.11",
"jsonrpc-core",
"jsonrpc-server-utils",
"log 0.4.11",
@ -2145,9 +2049,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.8",
"jsonrpc-core",
@ -2160,9 +2064,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.8",
"jsonrpc-core",
@ -2175,26 +2079,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.8",
"globset",
"jsonrpc-core",
"lazy_static",
"log 0.4.11",
"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.8",
"jsonrpc-core",
@ -2414,15 +2319,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"
@ -2500,29 +2396,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.11",
"mio 0.6.22",
"miow 0.3.6",
"winapi 0.3.9",
]
[[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"
@ -2798,25 +2671,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.8",
"libc",
"log 0.4.11",
"mio-named-pipes",
"miow 0.3.6",
"rand 0.7.3",
"tokio 0.2.22",
"tokio",
"winapi 0.3.9",
]
[[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",
@ -3024,12 +2895,6 @@ dependencies = [
"syn 1.0.60",
]
[[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.7"
@ -3501,7 +3366,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674"
dependencies = [
"autocfg 1.0.0",
"crossbeam-deque 0.8.1",
"crossbeam-deque",
"either",
"rayon-core",
]
@ -3513,7 +3378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a"
dependencies = [
"crossbeam-channel 0.5.0",
"crossbeam-deque 0.8.1",
"crossbeam-deque",
"crossbeam-utils 0.8.5",
"lazy_static",
"num_cpus",
@ -3603,7 +3468,7 @@ dependencies = [
"futures-core",
"futures-util",
"http",
"http-body 0.4.2",
"http-body",
"hyper 0.14.11",
"hyper-rustls",
"hyper-tls",
@ -3614,12 +3479,12 @@ dependencies = [
"mime 0.3.16",
"native-tls",
"percent-encoding 2.1.0",
"pin-project-lite 0.2.7",
"pin-project-lite",
"rustls",
"serde",
"serde_json",
"serde_urlencoded",
"tokio 1.8.1",
"tokio",
"tokio-native-tls",
"tokio-rustls",
"url 2.2.0",
@ -4208,7 +4073,7 @@ dependencies = [
"solana-runtime",
"solana-sdk",
"tarpc",
"tokio 1.8.1",
"tokio",
"tokio-serde",
]
@ -4220,7 +4085,7 @@ dependencies = [
"serde",
"solana-sdk",
"tarpc",
"tokio 1.8.1",
"tokio",
]
[[package]]
@ -4236,7 +4101,7 @@ dependencies = [
"solana-runtime",
"solana-sdk",
"tarpc",
"tokio 1.8.1",
"tokio",
"tokio-serde",
"tokio-stream",
]
@ -4482,7 +4347,7 @@ dependencies = [
"solana-version",
"solana-vote-program",
"thiserror",
"tokio 1.8.1",
"tokio",
"tungstenite",
"url 2.2.0",
]
@ -4572,7 +4437,7 @@ dependencies = [
"systemstat",
"tempfile",
"thiserror",
"tokio 0.2.22",
"tokio",
"trees",
]
@ -4595,7 +4460,6 @@ dependencies = [
"serde",
"syn 0.15.44",
"syn 1.0.60",
"tokio 0.1.22",
"winapi 0.3.9",
]
@ -4678,7 +4542,7 @@ dependencies = [
"solana-version",
"spl-memo",
"thiserror",
"tokio 1.8.1",
"tokio",
]
[[package]]
@ -4914,7 +4778,7 @@ dependencies = [
"solana-vote-program",
"tempfile",
"thiserror",
"tokio 1.8.1",
"tokio",
"tokio-stream",
"trees",
]
@ -4951,7 +4815,7 @@ dependencies = [
"solana-version",
"solana-vote-program",
"tempfile",
"tokio 1.8.1",
"tokio",
]
[[package]]
@ -5093,7 +4957,7 @@ dependencies = [
"solana-logger 1.7.11",
"solana-sdk",
"solana-version",
"tokio 1.8.1",
"tokio",
"url 2.2.0",
]
@ -5278,7 +5142,7 @@ dependencies = [
"solana-sdk",
"solana-vote-program",
"thiserror",
"tokio 1.8.1",
"tokio",
]
[[package]]
@ -5351,9 +5215,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]]
@ -6023,9 +5886,9 @@ dependencies = [
"serde",
"static_assertions",
"tarpc-plugins",
"tokio 1.8.1",
"tokio",
"tokio-serde",
"tokio-util 0.6.3",
"tokio-util",
]
[[package]]
@ -6213,54 +6076,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 = "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 2.4.0",
"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.9",
]
[[package]]
name = "tokio"
version = "1.8.1"
@ -6275,9 +6090,9 @@ dependencies = [
"num_cpus",
"once_cell",
"parking_lot 0.11.0",
"pin-project-lite 0.2.7",
"pin-project-lite",
"signal-hook-registry",
"tokio-macros 1.3.0",
"tokio-macros",
"winapi 0.3.9",
]
@ -6292,16 +6107,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"
@ -6312,17 +6117,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"
@ -6340,19 +6134,8 @@ version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90c49f106be240de154571dd31fbe48acb10ba6c6dd6f6517ad603abffa42de9"
dependencies = [
"pin-project-lite 0.2.7",
"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.60",
"pin-project-lite",
"tokio",
]
[[package]]
@ -6373,7 +6156,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b"
dependencies = [
"native-tls",
"tokio 1.8.1",
"tokio",
]
[[package]]
@ -6402,7 +6185,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6"
dependencies = [
"rustls",
"tokio 1.8.1",
"tokio",
"webpki",
]
@ -6429,8 +6212,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76066865172052eb8796c686f0b441a93df8b08d40a950b062ffb9a426f00edd"
dependencies = [
"futures-core",
"pin-project-lite 0.2.7",
"tokio 1.8.1",
"pin-project-lite",
"tokio",
]
[[package]]
@ -6457,35 +6240,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.4",
"crossbeam-queue",
"crossbeam-utils 0.7.2",
"futures 0.1.29",
"lazy_static",
"log 0.4.11",
"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"
@ -6497,53 +6251,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.11",
"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.11",
"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.11",
"pin-project-lite 0.1.5",
"tokio 0.2.22",
]
[[package]]
name = "tokio-util"
version = "0.6.3"
@ -6554,8 +6261,8 @@ dependencies = [
"futures-core",
"futures-sink",
"log 0.4.11",
"pin-project-lite 0.2.7",
"tokio 1.8.1",
"pin-project-lite",
"tokio",
]
[[package]]
@ -6579,19 +6286,19 @@ dependencies = [
"bytes 1.0.1",
"futures-core",
"futures-util",
"h2 0.3.3",
"h2",
"http",
"http-body 0.4.2",
"http-body",
"hyper 0.14.11",
"hyper-timeout",
"percent-encoding 2.1.0",
"pin-project 1.0.1",
"prost",
"prost-derive",
"tokio 1.8.1",
"tokio",
"tokio-rustls",
"tokio-stream",
"tokio-util 0.6.3",
"tokio-util",
"tower",
"tower-layer",
"tower-service",
@ -6623,9 +6330,9 @@ dependencies = [
"pin-project 1.0.1",
"rand 0.8.3",
"slab",
"tokio 1.8.1",
"tokio",
"tokio-stream",
"tokio-util 0.6.3",
"tokio-util",
"tower-layer",
"tower-service",
"tracing",
@ -6651,7 +6358,7 @@ checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d"
dependencies = [
"cfg-if 1.0.0",
"log 0.4.11",
"pin-project-lite 0.2.7",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]

View File

@ -15,7 +15,7 @@ bincode = "1.3.1"
bs58 = "0.3.1"
clap = "2.33.0"
indicatif = "0.15.0"
jsonrpc-core = "17.0.0"
jsonrpc-core = "18.0.0"
log = "0.4.11"
net2 = "0.2.37"
rayon = "1.5.0"
@ -39,7 +39,7 @@ url = "2.1.1"
[dev-dependencies]
assert_matches = "1.3.0"
jsonrpc-http-server = "17.0.0"
jsonrpc-http-server = "18.0.0"
solana-logger = { path = "../logger", version = "=1.7.11" }
[package.metadata.docs.rs]

View File

@ -73,8 +73,8 @@ solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.7.11"
trees = "0.2.1"
[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.2", default-features = false, features = ["blocking", "rustls-tls", "json"] }
@ -84,7 +84,7 @@ solana-stake-program = { path = "../programs/stake", version = "=1.7.11" }
solana-version = { path = "../version", version = "=1.7.11" }
symlink = "0.1.0"
systemstat = "0.1.5"
tokio_02 = { version = "0.2", package = "tokio", features = ["full"] }
tokio = { version = "1", features = ["full"] }
[build-dependencies]
rustc_version = "0.2"

View File

@ -32,7 +32,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) => {{
@ -171,7 +171,7 @@ fn test_rpc_slot_updates() {
let connect = ws::try_connect::<PubsubClient>(&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();
@ -281,7 +281,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()))
@ -301,7 +301,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();
});
@ -311,7 +311,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();
});

View File

@ -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]

380
programs/bpf/Cargo.lock generated
View File

@ -520,17 +520,6 @@ dependencies = [
"crossbeam-utils 0.8.5",
]
[[package]]
name = "crossbeam-deque"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed"
dependencies = [
"crossbeam-epoch 0.8.2",
"crossbeam-utils 0.7.2",
"maybe-uninit",
]
[[package]]
name = "crossbeam-deque"
version = "0.8.1"
@ -538,25 +527,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
dependencies = [
"cfg-if 1.0.0",
"crossbeam-epoch 0.9.5",
"crossbeam-epoch",
"crossbeam-utils 0.8.5",
]
[[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",
]
[[package]]
name = "crossbeam-epoch"
version = "0.9.5"
@ -566,21 +540,10 @@ dependencies = [
"cfg-if 1.0.0",
"crossbeam-utils 0.8.5",
"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"
@ -955,28 +918,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"
@ -1161,7 +1102,7 @@ dependencies = [
"http",
"indexmap",
"slab",
"tokio 1.8.1",
"tokio",
"tokio-util",
"tracing",
]
@ -1308,7 +1249,7 @@ dependencies = [
"itoa",
"pin-project-lite 0.2.7",
"socket2 0.4.1",
"tokio 1.8.1",
"tokio",
"tower-service",
"tracing",
"want",
@ -1324,7 +1265,7 @@ dependencies = [
"hyper",
"log",
"rustls",
"tokio 1.8.1",
"tokio",
"tokio-rustls",
"webpki",
]
@ -1439,11 +1380,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",
@ -1598,15 +1541,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"
@ -1631,25 +1565,6 @@ dependencies = [
"adler32",
]
[[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.7"
@ -1663,17 +1578,6 @@ dependencies = [
"winapi 0.3.9",
]
[[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"
@ -1920,17 +1824,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",
]
[[package]]
name = "parking_lot"
version = "0.10.2"
@ -1952,21 +1845,6 @@ dependencies = [
"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",
"smallvec 0.6.14",
"winapi 0.3.9",
]
[[package]]
name = "parking_lot_core"
version = "0.7.2"
@ -1977,7 +1855,7 @@ dependencies = [
"cloudabi",
"libc",
"redox_syscall 0.1.56",
"smallvec 1.6.1",
"smallvec",
"winapi 0.3.9",
]
@ -1991,7 +1869,7 @@ dependencies = [
"instant",
"libc",
"redox_syscall 0.1.56",
"smallvec 1.6.1",
"smallvec",
"winapi 0.3.9",
]
@ -2272,7 +2150,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674"
dependencies = [
"autocfg",
"crossbeam-deque 0.8.1",
"crossbeam-deque",
"either",
"rayon-core",
]
@ -2284,7 +2162,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a"
dependencies = [
"crossbeam-channel 0.5.0",
"crossbeam-deque 0.8.1",
"crossbeam-deque",
"crossbeam-utils 0.8.5",
"lazy_static",
"num_cpus",
@ -2367,7 +2245,7 @@ dependencies = [
"serde",
"serde_json",
"serde_urlencoded",
"tokio 1.8.1",
"tokio",
"tokio-rustls",
"url",
"wasm-bindgen",
@ -2681,15 +2559,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"
@ -2746,13 +2615,13 @@ dependencies = [
"bincode",
"borsh",
"borsh-derive",
"futures 0.3.12",
"mio 0.7.7",
"futures",
"mio",
"solana-banks-interface",
"solana-program 1.7.11",
"solana-sdk",
"tarpc",
"tokio 1.8.1",
"tokio",
"tokio-serde",
]
@ -2760,7 +2629,7 @@ dependencies = [
name = "solana-banks-interface"
version = "1.7.11"
dependencies = [
"mio 0.7.7",
"mio",
"serde",
"solana-sdk",
"tarpc",
@ -2771,15 +2640,15 @@ name = "solana-banks-server"
version = "1.7.11"
dependencies = [
"bincode",
"futures 0.3.12",
"futures",
"log",
"mio 0.7.7",
"mio",
"solana-banks-interface",
"solana-metrics",
"solana-runtime",
"solana-sdk",
"tarpc",
"tokio 1.8.1",
"tokio",
"tokio-serde",
"tokio-stream",
]
@ -3184,7 +3053,7 @@ dependencies = [
"solana-version",
"solana-vote-program",
"thiserror",
"tokio 1.8.1",
"tokio",
"tungstenite",
"url",
]
@ -3221,7 +3090,6 @@ dependencies = [
"serde",
"syn 0.15.44",
"syn 1.0.67",
"tokio 0.1.22",
"winapi 0.3.9",
]
@ -3243,7 +3111,7 @@ dependencies = [
"solana-version",
"spl-memo",
"thiserror",
"tokio 1.8.1",
"tokio",
]
[[package]]
@ -3363,7 +3231,7 @@ dependencies = [
"solana-logger 1.7.11",
"solana-sdk",
"solana-version",
"tokio 1.8.1",
"tokio",
"url",
]
@ -3445,7 +3313,7 @@ dependencies = [
"chrono",
"chrono-humanize",
"log",
"mio 0.7.7",
"mio",
"serde",
"serde_derive",
"solana-banks-client",
@ -3456,7 +3324,7 @@ dependencies = [
"solana-sdk",
"solana-vote-program",
"thiserror",
"tokio 1.8.1",
"tokio",
]
[[package]]
@ -3829,7 +3697,7 @@ checksum = "e325774dd5b35d979e9f4db2b0f0d7d85dc2ff2b676a3150af56c09eafc14b07"
dependencies = [
"anyhow",
"fnv",
"futures 0.3.12",
"futures",
"humantime",
"log",
"pin-project",
@ -3837,7 +3705,7 @@ dependencies = [
"serde",
"static_assertions",
"tarpc-plugins",
"tokio 1.8.1",
"tokio",
"tokio-serde",
"tokio-util",
]
@ -3967,30 +3835,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"
@ -4001,7 +3845,7 @@ dependencies = [
"bytes 1.0.1",
"libc",
"memchr",
"mio 0.7.7",
"mio",
"num_cpus",
"once_cell",
"parking_lot 0.11.1",
@ -4011,59 +3855,6 @@ dependencies = [
"winapi 0.3.9",
]
[[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",
]
[[package]]
name = "tokio-macros"
version = "1.1.0"
@ -4075,25 +3866,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"
@ -4101,7 +3873,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6"
dependencies = [
"rustls",
"tokio 1.8.1",
"tokio",
"webpki",
]
@ -4129,93 +3901,7 @@ checksum = "e177a5d8c3bf36de9ebe6d58537d8879e964332f93fb3339e43f618c81361af0"
dependencies = [
"futures-core",
"pin-project-lite 0.2.7",
"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.4",
"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]]
@ -4229,7 +3915,7 @@ dependencies = [
"futures-sink",
"log",
"pin-project-lite 0.2.7",
"tokio 1.8.1",
"tokio",
]
[[package]]

View File

@ -15,12 +15,12 @@ bincode = "1.3.1"
bs58 = "0.3.1"
crossbeam-channel = "0.4"
itertools = "0.9.0"
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.81"
log = "0.4.11"
regex = "1.3.9"
@ -45,8 +45,7 @@ solana-version = { path = "../version", version = "=1.7.11" }
solana-vote-program = { path = "../programs/vote", version = "=1.7.11" }
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"

View File

@ -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::{
@ -90,7 +90,6 @@ use {
},
time::Duration,
},
tokio::runtime::Runtime,
};
type RpcCustomResult<T> = std::result::Result<T, RpcCustomError>;
@ -157,7 +156,6 @@ pub struct JsonRpcRequestProcessor {
cluster_info: Arc<ClusterInfo>,
genesis_hash: Hash,
transaction_sender: Arc<Mutex<Sender<TransactionInfo>>>,
runtime: Arc<Runtime>,
bigtable_ledger_storage: Option<solana_storage_bigtable::LedgerStorage>,
optimistically_confirmed_bank: Arc<RwLock<OptimisticallyConfirmedBank>>,
largest_accounts_cache: Arc<RwLock<LargestAccountsCache>>,
@ -247,7 +245,6 @@ impl JsonRpcRequestProcessor {
health: Arc<RpcHealth>,
cluster_info: Arc<ClusterInfo>,
genesis_hash: Hash,
runtime: Arc<Runtime>,
bigtable_ledger_storage: Option<solana_storage_bigtable::LedgerStorage>,
optimistically_confirmed_bank: Arc<RwLock<OptimisticallyConfirmedBank>>,
largest_accounts_cache: Arc<RwLock<LargestAccountsCache>>,
@ -268,7 +265,6 @@ impl JsonRpcRequestProcessor {
cluster_info,
genesis_hash,
transaction_sender: Arc::new(Mutex::new(sender)),
runtime,
bigtable_ledger_storage,
optimistically_confirmed_bank,
largest_accounts_cache,
@ -313,7 +309,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(),
@ -408,14 +403,14 @@ impl JsonRpcRequestProcessor {
})
}
pub fn get_inflation_reward(
pub async fn get_inflation_reward(
&self,
addresses: Vec<Pubkey>,
config: Option<RpcEpochConfig>,
) -> Result<Vec<Option<RpcInflationReward>>> {
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))
@ -440,16 +435,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(
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 {
@ -941,7 +940,7 @@ impl JsonRpcRequestProcessor {
Ok(())
}
pub fn get_block(
pub async fn get_block(
&self,
slot: Slot,
config: Option<RpcEncodingConfigWrapper<RpcBlockConfig>>,
@ -977,9 +976,8 @@ impl JsonRpcRequestProcessor {
};
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(configure_block));
}
@ -1021,7 +1019,7 @@ impl JsonRpcRequestProcessor {
Err(RpcCustomError::BlockNotAvailable { slot }.into())
}
pub fn get_blocks(
pub async fn get_blocks(
&self,
start_slot: Slot,
end_slot: Option<Slot>,
@ -1060,12 +1058,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
@ -1105,7 +1100,7 @@ impl JsonRpcRequestProcessor {
Ok(blocks)
}
pub fn get_blocks_with_limit(
pub async fn get_blocks_with_limit(
&self,
start_slot: Slot,
limit: usize,
@ -1128,9 +1123,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());
}
}
@ -1169,7 +1164,7 @@ impl JsonRpcRequestProcessor {
Ok(blocks)
}
pub fn get_block_time(&self, slot: Slot) -> Result<Option<UnixTimestamp>> {
pub async fn get_block_time(&self, slot: Slot) -> Result<Option<UnixTimestamp>> {
if slot == 0 {
return Ok(Some(self.genesis_creation_time()));
}
@ -1184,9 +1179,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()
@ -1231,7 +1224,7 @@ impl JsonRpcRequestProcessor {
Some(status)
}
pub fn get_signature_statuses(
pub async fn get_signature_statuses(
&self,
signatures: Vec<Signature>,
config: Option<RpcSignatureStatusConfig>,
@ -1251,7 +1244,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)| {
@ -1271,16 +1265,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))
{
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
};
@ -1326,7 +1321,7 @@ impl JsonRpcRequestProcessor {
})
}
pub fn get_transaction(
pub async fn get_transaction(
&self,
signature: Signature,
config: Option<RpcEncodingConfigWrapper<RpcTransactionConfig>>,
@ -1374,9 +1369,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)));
}
@ -1412,7 +1407,7 @@ impl JsonRpcRequestProcessor {
}
}
pub fn get_signatures_for_address(
pub async fn get_signatures_for_address(
&self,
address: Pubkey,
mut before: Option<Signature>,
@ -1448,14 +1443,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));
@ -1490,16 +1485,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);
@ -1977,6 +1972,28 @@ fn verify_token_account_filter(
}
}
fn verify_and_parse_signatures_for_address_params(
address: String,
before: Option<String>,
until: Option<String>,
limit: Option<usize>,
) -> Result<(Pubkey, Option<Signature>, Option<Signature>, 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(
@ -2427,7 +2444,7 @@ pub mod rpc_full {
meta: Self::Metadata,
address_strs: Vec<String>,
config: Option<RpcEpochConfig>,
) -> Result<Vec<Option<RpcInflationReward>>>;
) -> BoxFuture<Result<Vec<Option<RpcInflationReward>>>>;
#[rpc(meta, name = "getInflationGovernor")]
fn get_inflation_governor(
@ -2496,7 +2513,7 @@ pub mod rpc_full {
meta: Self::Metadata,
signature_strs: Vec<String>,
config: Option<RpcSignatureStatusConfig>,
) -> Result<RpcResponse<Vec<Option<TransactionStatus>>>>;
) -> BoxFuture<Result<RpcResponse<Vec<Option<TransactionStatus>>>>>;
#[rpc(meta, name = "getMaxRetransmitSlot")]
fn get_max_retransmit_slot(&self, meta: Self::Metadata) -> Result<Slot>;
@ -2567,11 +2584,14 @@ pub mod rpc_full {
meta: Self::Metadata,
slot: Slot,
config: Option<RpcEncodingConfigWrapper<RpcBlockConfig>>,
) -> Result<Option<UiConfirmedBlock>>;
) -> BoxFuture<Result<Option<UiConfirmedBlock>>>;
#[rpc(meta, name = "getBlockTime")]
fn get_block_time(&self, meta: Self::Metadata, slot: Slot)
-> Result<Option<UnixTimestamp>>;
fn get_block_time(
&self,
meta: Self::Metadata,
slot: Slot,
) -> BoxFuture<Result<Option<UnixTimestamp>>>;
#[rpc(meta, name = "getBlocks")]
fn get_blocks(
@ -2580,7 +2600,7 @@ pub mod rpc_full {
start_slot: Slot,
config: Option<RpcBlocksConfigWrapper>,
commitment: Option<CommitmentConfig>,
) -> Result<Vec<Slot>>;
) -> BoxFuture<Result<Vec<Slot>>>;
#[rpc(meta, name = "getBlocksWithLimit")]
fn get_blocks_with_limit(
@ -2589,7 +2609,7 @@ pub mod rpc_full {
start_slot: Slot,
limit: usize,
commitment: Option<CommitmentConfig>,
) -> Result<Vec<Slot>>;
) -> BoxFuture<Result<Vec<Slot>>>;
#[rpc(meta, name = "getTransaction")]
fn get_transaction(
@ -2597,7 +2617,7 @@ pub mod rpc_full {
meta: Self::Metadata,
signature_str: String,
config: Option<RpcEncodingConfigWrapper<RpcTransactionConfig>>,
) -> Result<Option<EncodedConfirmedTransaction>>;
) -> BoxFuture<Result<Option<EncodedConfirmedTransaction>>>;
#[rpc(meta, name = "getSignaturesForAddress")]
fn get_signatures_for_address(
@ -2605,10 +2625,10 @@ pub mod rpc_full {
meta: Self::Metadata,
address: String,
config: Option<RpcSignaturesForAddressConfig>,
) -> Result<Vec<RpcConfirmedTransactionStatusWithSignature>>;
) -> BoxFuture<Result<Vec<RpcConfirmedTransactionStatusWithSignature>>>;
#[rpc(meta, name = "getFirstAvailableBlock")]
fn get_first_available_block(&self, meta: Self::Metadata) -> Result<Slot>;
fn get_first_available_block(&self, meta: Self::Metadata) -> BoxFuture<Result<Slot>>;
#[rpc(meta, name = "getStakeActivation")]
fn get_stake_activation(
@ -2914,22 +2934,27 @@ pub mod rpc_full {
meta: Self::Metadata,
signature_strs: Vec<String>,
config: Option<RpcSignatureStatusConfig>,
) -> Result<RpcResponse<Vec<Option<TransactionStatus>>>> {
) -> BoxFuture<Result<RpcResponse<Vec<Option<TransactionStatus>>>>> {
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<Signature> = vec![];
for signature_str in signature_strs {
signatures.push(verify_signature(&signature_str)?);
match verify_signature(&signature_str) {
Ok(signature) => {
signatures.push(signature);
}
meta.get_signature_statuses(signatures, config)
Err(err) => return Box::pin(future::err(err)),
}
}
Box::pin(async move { meta.get_signature_statuses(signatures, config).await })
}
fn get_max_retransmit_slot(&self, meta: Self::Metadata) -> Result<Slot> {
@ -3239,9 +3264,9 @@ pub mod rpc_full {
meta: Self::Metadata,
slot: Slot,
config: Option<RpcEncodingConfigWrapper<RpcBlockConfig>>,
) -> Result<Option<UiConfirmedBlock>> {
) -> BoxFuture<Result<Option<UiConfirmedBlock>>> {
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(
@ -3250,14 +3275,17 @@ pub mod rpc_full {
start_slot: Slot,
config: Option<RpcBlocksConfigWrapper>,
commitment: Option<CommitmentConfig>,
) -> Result<Vec<Slot>> {
) -> BoxFuture<Result<Vec<Slot>>> {
let (end_slot, maybe_commitment) =
config.map(|config| config.unzip()).unwrap_or_default();
debug!(
"get_blocks rpc request received: {}-{:?}",
start_slot, end_slot
);
Box::pin(async move {
meta.get_blocks(start_slot, end_slot, commitment.or(maybe_commitment))
.await
})
}
fn get_blocks_with_limit(
@ -3266,20 +3294,23 @@ pub mod rpc_full {
start_slot: Slot,
limit: usize,
commitment: Option<CommitmentConfig>,
) -> Result<Vec<Slot>> {
) -> BoxFuture<Result<Vec<Slot>>> {
debug!(
"get_blocks_with_limit rpc request received: {}-{}",
start_slot, limit,
);
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<Option<UnixTimestamp>> {
meta.get_block_time(slot)
) -> BoxFuture<Result<Option<UnixTimestamp>>> {
Box::pin(async move { meta.get_block_time(slot).await })
}
fn get_transaction(
@ -3287,10 +3318,13 @@ pub mod rpc_full {
meta: Self::Metadata,
signature_str: String,
config: Option<RpcEncodingConfigWrapper<RpcTransactionConfig>>,
) -> Result<Option<EncodedConfirmedTransaction>> {
) -> BoxFuture<Result<Option<EncodedConfirmedTransaction>>> {
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(
@ -3298,35 +3332,28 @@ pub mod rpc_full {
meta: Self::Metadata,
address: String,
config: Option<RpcSignaturesForAddressConfig>,
) -> Result<Vec<RpcConfirmedTransactionStatusWithSignature>> {
let address = verify_pubkey(&address)?;
) -> BoxFuture<Result<Vec<RpcConfirmedTransactionStatusWithSignature>>> {
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<Slot> {
fn get_first_available_block(&self, meta: Self::Metadata) -> BoxFuture<Result<Slot>> {
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_stake_activation(
@ -3437,7 +3464,7 @@ pub mod rpc_full {
meta: Self::Metadata,
address_strs: Vec<String>,
config: Option<RpcEpochConfig>,
) -> Result<Vec<Option<RpcInflationReward>>> {
) -> BoxFuture<Result<Vec<Option<RpcInflationReward>>>> {
debug!(
"get_inflation_reward rpc request received: {:?}",
address_strs.len()
@ -3445,10 +3472,15 @@ pub mod rpc_full {
let mut addresses: Vec<Pubkey> = 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 })
}
fn get_token_account_balance(
@ -3539,7 +3571,7 @@ pub mod rpc_deprecated_v1_7 {
meta: Self::Metadata,
slot: Slot,
config: Option<RpcEncodingConfigWrapper<RpcConfirmedBlockConfig>>,
) -> Result<Option<UiConfirmedBlock>>;
) -> BoxFuture<Result<Option<UiConfirmedBlock>>>;
// DEPRECATED
#[rpc(meta, name = "getConfirmedBlocks")]
@ -3549,7 +3581,7 @@ pub mod rpc_deprecated_v1_7 {
start_slot: Slot,
config: Option<RpcConfirmedBlocksConfigWrapper>,
commitment: Option<CommitmentConfig>,
) -> Result<Vec<Slot>>;
) -> BoxFuture<Result<Vec<Slot>>>;
// DEPRECATED
#[rpc(meta, name = "getConfirmedBlocksWithLimit")]
@ -3559,7 +3591,7 @@ pub mod rpc_deprecated_v1_7 {
start_slot: Slot,
limit: usize,
commitment: Option<CommitmentConfig>,
) -> Result<Vec<Slot>>;
) -> BoxFuture<Result<Vec<Slot>>>;
// DEPRECATED
#[rpc(meta, name = "getConfirmedTransaction")]
@ -3568,7 +3600,7 @@ pub mod rpc_deprecated_v1_7 {
meta: Self::Metadata,
signature_str: String,
config: Option<RpcEncodingConfigWrapper<RpcConfirmedTransactionConfig>>,
) -> Result<Option<EncodedConfirmedTransaction>>;
) -> BoxFuture<Result<Option<EncodedConfirmedTransaction>>>;
// DEPRECATED
#[rpc(meta, name = "getConfirmedSignaturesForAddress2")]
@ -3577,7 +3609,7 @@ pub mod rpc_deprecated_v1_7 {
meta: Self::Metadata,
address: String,
config: Option<RpcGetConfirmedSignaturesForAddress2Config>,
) -> Result<Vec<RpcConfirmedTransactionStatusWithSignature>>;
) -> BoxFuture<Result<Vec<RpcConfirmedTransactionStatusWithSignature>>>;
}
pub struct DeprecatedV1_7Impl;
@ -3589,9 +3621,12 @@ pub mod rpc_deprecated_v1_7 {
meta: Self::Metadata,
slot: Slot,
config: Option<RpcEncodingConfigWrapper<RpcConfirmedBlockConfig>>,
) -> Result<Option<UiConfirmedBlock>> {
) -> BoxFuture<Result<Option<UiConfirmedBlock>>> {
debug!("get_confirmed_block rpc request received: {:?}", slot);
Box::pin(async move {
meta.get_block(slot, config.map(|config| config.convert()))
.await
})
}
fn get_confirmed_blocks(
@ -3600,14 +3635,17 @@ pub mod rpc_deprecated_v1_7 {
start_slot: Slot,
config: Option<RpcConfirmedBlocksConfigWrapper>,
commitment: Option<CommitmentConfig>,
) -> Result<Vec<Slot>> {
) -> BoxFuture<Result<Vec<Slot>>> {
let (end_slot, maybe_commitment) =
config.map(|config| config.unzip()).unwrap_or_default();
debug!(
"get_confirmed_blocks rpc request received: {}-{:?}",
start_slot, end_slot
);
Box::pin(async move {
meta.get_blocks(start_slot, end_slot, commitment.or(maybe_commitment))
.await
})
}
fn get_confirmed_blocks_with_limit(
@ -3616,12 +3654,15 @@ pub mod rpc_deprecated_v1_7 {
start_slot: Slot,
limit: usize,
commitment: Option<CommitmentConfig>,
) -> Result<Vec<Slot>> {
) -> BoxFuture<Result<Vec<Slot>>> {
debug!(
"get_confirmed_blocks_with_limit rpc request received: {}-{}",
start_slot, limit,
);
Box::pin(async move {
meta.get_blocks_with_limit(start_slot, limit, commitment)
.await
})
}
fn get_confirmed_transaction(
@ -3629,13 +3670,19 @@ pub mod rpc_deprecated_v1_7 {
meta: Self::Metadata,
signature_str: String,
config: Option<RpcEncodingConfigWrapper<RpcConfirmedTransactionConfig>>,
) -> Result<Option<EncodedConfirmedTransaction>> {
) -> BoxFuture<Result<Option<EncodedConfirmedTransaction>>> {
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(
@ -3643,30 +3690,23 @@ pub mod rpc_deprecated_v1_7 {
meta: Self::Metadata,
address: String,
config: Option<RpcGetConfirmedSignaturesForAddress2Config>,
) -> Result<Vec<RpcConfirmedTransactionStatusWithSignature>> {
let address = verify_pubkey(&address)?;
) -> BoxFuture<Result<Vec<RpcConfirmedTransactionStatusWithSignature>>> {
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)
}
}
}
@ -4181,7 +4221,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))),
@ -5740,7 +5779,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))),
@ -6021,7 +6059,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))),
@ -7447,7 +7484,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))),

View File

@ -39,7 +39,6 @@ use {
sync::{mpsc::channel, Arc, Mutex, RwLock},
thread::{self, Builder, JoinHandle},
},
tokio::runtime,
tokio_util::codec::{BytesCodec, FramedRead},
};
@ -118,10 +117,8 @@ impl RpcRequestMiddleware {
}
#[cfg(unix)]
async fn open_no_follow(path: impl AsRef<Path>) -> std::io::Result<tokio_02::fs::File> {
// 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<Path>) -> std::io::Result<tokio::fs::File> {
tokio::fs::OpenOptions::new()
.read(true)
.write(false)
.create(false)
@ -131,10 +128,9 @@ impl RpcRequestMiddleware {
}
#[cfg(not(unix))]
async fn open_no_follow(path: impl AsRef<Path>) -> std::io::Result<tokio_02::fs::File> {
async fn open_no_follow(path: impl AsRef<Path>) -> std::io::Result<tokio::fs::File> {
// 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 {
@ -306,9 +302,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"),
@ -364,7 +368,6 @@ impl JsonRpcService {
health.clone(),
cluster_info.clone(),
genesis_hash,
runtime,
bigtable_ledger_storage,
optimistically_confirmed_bank,
largest_accounts_cache,
@ -389,23 +392,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())
@ -431,7 +417,7 @@ impl JsonRpcService {
io,
move |_req: &hyper::Request<hyper::Body>| request_processor.clone(),
)
.event_loop_executor(event_loop.handle().clone())
.event_loop_executor(runtime.handle().clone())
.threads(1)
.cors(DomainsValidation::AllowOnly(vec![
AccessControlAllowOrigin::Any,
@ -510,6 +496,7 @@ mod tests {
io::Write,
net::{IpAddr, Ipv4Addr},
},
tokio::runtime::Runtime,
};
#[test]
@ -648,7 +635,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();

View File

@ -19,11 +19,11 @@ console = "0.14.1"
core_affinity = "0.5.10"
fd-lock = "2.0.0"
indicatif = "0.15.0"
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.11"
num_cpus = "1.13.0"
rand = "0.7.0"

View File

@ -134,10 +134,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();

View File

@ -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...");