diff --git a/Cargo.lock b/Cargo.lock index d05bbd06f4..fb458ae025 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -132,7 +132,7 @@ dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -182,7 +182,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -309,7 +309,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -319,8 +319,8 @@ dependencies = [ "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -334,7 +334,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "feature-probe 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -423,7 +423,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -478,7 +478,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -619,7 +619,7 @@ dependencies = [ "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "publicsuffix 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -759,7 +759,7 @@ dependencies = [ "csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -921,7 +921,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -939,7 +939,7 @@ dependencies = [ "curve25519-dalek 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1081,7 +1081,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1295,7 +1295,7 @@ name = "generic-array" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1772,7 +1772,7 @@ dependencies = [ "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-pubsub 14.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1786,8 +1786,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1832,7 +1832,7 @@ dependencies = [ "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1893,8 +1893,8 @@ dependencies = [ "petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2377,7 +2377,7 @@ dependencies = [ "data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multihash 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3115,7 +3115,7 @@ dependencies = [ "mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3153,7 +3153,7 @@ dependencies = [ "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project-lite 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3344,10 +3344,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.104" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3355,12 +3355,12 @@ name = "serde_bytes" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.104" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3375,7 +3375,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3385,7 +3385,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3396,7 +3396,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3407,7 +3407,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3615,8 +3615,8 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "solana-archiver-utils 1.0.11", "solana-chacha 1.0.11", @@ -3755,8 +3755,8 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana-sdk 1.0.11", ] @@ -3769,8 +3769,8 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana-runtime 1.0.11", "solana-sdk 1.0.11", "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3844,8 +3844,8 @@ dependencies = [ "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "pretty-hex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "solana-budget-program 1.0.11", "solana-clap-utils 1.0.11", @@ -3875,8 +3875,8 @@ version = "1.0.11" dependencies = [ "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3894,12 +3894,13 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "solana-logger 1.0.11", "solana-net-utils 1.0.11", "solana-sdk 1.0.11", + "solana-transaction-status 1.0.11", "solana-vote-program 1.0.11", "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "tungstenite 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3913,8 +3914,8 @@ dependencies = [ "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana-logger 1.0.11", "solana-sdk 1.0.11", ] @@ -3952,8 +3953,8 @@ dependencies = [ "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "serial_test 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "serial_test_derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3975,6 +3976,7 @@ dependencies = [ "solana-stake-program 1.0.11", "solana-storage-program 1.0.11", "solana-sys-tuner 1.0.11", + "solana-transaction-status 1.0.11", "solana-vote-program 1.0.11", "solana-vote-signer 1.0.11", "systemstat 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4003,7 +4005,7 @@ dependencies = [ "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4018,8 +4020,8 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana-logger 1.0.11", "solana-metrics 1.0.11", "solana-runtime 1.0.11", @@ -4044,8 +4046,8 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana-clap-utils 1.0.11", "solana-logger 1.0.11", "solana-metrics 1.0.11", @@ -4061,7 +4063,7 @@ dependencies = [ "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", "solana-clap-utils 1.0.11", @@ -4121,8 +4123,8 @@ dependencies = [ "nix 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", "solana-clap-utils 1.0.11", "solana-client 1.0.11", @@ -4175,11 +4177,10 @@ dependencies = [ "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "rocksdb 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_bytes 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "solana-budget-program 1.0.11", - "solana-client 1.0.11", "solana-genesis-programs 1.0.11", "solana-logger 1.0.11", "solana-measure 1.0.11", @@ -4191,6 +4192,7 @@ dependencies = [ "solana-runtime 1.0.11", "solana-sdk 1.0.11", "solana-stake-program 1.0.11", + "solana-transaction-status 1.0.11", "solana-vote-program 1.0.11", "symlink 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tar 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4266,7 +4268,7 @@ version = "1.0.11" dependencies = [ "byte-unit 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "solana-clap-utils 1.0.11", "solana-logger 1.0.11", @@ -4324,9 +4326,9 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_bytes 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "solana-logger 1.0.11", "solana-sdk 1.0.11", @@ -4350,7 +4352,7 @@ version = "1.0.11" dependencies = [ "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "solana-clap-utils 1.0.11", "solana-logger 1.0.11", @@ -4366,8 +4368,8 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "nix 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", "solana-clap-utils 1.0.11", "solana-logger 1.0.11", @@ -4408,7 +4410,7 @@ dependencies = [ "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana-budget-program 1.0.11", "solana-logger 1.0.11", "solana-metrics 1.0.11", @@ -4470,8 +4472,8 @@ dependencies = [ "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana-bpf-loader-program 1.0.11", "solana-logger 1.0.11", "solana-measure 1.0.11", @@ -4491,7 +4493,7 @@ name = "solana-scripts" version = "1.0.11" dependencies = [ "csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4516,9 +4518,9 @@ dependencies = [ "pbkdf2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_bytes 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "solana-crate-features 1.0.11", @@ -4560,8 +4562,8 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana-config-program 1.0.11", "solana-logger 1.0.11", "solana-metrics 1.0.11", @@ -4580,8 +4582,8 @@ dependencies = [ "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana-logger 1.0.11", "solana-sdk 1.0.11", ] @@ -4601,6 +4603,17 @@ dependencies = [ "users 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "solana-transaction-status" +version = "1.0.11" +dependencies = [ + "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bs58 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.0.11", +] + [[package]] name = "solana-upload-perf" version = "1.0.11" @@ -4647,8 +4660,8 @@ dependencies = [ "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana-config-program 1.0.11", "solana-runtime 1.0.11", "solana-sdk 1.0.11", @@ -4663,8 +4676,8 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana-logger 1.0.11", "solana-metrics 1.0.11", "solana-sdk 1.0.11", @@ -4750,7 +4763,7 @@ dependencies = [ "parity-multiaddr 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "prost 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana_libra_crypto 0.0.1-sol4 (registry+https://github.com/rust-lang/crates.io-index)", "solana_libra_failure_ext 0.0.1-sol4 (registry+https://github.com/rust-lang/crates.io-index)", "solana_libra_logger 0.0.1-sol4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4777,7 +4790,7 @@ dependencies = [ "proptest 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", "proptest-derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "solana_libra_canonical_serialization 0.0.1-sol4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4853,7 +4866,7 @@ dependencies = [ "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4883,7 +4896,7 @@ version = "0.0.1-sol4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proptest 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4944,7 +4957,7 @@ dependencies = [ "prost-build 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "radix_trie 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana_libra_canonical_serialization 0.0.1-sol4 (registry+https://github.com/rust-lang/crates.io-index)", "solana_libra_crypto 0.0.1-sol4 (registry+https://github.com/rust-lang/crates.io-index)", "solana_libra_failure_ext 0.0.1-sol4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4964,7 +4977,7 @@ dependencies = [ "mirai-annotations 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "proptest 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", "proptest-derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "solana_libra_canonical_serialization 0.0.1-sol4 (registry+https://github.com/rust-lang/crates.io-index)", "solana_libra_crypto 0.0.1-sol4 (registry+https://github.com/rust-lang/crates.io-index)", "solana_libra_failure_ext 0.0.1-sol4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5069,7 +5082,7 @@ dependencies = [ "new_debug_unreachable 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache_codegen 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -5365,7 +5378,7 @@ dependencies = [ "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand04_compat 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -5658,7 +5671,7 @@ name = "toml" version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5915,7 +5928,7 @@ version = "0.2.56" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-macro 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -6562,9 +6575,9 @@ dependencies = [ "checksum security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e31493fc37615debb8c5090a7aeb4a9730bc61e77ab10b9af59f1a202284f895" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +"checksum serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)" = "e707fbbf255b8fc8c3b99abb91e7257a622caeb20a9818cbadbeeede4e0932ff" "checksum serde_bytes 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "325a073952621257820e7a3469f55ba4726d8b28657e7e36653d1c36dc2c84ae" -"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" +"checksum serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)" = "ac5d00fc561ba2724df6758a17de23df5914f20e41cb00f94d5b7ae42fffaff8" "checksum serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)" = "21b01d7f0288608a01dca632cf1df859df6fd6ffa885300fc275ce2ba6221953" "checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" "checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" diff --git a/Cargo.toml b/Cargo.toml index 58011c8bc0..ab422aafd9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,7 @@ members = [ "sdk-c", "scripts", "sys-tuner", + "transaction-status", "upload-perf", "net-utils", "vote-signer", diff --git a/client/Cargo.toml b/client/Cargo.toml index 2cea18135a..3053dc0a7a 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -21,6 +21,7 @@ serde_derive = "1.0.103" serde_json = "1.0.46" solana-net-utils = { path = "../net-utils", version = "1.0.11" } solana-sdk = { path = "../sdk", version = "1.0.11" } +solana-transaction-status = { path = "../transaction-status", version = "1.0.11" } solana-vote-program = { path = "../programs/vote", version = "1.0.11" } thiserror = "1.0" tungstenite = "0.10.1" diff --git a/client/src/mock_rpc_client_request.rs b/client/src/mock_rpc_client_request.rs index f442ae6319..e1ebccb863 100644 --- a/client/src/mock_rpc_client_request.rs +++ b/client/src/mock_rpc_client_request.rs @@ -2,7 +2,7 @@ use crate::{ client_error::Result, generic_rpc_client_request::GenericRpcClientRequest, rpc_request::RpcRequest, - rpc_response::{Response, RpcResponseContext, RpcTransactionStatus}, + rpc_response::{Response, RpcResponseContext}, }; use serde_json::{Number, Value}; use solana_sdk::{ @@ -10,6 +10,7 @@ use solana_sdk::{ instruction::InstructionError, transaction::{self, TransactionError}, }; +use solana_transaction_status::TransactionStatus; use std::{collections::HashMap, sync::RwLock}; pub const PUBKEY: &str = "7RoSF9fUmdphVCpabEoefH81WwrW7orsWonXWqTXkKV8"; @@ -100,9 +101,16 @@ impl GenericRpcClientRequest for MockRpcClientRequest { let status = if self.url == "sig_not_found" { None } else { - Some(RpcTransactionStatus { status, slot: 1 }) + Some(TransactionStatus { + status, + slot: 1, + confirmations: Some(0), + }) }; - serde_json::to_value(vec![status])? + serde_json::to_value(Response { + context: RpcResponseContext { slot: 1 }, + value: vec![status], + })? } RpcRequest::GetTransactionCount => Value::Number(Number::from(1234)), RpcRequest::GetSlot => Value::Number(Number::from(0)), diff --git a/client/src/rpc_client.rs b/client/src/rpc_client.rs index d8505c937c..9c8fff499c 100644 --- a/client/src/rpc_client.rs +++ b/client/src/rpc_client.rs @@ -5,9 +5,9 @@ use crate::{ rpc_client_request::RpcClientRequest, rpc_request::{RpcError, RpcRequest}, rpc_response::{ - Response, RpcAccount, RpcBlockhashFeeCalculator, RpcConfirmedBlock, RpcContactInfo, - RpcEpochInfo, RpcFeeCalculator, RpcFeeRateGovernor, RpcIdentity, RpcKeyedAccount, - RpcLeaderSchedule, RpcResult, RpcTransactionStatus, RpcVersionInfo, RpcVoteAccountStatus, + Response, RpcAccount, RpcBlockhashFeeCalculator, RpcContactInfo, RpcEpochInfo, + RpcFeeCalculator, RpcFeeRateGovernor, RpcIdentity, RpcKeyedAccount, RpcLeaderSchedule, + RpcResult, RpcVersionInfo, RpcVoteAccountStatus, }, }; use bincode::serialize; @@ -27,6 +27,7 @@ use solana_sdk::{ signers::Signers, transaction::{self, Transaction, TransactionError}, }; +use solana_transaction_status::{ConfirmedBlock, TransactionStatus}; use solana_vote_program::vote_state::MAX_LOCKOUT_HISTORY; use std::{ error, @@ -123,9 +124,11 @@ impl RpcClient { json!([[signature.to_string()], commitment_config]), 5, )?; - let result: Vec> = + let result: Response>> = serde_json::from_value(signature_status).unwrap(); - Ok(result[0].clone().map(|status_meta| status_meta.status)) + Ok(result.value[0] + .clone() + .map(|status_meta| status_meta.status)) } pub fn get_slot(&self) -> ClientResult { @@ -172,7 +175,7 @@ impl RpcClient { .map_err(|err| ClientError::new_with_command(err.into(), "GetClusterNodes")) } - pub fn get_confirmed_block(&self, slot: Slot) -> ClientResult { + pub fn get_confirmed_block(&self, slot: Slot) -> ClientResult { let response = self .client .send(&RpcRequest::GetConfirmedBlock, json!([slot]), 0) @@ -922,14 +925,25 @@ impl RpcClient { let response = self .client .send( - &RpcRequest::GetNumBlocksSinceSignatureConfirmation, - json!([signature.to_string(), CommitmentConfig::recent().ok()]), + &RpcRequest::GetSignatureStatus, + json!([[signature.to_string()], CommitmentConfig::recent().ok()]), 1, ) - .map_err(|err| err.into_with_command("GetNumBlocksSinceSignatureConfirmation"))?; - serde_json::from_value(response).map_err(|err| { - ClientError::new_with_command(err.into(), "GetNumBlocksSinceSignatureConfirmation") - }) + .map_err(|err| err.into_with_command("GetSignatureStatus"))?; + let result: Response>> = + serde_json::from_value(response).unwrap(); + + let confirmations = result.value[0] + .clone() + .ok_or_else(|| { + ClientError::new_with_command( + ClientErrorKind::Custom("signature not found".to_string()), + "GetSignatureStatus", + ) + })? + .confirmations + .unwrap_or(MAX_LOCKOUT_HISTORY + 1); + Ok(confirmations) } pub fn send_and_confirm_transaction_with_spinner( diff --git a/client/src/rpc_request.rs b/client/src/rpc_request.rs index 312b3014d5..4d5a9f4899 100644 --- a/client/src/rpc_request.rs +++ b/client/src/rpc_request.rs @@ -18,7 +18,6 @@ pub enum RpcRequest { GetIdentity, GetInflation, GetLeaderSchedule, - GetNumBlocksSinceSignatureConfirmation, GetProgramAccounts, GetRecentBlockhash, GetFeeCalculatorForBlockhash, @@ -60,9 +59,6 @@ impl RpcRequest { RpcRequest::GetIdentity => "getIdentity", RpcRequest::GetInflation => "getInflation", RpcRequest::GetLeaderSchedule => "getLeaderSchedule", - RpcRequest::GetNumBlocksSinceSignatureConfirmation => { - "getNumBlocksSinceSignatureConfirmation" - } RpcRequest::GetProgramAccounts => "getProgramAccounts", RpcRequest::GetRecentBlockhash => "getRecentBlockhash", RpcRequest::GetFeeCalculatorForBlockhash => "getFeeCalculatorForBlockhash", diff --git a/client/src/rpc_response.rs b/client/src/rpc_response.rs index 65de9459a5..389cee91f0 100644 --- a/client/src/rpc_response.rs +++ b/client/src/rpc_response.rs @@ -1,12 +1,10 @@ use crate::{client_error, rpc_request::RpcError}; -use bincode::serialize; use solana_sdk::{ account::Account, clock::{Epoch, Slot}, fee_calculator::{FeeCalculator, FeeRateGovernor}, - message::MessageHeader, pubkey::Pubkey, - transaction::{Result, Transaction}, + transaction::Result, }; use std::{collections::HashMap, net::SocketAddr, str::FromStr}; @@ -30,126 +28,6 @@ pub struct RpcBlockCommitment { pub total_stake: u64, } -#[derive(Debug, PartialEq, Serialize, Deserialize)] -pub struct RpcReward { - pub pubkey: String, - pub lamports: i64, -} - -pub type RpcRewards = Vec; - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct RpcConfirmedBlock { - pub previous_blockhash: String, - pub blockhash: String, - pub parent_slot: Slot, - pub transactions: Vec, - pub rewards: RpcRewards, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct RpcTransactionWithStatusMeta { - pub transaction: RpcEncodedTransaction, - pub meta: Option, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] -#[serde(rename_all = "camelCase")] -pub enum RpcTransactionEncoding { - Binary, - Json, -} - -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase", untagged)] -pub enum RpcEncodedTransaction { - Binary(String), - Json(RpcTransaction), -} - -impl RpcEncodedTransaction { - pub fn encode(transaction: Transaction, encoding: RpcTransactionEncoding) -> Self { - if encoding == RpcTransactionEncoding::Json { - RpcEncodedTransaction::Json(RpcTransaction { - signatures: transaction - .signatures - .iter() - .map(|sig| sig.to_string()) - .collect(), - message: RpcMessage { - header: transaction.message.header, - account_keys: transaction - .message - .account_keys - .iter() - .map(|pubkey| pubkey.to_string()) - .collect(), - recent_blockhash: transaction.message.recent_blockhash.to_string(), - instructions: transaction - .message - .instructions - .iter() - .map(|instruction| RpcCompiledInstruction { - program_id_index: instruction.program_id_index, - accounts: instruction.accounts.clone(), - data: bs58::encode(instruction.data.clone()).into_string(), - }) - .collect(), - }, - }) - } else { - RpcEncodedTransaction::Binary( - bs58::encode(serialize(&transaction).unwrap()).into_string(), - ) - } - } -} - -/// A duplicate representation of a Transaction for pretty JSON serialization -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct RpcTransaction { - pub signatures: Vec, - pub message: RpcMessage, -} - -/// A duplicate representation of a Message for pretty JSON serialization -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct RpcMessage { - pub header: MessageHeader, - pub account_keys: Vec, - pub recent_blockhash: String, - pub instructions: Vec, -} - -/// A duplicate representation of a Message for pretty JSON serialization -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct RpcCompiledInstruction { - pub program_id_index: u8, - pub accounts: Vec, - pub data: String, -} - -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct RpcTransactionStatusMeta { - pub status: Result<()>, - pub fee: u64, - pub pre_balances: Vec, - pub post_balances: Vec, -} - -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct RpcTransactionStatus { - pub slot: Slot, - pub status: Result<()>, -} - #[derive(Serialize, Deserialize, Clone, Debug)] #[serde(rename_all = "camelCase")] pub struct RpcBlockhashFeeCalculator { diff --git a/core/Cargo.toml b/core/Cargo.toml index 740fc5bcff..fd72b19d03 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -46,6 +46,7 @@ serde_json = "1.0.46" solana-budget-program = { path = "../programs/budget", version = "1.0.11" } solana-clap-utils = { path = "../clap-utils", version = "1.0.11" } solana-client = { path = "../client", version = "1.0.11" } +solana-transaction-status = { path = "../transaction-status", version = "1.0.11" } solana-faucet = { path = "../faucet", version = "1.0.11" } ed25519-dalek = "=1.0.0-pre.1" solana-ledger = { path = "../ledger", version = "1.0.11" } diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index a16de62a4f..de118134c9 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -1017,7 +1017,6 @@ mod tests { }; use crossbeam_channel::unbounded; use itertools::Itertools; - use solana_client::rpc_response::{RpcEncodedTransaction, RpcTransactionWithStatusMeta}; use solana_ledger::{ blockstore::entries_to_test_shreds, entry::{next_entry, Entry, EntrySlice}, @@ -1030,6 +1029,7 @@ mod tests { system_transaction, transaction::TransactionError, }; + use solana_transaction_status::{EncodedTransaction, TransactionWithStatusMeta}; use std::{sync::atomic::Ordering, thread::sleep}; #[test] @@ -1975,10 +1975,10 @@ mod tests { let confirmed_block = blockstore.get_confirmed_block(bank.slot(), None).unwrap(); assert_eq!(confirmed_block.transactions.len(), 3); - for RpcTransactionWithStatusMeta { transaction, meta } in + for TransactionWithStatusMeta { transaction, meta } in confirmed_block.transactions.into_iter() { - if let RpcEncodedTransaction::Json(transaction) = transaction { + if let EncodedTransaction::Json(transaction) = transaction { if transaction.signatures[0] == success_signature.to_string() { assert_eq!(meta.unwrap().status, Ok(())); } else if transaction.signatures[0] == ix_error_signature.to_string() { diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs index 926dabb061..33e3dff9ca 100644 --- a/core/src/replay_stage.rs +++ b/core/src/replay_stage.rs @@ -1066,7 +1066,6 @@ pub(crate) mod tests { transaction_status_service::TransactionStatusService, }; use crossbeam_channel::unbounded; - use solana_client::rpc_response::{RpcEncodedTransaction, RpcTransactionWithStatusMeta}; use solana_ledger::{ blockstore::make_slot_entries, blockstore::{entries_to_test_shreds, BlockstoreError}, @@ -1090,6 +1089,7 @@ pub(crate) mod tests { transaction::TransactionError, }; use solana_stake_program::stake_state; + use solana_transaction_status::{EncodedTransaction, TransactionWithStatusMeta}; use solana_vote_program::{ vote_state::{self, Vote, VoteState, VoteStateVersions}, vote_transaction, @@ -1899,10 +1899,10 @@ pub(crate) mod tests { let confirmed_block = blockstore.get_confirmed_block(slot, None).unwrap(); assert_eq!(confirmed_block.transactions.len(), 3); - for RpcTransactionWithStatusMeta { transaction, meta } in + for TransactionWithStatusMeta { transaction, meta } in confirmed_block.transactions.into_iter() { - if let RpcEncodedTransaction::Json(transaction) = transaction { + if let EncodedTransaction::Json(transaction) = transaction { if transaction.signatures[0] == signatures[0].to_string() { assert_eq!(meta.unwrap().status, Ok(())); } else if transaction.signatures[0] == signatures[1].to_string() { diff --git a/core/src/rewards_recorder_service.rs b/core/src/rewards_recorder_service.rs index 525709052e..18fdbcc542 100644 --- a/core/src/rewards_recorder_service.rs +++ b/core/src/rewards_recorder_service.rs @@ -1,7 +1,7 @@ use crossbeam_channel::{Receiver, RecvTimeoutError, Sender}; -use solana_client::rpc_response::RpcReward; use solana_ledger::blockstore::Blockstore; use solana_sdk::{clock::Slot, pubkey::Pubkey}; +use solana_transaction_status::Reward; use std::{ sync::{ atomic::{AtomicBool, Ordering}, @@ -49,7 +49,7 @@ impl RewardsRecorderService { let (slot, rewards) = rewards_receiver.recv_timeout(Duration::from_secs(1))?; let rpc_rewards = rewards .into_iter() - .map(|(pubkey, lamports)| RpcReward { + .map(|(pubkey, lamports)| Reward { pubkey: pubkey.to_string(), lamports, }) diff --git a/core/src/rpc.rs b/core/src/rpc.rs index 5402607518..914fe332a1 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -24,6 +24,7 @@ use solana_sdk::{ timing::slot_duration_from_slots_per_year, transaction::Transaction, }; +use solana_transaction_status::{ConfirmedBlock, TransactionEncoding, TransactionStatus}; use solana_vote_program::vote_state::{VoteState, MAX_LOCKOUT_HISTORY}; use std::{ collections::HashMap, @@ -215,25 +216,6 @@ impl JsonRpcRequestProcessor { } } - pub fn get_signature_confirmation_status( - &self, - signature: Signature, - commitment: Option, - ) -> Option { - self.bank(commitment) - .get_signature_confirmation_status(&signature) - .map( - |SignatureConfirmationStatus { - confirmations, - status, - .. - }| RpcSignatureConfirmation { - confirmations, - status, - }, - ) - } - fn get_slot(&self, commitment: Option) -> Result { Ok(self.bank(commitment).slot()) } @@ -365,8 +347,8 @@ impl JsonRpcRequestProcessor { pub fn get_confirmed_block( &self, slot: Slot, - encoding: Option, - ) -> Result> { + encoding: Option, + ) -> Result> { if self.config.enable_rpc_transaction_history { Ok(self.blockstore.get_confirmed_block(slot, encoding).ok()) } else { @@ -420,21 +402,33 @@ impl JsonRpcRequestProcessor { &self, signatures: Vec, commitment: Option, - ) -> Result>> { - let mut statuses: Vec> = vec![]; + ) -> RpcResponse>> { + let mut statuses: Vec> = vec![]; let bank = self.bank(commitment); for signature in signatures { let status = bank.get_signature_confirmation_status(&signature).map( - |SignatureConfirmationStatus { slot, status, .. }| RpcTransactionStatus { + |SignatureConfirmationStatus { + slot, + status, + confirmations, + }| TransactionStatus { slot, status, + confirmations: if confirmations <= MAX_LOCKOUT_HISTORY { + Some(confirmations) + } else { + None + }, }, ); statuses.push(status); } - Ok(statuses) + Ok(Response { + context: RpcResponseContext { slot: bank.slot() }, + value: statuses, + }) } } @@ -564,7 +558,7 @@ pub trait RpcSol { meta: Self::Metadata, signature_strs: Vec, commitment: Option, - ) -> Result>>; + ) -> RpcResponse>>; #[rpc(meta, name = "getSlot")] fn get_slot(&self, meta: Self::Metadata, commitment: Option) -> Result; @@ -631,22 +625,6 @@ pub trait RpcSol { #[rpc(meta, name = "validatorExit")] fn validator_exit(&self, meta: Self::Metadata) -> Result; - #[rpc(meta, name = "getNumBlocksSinceSignatureConfirmation")] - fn get_num_blocks_since_signature_confirmation( - &self, - meta: Self::Metadata, - signature_str: String, - commitment: Option, - ) -> Result>; - - #[rpc(meta, name = "getSignatureConfirmation")] - fn get_signature_confirmation( - &self, - meta: Self::Metadata, - signature_str: String, - commitment: Option, - ) -> Result>; - #[rpc(meta, name = "getIdentity")] fn get_identity(&self, meta: Self::Metadata) -> Result; @@ -661,8 +639,8 @@ pub trait RpcSol { &self, meta: Self::Metadata, slot: Slot, - encoding: Option, - ) -> Result>; + encoding: Option, + ) -> Result>; #[rpc(meta, name = "getBlockTime")] fn get_block_time(&self, meta: Self::Metadata, slot: Slot) -> Result>; @@ -910,7 +888,7 @@ impl RpcSol for RpcSolImpl { meta: Self::Metadata, signature_strs: Vec, commitment: Option, - ) -> Result>> { + ) -> RpcResponse>> { let mut signatures: Vec = vec![]; for signature_str in signature_strs { signatures.push(verify_signature(&signature_str)?); @@ -925,34 +903,6 @@ impl RpcSol for RpcSolImpl { meta.request_processor.read().unwrap().get_slot(commitment) } - fn get_num_blocks_since_signature_confirmation( - &self, - meta: Self::Metadata, - signature_str: String, - commitment: Option, - ) -> Result> { - self.get_signature_confirmation(meta, signature_str, commitment) - .map(|res| res.map(|x| x.confirmations)) - } - - fn get_signature_confirmation( - &self, - meta: Self::Metadata, - signature_str: String, - commitment: Option, - ) -> Result> { - debug!( - "get_signature_confirmation rpc request received: {:?}", - signature_str - ); - let signature = verify_signature(&signature_str)?; - Ok(meta - .request_processor - .read() - .unwrap() - .get_signature_confirmation_status(signature, commitment)) - } - fn get_transaction_count( &self, meta: Self::Metadata, @@ -1039,7 +989,9 @@ impl RpcSol for RpcSolImpl { .request_processor .read() .unwrap() - .get_signature_confirmation_status(signature, commitment.clone()) + .get_signature_status(vec![signature], commitment.clone())? + .value[0] + .clone() .map(|x| x.status); if signature_status == Some(Ok(())) { @@ -1181,8 +1133,8 @@ impl RpcSol for RpcSolImpl { &self, meta: Self::Metadata, slot: Slot, - encoding: Option, - ) -> Result> { + encoding: Option, + ) -> Result> { meta.request_processor .read() .unwrap() @@ -1217,7 +1169,6 @@ pub mod tests { }; use bincode::deserialize; use jsonrpc_core::{MetaIoHandler, Output, Response, Value}; - use solana_client::rpc_response::{RpcEncodedTransaction, RpcTransactionWithStatusMeta}; use solana_ledger::{ blockstore::entries_to_test_shreds, blockstore_processor::fill_blockstore_slot_with_ticks, entry::next_entry_mut, get_tmp_ledger_path, @@ -1231,6 +1182,7 @@ pub mod tests { system_transaction, transaction::{self, TransactionError}, }; + use solana_transaction_status::{EncodedTransaction, TransactionWithStatusMeta}; use solana_vote_program::{ vote_instruction, vote_state::{Vote, VoteInit, MAX_LOCKOUT_HISTORY}, @@ -1813,10 +1765,10 @@ pub mod tests { let res = io.handle_request_sync(&req, meta.clone()); let expected_res: transaction::Result<()> = Ok(()); let json: Value = serde_json::from_str(&res.unwrap()).unwrap(); - let result: Vec> = - serde_json::from_value(json["result"].clone()) + let result: Option = + serde_json::from_value(json["result"]["value"][0].clone()) .expect("actual response deserialization"); - assert_eq!(expected_res, result[0].as_ref().unwrap().status); + assert_eq!(expected_res, result.as_ref().unwrap().status); // Test getSignatureStatus request on unprocessed tx let tx = system_transaction::transfer(&alice, &bob_pubkey, 10, blockhash); @@ -1826,10 +1778,10 @@ pub mod tests { ); let res = io.handle_request_sync(&req, meta.clone()); let json: Value = serde_json::from_str(&res.unwrap()).unwrap(); - let result: Vec> = - serde_json::from_value(json["result"].clone()) + let result: Option = + serde_json::from_value(json["result"]["value"][0].clone()) .expect("actual response deserialization"); - assert!(result[0].is_none()); + assert!(result.is_none()); // Test getSignatureStatus request on a TransactionError let req = format!( @@ -1842,10 +1794,10 @@ pub mod tests { InstructionError::CustomError(1), )); let json: Value = serde_json::from_str(&res.unwrap()).unwrap(); - let result: Vec> = - serde_json::from_value(json["result"].clone()) + let result: Option = + serde_json::from_value(json["result"]["value"][0].clone()) .expect("actual response deserialization"); - assert_eq!(expected_res, result[0].as_ref().unwrap().status); + assert_eq!(expected_res, result.as_ref().unwrap().status); } #[test] @@ -2284,15 +2236,15 @@ pub mod tests { let res = io.handle_request_sync(&req, meta.clone()); let result: Value = serde_json::from_str(&res.expect("actual response")) .expect("actual response deserialization"); - let confirmed_block: Option = + let confirmed_block: Option = serde_json::from_value(result["result"].clone()).unwrap(); let confirmed_block = confirmed_block.unwrap(); assert_eq!(confirmed_block.transactions.len(), 3); - for RpcTransactionWithStatusMeta { transaction, meta } in + for TransactionWithStatusMeta { transaction, meta } in confirmed_block.transactions.into_iter() { - if let RpcEncodedTransaction::Json(transaction) = transaction { + if let EncodedTransaction::Json(transaction) = transaction { if transaction.signatures[0] == confirmed_block_signatures[0].to_string() { assert_eq!(transaction.message.recent_blockhash, blockhash.to_string()); assert_eq!(meta.unwrap().status, Ok(())); @@ -2316,15 +2268,15 @@ pub mod tests { let res = io.handle_request_sync(&req, meta); let result: Value = serde_json::from_str(&res.expect("actual response")) .expect("actual response deserialization"); - let confirmed_block: Option = + let confirmed_block: Option = serde_json::from_value(result["result"].clone()).unwrap(); let confirmed_block = confirmed_block.unwrap(); assert_eq!(confirmed_block.transactions.len(), 3); - for RpcTransactionWithStatusMeta { transaction, meta } in + for TransactionWithStatusMeta { transaction, meta } in confirmed_block.transactions.into_iter() { - if let RpcEncodedTransaction::Binary(transaction) = transaction { + if let EncodedTransaction::Binary(transaction) = transaction { let decoded_transaction: Transaction = deserialize(&bs58::decode(&transaction).into_vec().unwrap()).unwrap(); if decoded_transaction.signatures[0] == confirmed_block_signatures[0] { diff --git a/core/src/transaction_status_service.rs b/core/src/transaction_status_service.rs index b541be2e12..3baef68a18 100644 --- a/core/src/transaction_status_service.rs +++ b/core/src/transaction_status_service.rs @@ -1,10 +1,10 @@ use crossbeam_channel::{Receiver, RecvTimeoutError}; -use solana_client::rpc_response::RpcTransactionStatusMeta; use solana_ledger::{blockstore::Blockstore, blockstore_processor::TransactionStatusBatch}; use solana_runtime::{ bank::{Bank, HashAgeKind}, nonce_utils, }; +use solana_transaction_status::TransactionStatusMeta; use std::{ sync::{ atomic::{AtomicBool, Ordering}, @@ -73,7 +73,7 @@ impl TransactionStatusService { blockstore .write_transaction_status( (slot, transaction.signatures[0]), - &RpcTransactionStatusMeta { + &TransactionStatusMeta { status, fee, pre_balances, diff --git a/docs/src/apps/jsonrpc-api.md b/docs/src/apps/jsonrpc-api.md index fe2ff45242..02584c10cc 100644 --- a/docs/src/apps/jsonrpc-api.md +++ b/docs/src/apps/jsonrpc-api.md @@ -31,10 +31,8 @@ To interact with a Solana node inside a JavaScript application, use the [solana- * [getInflation](jsonrpc-api.md#getinflation) * [getLeaderSchedule](jsonrpc-api.md#getleaderschedule) * [getMinimumBalanceForRentExemption](jsonrpc-api.md#getminimumbalanceforrentexemption) -* [getNumBlocksSinceSignatureConfirmation](jsonrpc-api.md#getnumblockssincesignatureconfirmation) * [getProgramAccounts](jsonrpc-api.md#getprogramaccounts) * [getRecentBlockhash](jsonrpc-api.md#getrecentblockhash) -* [getSignatureConfirmation](jsonrpc-api.md#getsignatureconfirmation) * [getSignatureStatus](jsonrpc-api.md#getsignaturestatus) * [getSlot](jsonrpc-api.md#getslot) * [getSlotLeader](jsonrpc-api.md#getslotleader) @@ -580,29 +578,6 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, " {"jsonrpc":"2.0","result":500,"id":1} ``` -### getNumBlocksSinceSignatureConfirmation - -Returns the current number of blocks since signature has been confirmed. - -#### Parameters: - -* `` - Signature of Transaction to confirm, as base-58 encoded string -* `` - (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment) - -#### Results: - -* `` - count, or null if signature not found - -#### Example: - -```bash -// Request -curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, "method":"getNumBlocksSinceSignatureConfirmation", "params":["5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW"]}' http://localhost:8899 - -// Result -{"jsonrpc":"2.0","result":8,"id":1} -``` - ### getProgramAccounts Returns all accounts owned by the provided program Pubkey @@ -660,33 +635,6 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "m {"jsonrpc":"2.0","result":{"context":{"slot":1},"value":{"blockhash":"CSymwgTNX1j3E4qhKfJAUE41nBWEwXufoYryPbkde5RR","feeCalculator":{"burnPercent":50,"lamportsPerSignature":5000,"maxLamportsPerSignature":10000,"minLamportsPerSignature":5000,"targetLamportsPerSignature":1000,"targetSignaturesPerSlot":20000}}},"id":1} ``` -### getSignatureConfirmation - -Returns the status and number of confirmations of a given signature. -#### Parameters: - -* `` - Signature of Transaction to confirm, as base-58 encoded string -* `` - (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment) - -#### Results: - -* `` - Unknown transaction -* `` - Transaction confirmations and status: - * `confirmations: ` - count of confirmations since transaction was processed - * `status: ` - - * `"Ok": ` - Transaction was successful - * `"Err": ` - Transaction failed with TransactionError [TransactionError definitions](https://github.com/solana-labs/solana/blob/master/sdk/src/transaction.rs#L14) - -#### Example: - -```bash -// Request -curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, "method":"getSignatureConfirmation", "params":["5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW"]}' http://localhost:8899 - -// Result -{"jsonrpc":"2.0","result":{"confirmations":12,"status":{"Ok": null}},"id":1} -``` - ### getSignatureStatus Returns the status of a given signature. This method is similar to [confirmTransaction](jsonrpc-api.md#confirmtransaction) but provides more resolution for error events. @@ -700,11 +648,16 @@ Returns the status of a given signature. This method is similar to [confirmTrans #### Results: +An RpcResponse containing a JSON object consisting of an array of TransactionStatus objects. + +* `RpcResponse` - RpcResponse JSON object with `value` field: + An array of: * `` - Unknown transaction * `` * `slot: ` - The slot the transaction was processed + * `confirmations: ` - Number of blocks since signature confirmation, null if rooted * `status: ` - Transaction status * `"Ok": ` - Transaction was successful * `"Err": ` - Transaction failed with TransactionError [TransactionError definitions](https://github.com/solana-labs/solana/blob/master/sdk/src/transaction.rs#L14) @@ -716,7 +669,10 @@ An array of: curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, "method":"getSignatureStatus", "params":[["5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW", "5j7s6NiJS3JAkvgkoc18WVAsiSaci2pxB2A6ueCJP4tprA2TFg9wSyTLeYouxPBJEMzJinENTkpA52YStRW5Dia7"]]]}' http://localhost:8899 // Result -{"jsonrpc":"2.0","result":[{"slot": 72, "status": {"Ok": null}}, null],"id":1} +{"jsonrpc":"2.0","result":{"context":{"slot":82},"value":[{"slot": 72, "confirmations": 10, "status": {"Ok": null}}, null]},"id":1} + +// Result, first transaction rooted +{"jsonrpc":"2.0","result":{"context":{"slot":82},"value":[{"slot": 48, "confirmations": null, "status": {"Ok": null}}, null]},"id":1} ``` ### getSlot diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index f9a2d7c4b0..25daab142a 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -28,7 +28,7 @@ reed-solomon-erasure = { package = "solana-reed-solomon-erasure", version = "4.0 regex = "1.3.4" serde = "1.0.104" serde_bytes = "0.11.3" -solana-client = { path = "../client", version = "1.0.11" } +solana-transaction-status = { path = "../transaction-status", version = "1.0.11" } solana-genesis-programs = { path = "../genesis-programs", version = "1.0.11" } solana-logger = { path = "../logger", version = "1.0.11" } solana-measure = { path = "../measure", version = "1.0.11" } diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index aad9f48c5e..a9997c2fe8 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -22,10 +22,6 @@ use rayon::{ ThreadPool, }; use rocksdb::DBRawIterator; -use solana_client::rpc_response::{ - RpcConfirmedBlock, RpcEncodedTransaction, RpcRewards, RpcTransactionEncoding, - RpcTransactionStatusMeta, RpcTransactionWithStatusMeta, -}; use solana_measure::measure::Measure; use solana_metrics::{datapoint_debug, datapoint_error}; use solana_rayon_threadlimit::get_thread_count; @@ -40,6 +36,10 @@ use solana_sdk::{ timing::timestamp, transaction::Transaction, }; +use solana_transaction_status::{ + ConfirmedBlock, EncodedTransaction, Rewards, TransactionEncoding, TransactionStatusMeta, + TransactionWithStatusMeta, +}; use solana_vote_program::{vote_instruction::VoteInstruction, vote_state::TIMESTAMP_SLOT_INTERVAL}; use std::{ cell::RefCell, @@ -1396,15 +1396,15 @@ impl Blockstore { pub fn get_confirmed_block( &self, slot: Slot, - encoding: Option, - ) -> Result { + encoding: Option, + ) -> Result { let lowest_cleanup_slot = self.lowest_cleanup_slot.read().unwrap(); // lowest_cleanup_slot is the last slot that was not cleaned up by // LedgerCleanupService if *lowest_cleanup_slot > slot { return Err(BlockstoreError::SlotCleanedUp); } - let encoding = encoding.unwrap_or(RpcTransactionEncoding::Json); + let encoding = encoding.unwrap_or(TransactionEncoding::Json); if self.is_root(slot) { let slot_meta_cf = self.db.column::(); let slot_meta = match slot_meta_cf.get(slot)? { @@ -1433,7 +1433,7 @@ impl Blockstore { let rewards = self.rewards_cf.get(slot)?.unwrap_or_else(|| vec![]); - let block = RpcConfirmedBlock { + let block = ConfirmedBlock { previous_blockhash: previous_blockhash.to_string(), blockhash: blockhash.to_string(), parent_slot: slot_meta.parent_slot, @@ -1453,15 +1453,14 @@ impl Blockstore { fn map_transactions_to_statuses<'a>( &self, slot: Slot, - encoding: RpcTransactionEncoding, + encoding: TransactionEncoding, iterator: impl Iterator + 'a, - ) -> Vec { + ) -> Vec { iterator .map(|transaction| { let signature = transaction.signatures[0]; - let encoded_transaction = - RpcEncodedTransaction::encode(transaction, encoding.clone()); - RpcTransactionWithStatusMeta { + let encoded_transaction = EncodedTransaction::encode(transaction, encoding.clone()); + TransactionWithStatusMeta { transaction: encoded_transaction, meta: self .transaction_status_cf @@ -1475,23 +1474,23 @@ impl Blockstore { pub fn read_transaction_status( &self, index: (Slot, Signature), - ) -> Result> { + ) -> Result> { self.transaction_status_cf.get(index) } pub fn write_transaction_status( &self, index: (Slot, Signature), - status: &RpcTransactionStatusMeta, + status: &TransactionStatusMeta, ) -> Result<()> { self.transaction_status_cf.put(index, status) } - pub fn read_rewards(&self, index: Slot) -> Result> { + pub fn read_rewards(&self, index: Slot) -> Result> { self.rewards_cf.get(index) } - pub fn write_rewards(&self, index: Slot, rewards: RpcRewards) -> Result<()> { + pub fn write_rewards(&self, index: Slot, rewards: Rewards) -> Result<()> { self.rewards_cf.put(index, &rewards) } @@ -4814,7 +4813,7 @@ pub mod tests { .put_meta_bytes(slot - 1, &serialize(&parent_meta).unwrap()) .unwrap(); - let expected_transactions: Vec<(Transaction, Option)> = entries + let expected_transactions: Vec<(Transaction, Option)> = entries .iter() .cloned() .filter(|entry| !entry.is_tick()) @@ -4831,7 +4830,7 @@ pub mod tests { .transaction_status_cf .put( (slot, signature), - &RpcTransactionStatusMeta { + &TransactionStatusMeta { status: Ok(()), fee: 42, pre_balances: pre_balances.clone(), @@ -4843,7 +4842,7 @@ pub mod tests { .transaction_status_cf .put( (slot + 1, signature), - &RpcTransactionStatusMeta { + &TransactionStatusMeta { status: Ok(()), fee: 42, pre_balances: pre_balances.clone(), @@ -4853,7 +4852,7 @@ pub mod tests { .unwrap(); ( transaction, - Some(RpcTransactionStatusMeta { + Some(TransactionStatusMeta { status: Ok(()), fee: 42, pre_balances, @@ -4870,12 +4869,12 @@ pub mod tests { let confirmed_block = ledger.get_confirmed_block(slot, None).unwrap(); assert_eq!(confirmed_block.transactions.len(), 100); - let expected_block = RpcConfirmedBlock { + let expected_block = ConfirmedBlock { transactions: expected_transactions .iter() .cloned() - .map(|(tx, meta)| RpcTransactionWithStatusMeta { - transaction: RpcEncodedTransaction::encode(tx, RpcTransactionEncoding::Json), + .map(|(tx, meta)| TransactionWithStatusMeta { + transaction: EncodedTransaction::encode(tx, TransactionEncoding::Json), meta, }) .collect(), @@ -4891,12 +4890,12 @@ pub mod tests { let confirmed_block = ledger.get_confirmed_block(slot + 1, None).unwrap(); assert_eq!(confirmed_block.transactions.len(), 100); - let expected_block = RpcConfirmedBlock { + let expected_block = ConfirmedBlock { transactions: expected_transactions .iter() .cloned() - .map(|(tx, meta)| RpcTransactionWithStatusMeta { - transaction: RpcEncodedTransaction::encode(tx, RpcTransactionEncoding::Json), + .map(|(tx, meta)| TransactionWithStatusMeta { + transaction: EncodedTransaction::encode(tx, TransactionEncoding::Json), meta, }) .collect(), @@ -5116,7 +5115,7 @@ pub mod tests { assert!(transaction_status_cf .put( (0, Signature::default()), - &RpcTransactionStatusMeta { + &TransactionStatusMeta { status: solana_sdk::transaction::Result::<()>::Err( TransactionError::AccountNotFound ), @@ -5128,7 +5127,7 @@ pub mod tests { .is_ok()); // result found - let RpcTransactionStatusMeta { + let TransactionStatusMeta { status, fee, pre_balances, @@ -5146,7 +5145,7 @@ pub mod tests { assert!(transaction_status_cf .put( (9, Signature::default()), - &RpcTransactionStatusMeta { + &TransactionStatusMeta { status: solana_sdk::transaction::Result::<()>::Ok(()), fee: 9u64, pre_balances: pre_balances_vec.clone(), @@ -5156,7 +5155,7 @@ pub mod tests { .is_ok()); // result found - let RpcTransactionStatusMeta { + let TransactionStatusMeta { status, fee, pre_balances, @@ -5211,7 +5210,7 @@ pub mod tests { transaction_status_cf .put( (slot, transaction.signatures[0]), - &RpcTransactionStatusMeta { + &TransactionStatusMeta { status: solana_sdk::transaction::Result::<()>::Err( TransactionError::AccountNotFound, ), @@ -5234,7 +5233,7 @@ pub mod tests { let map = blockstore.map_transactions_to_statuses( slot, - RpcTransactionEncoding::Json, + TransactionEncoding::Json, transactions.into_iter(), ); assert_eq!(map.len(), 5); diff --git a/ledger/src/blockstore_db.rs b/ledger/src/blockstore_db.rs index 9ac9266940..5f29f40012 100644 --- a/ledger/src/blockstore_db.rs +++ b/ledger/src/blockstore_db.rs @@ -10,8 +10,8 @@ use rocksdb::{ }; use serde::de::DeserializeOwned; use serde::Serialize; -use solana_client::rpc_response::{RpcRewards, RpcTransactionStatusMeta}; use solana_sdk::{clock::Slot, signature::Signature}; +use solana_transaction_status::{Rewards, TransactionStatusMeta}; use std::{collections::HashMap, fs, marker::PhantomData, path::Path, sync::Arc}; use thiserror::Error; @@ -269,7 +269,7 @@ pub trait TypedColumn: Column { } impl TypedColumn for columns::TransactionStatus { - type Type = RpcTransactionStatusMeta; + type Type = TransactionStatusMeta; } pub trait SlotColumn {} @@ -330,7 +330,7 @@ impl ColumnName for columns::Rewards { const NAME: &'static str = REWARDS_CF; } impl TypedColumn for columns::Rewards { - type Type = RpcRewards; + type Type = Rewards; } impl Column for columns::ShredCode { diff --git a/transaction-status/Cargo.toml b/transaction-status/Cargo.toml new file mode 100644 index 0000000000..fc16588264 --- /dev/null +++ b/transaction-status/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "solana-transaction-status" +version = "1.0.11" +description = "Solana transaction status types" +authors = ["Solana Maintainers "] +repository = "https://github.com/solana-labs/solana" +homepage = "https://solana.com/" +license = "Apache-2.0" +edition = "2018" + +[dependencies] +bincode = "1.2.1" +bs58 = "0.3.0" +solana-sdk = { path = "../sdk", version = "1.0.11" } +serde = "1.0.105" +serde_derive = "1.0.103" diff --git a/transaction-status/src/lib.rs b/transaction-status/src/lib.rs new file mode 100644 index 0000000000..3a410340d8 --- /dev/null +++ b/transaction-status/src/lib.rs @@ -0,0 +1,128 @@ +#[macro_use] +extern crate serde_derive; + +use bincode::serialize; +use solana_sdk::{ + clock::Slot, + message::MessageHeader, + transaction::{Result, Transaction}, +}; + +/// A duplicate representation of a Message for pretty JSON serialization +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RpcCompiledInstruction { + pub program_id_index: u8, + pub accounts: Vec, + pub data: String, +} + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TransactionStatusMeta { + pub status: Result<()>, + pub fee: u64, + pub pre_balances: Vec, + pub post_balances: Vec, +} + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TransactionStatus { + pub slot: Slot, + pub confirmations: Option, + pub status: Result<()>, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +pub struct Reward { + pub pubkey: String, + pub lamports: i64, +} + +pub type Rewards = Vec; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ConfirmedBlock { + pub previous_blockhash: String, + pub blockhash: String, + pub parent_slot: Slot, + pub transactions: Vec, + pub rewards: Rewards, +} + +/// A duplicate representation of a Transaction for pretty JSON serialization +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RpcTransaction { + pub signatures: Vec, + pub message: RpcMessage, +} + +/// A duplicate representation of a Message for pretty JSON serialization +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RpcMessage { + pub header: MessageHeader, + pub account_keys: Vec, + pub recent_blockhash: String, + pub instructions: Vec, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TransactionWithStatusMeta { + pub transaction: EncodedTransaction, + pub meta: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(rename_all = "camelCase")] +pub enum TransactionEncoding { + Binary, + Json, +} + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase", untagged)] +pub enum EncodedTransaction { + Binary(String), + Json(RpcTransaction), +} + +impl EncodedTransaction { + pub fn encode(transaction: Transaction, encoding: TransactionEncoding) -> Self { + if encoding == TransactionEncoding::Json { + EncodedTransaction::Json(RpcTransaction { + signatures: transaction + .signatures + .iter() + .map(|sig| sig.to_string()) + .collect(), + message: RpcMessage { + header: transaction.message.header, + account_keys: transaction + .message + .account_keys + .iter() + .map(|pubkey| pubkey.to_string()) + .collect(), + recent_blockhash: transaction.message.recent_blockhash.to_string(), + instructions: transaction + .message + .instructions + .iter() + .map(|instruction| RpcCompiledInstruction { + program_id_index: instruction.program_id_index, + accounts: instruction.accounts.clone(), + data: bs58::encode(instruction.data.clone()).into_string(), + }) + .collect(), + }, + }) + } else { + EncodedTransaction::Binary(bs58::encode(serialize(&transaction).unwrap()).into_string()) + } + } +}