From 241e6bfd2162f629eb197f9a684a3039e94ae610 Mon Sep 17 00:00:00 2001 From: Maximilian Schneider Date: Wed, 5 Apr 2023 19:06:58 +0200 Subject: [PATCH] move to mango_feeds_connector --- Cargo.lock | 1463 ++++++++++++++++++++++++++----- Cargo.toml | 1 + src/account_write_filter.rs | 146 --- src/chain_data.rs | 268 ------ src/crank.rs | 40 +- src/grpc_plugin_source.rs | 617 ------------- src/lib.rs | 6 +- src/main.rs | 3 +- src/mango_v3_perp_crank_sink.rs | 15 +- src/metrics.rs | 337 ------- src/websocket_source.rs | 218 ----- 11 files changed, 1301 insertions(+), 1813 deletions(-) delete mode 100644 src/account_write_filter.rs delete mode 100644 src/chain_data.rs delete mode 100644 src/grpc_plugin_source.rs delete mode 100644 src/metrics.rs delete mode 100644 src/websocket_source.rs diff --git a/Cargo.lock b/Cargo.lock index 69db1f0..6cb1329 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3286,6 +3286,30 @@ dependencies = [ "solana-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mango-feeds-connector" +version = "0.1.0" +source = "git+https://github.com/blockworks-foundation/mango-feeds.git?branch=ckamm/solana-versions2#002fbcc353f31d07861b9580fa83d126681fbd42" +dependencies = [ + "anyhow", + "async-channel", + "async-trait", + "futures 0.3.27", + "jsonrpc-core 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core-client", + "log 0.4.17", + "rustls 0.20.8", + "serde", + "serde_derive", + "solana-account-decoder 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio", + "warp", + "yellowstone-grpc-proto", +] + [[package]] name = "mango-logs" version = "0.1.0" @@ -3332,6 +3356,7 @@ dependencies = [ "log 0.4.17", "mango", "mango-common", + "mango-feeds-connector", "multiqueue", "prost 0.11.8", "rand 0.8.5", @@ -3340,21 +3365,21 @@ dependencies = [ "serde_derive", "serde_json", "serde_yaml 0.8.26", - "solana-account-decoder", - "solana-clap-utils", - "solana-cli-config", - "solana-client", + "solana-account-decoder 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-clap-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-cli-config 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-core", "solana-logger 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-metrics", - "solana-net-utils", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-net-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", - "solana-quic-client", - "solana-rpc", - "solana-runtime", + "solana-quic-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-transaction-status", - "solana-version", + "solana-transaction-status 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-version 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", "tokio", "toml 0.7.3", @@ -5630,6 +5655,30 @@ dependencies = [ "sha-1 0.9.8", ] +[[package]] +name = "solana-account-decoder" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e4ac2e5e6474d17f19341df43c62b62ee1e362bae9b06bc30223252dd4a362" +dependencies = [ + "Inflector", + "base64 0.13.1", + "bincode", + "bs58 0.4.0", + "bv", + "lazy_static", + "serde", + "serde_derive", + "serde_json", + "solana-address-lookup-table-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-config-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token", + "spl-token-2022", + "thiserror", + "zstd", +] + [[package]] name = "solana-account-decoder" version = "1.15.2" @@ -5644,8 +5693,8 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-address-lookup-table-program", - "solana-config-program", + "solana-address-lookup-table-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-config-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "spl-token", "spl-token-2022", @@ -5653,6 +5702,27 @@ dependencies = [ "zstd", ] +[[package]] +name = "solana-address-lookup-table-program" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baac6a0dfc38f64e5e5e178e9eeade05ef1a2c644c95062523c6bc21f19f8866" +dependencies = [ + "bincode", + "bytemuck", + "log 0.4.17", + "num-derive", + "num-traits", + "rustc_version 0.4.0", + "serde", + "solana-frozen-abi 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi-macro 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-program-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", +] + [[package]] name = "solana-address-lookup-table-program" version = "1.15.2" @@ -5668,11 +5738,30 @@ dependencies = [ "solana-frozen-abi 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-frozen-abi-macro 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-program-runtime", + "solana-program-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", ] +[[package]] +name = "solana-bloom" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7e5d0033ba3e3f598f88964f0a0a87d3a143f9995fc4b326d21d689e4fa74ad" +dependencies = [ + "bv", + "fnv", + "log 0.4.17", + "rand 0.7.3", + "rayon", + "rustc_version 0.4.0", + "serde", + "serde_derive", + "solana-frozen-abi 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi-macro 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-bloom" version = "1.15.2" @@ -5691,6 +5780,25 @@ dependencies = [ "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", ] +[[package]] +name = "solana-bpf-loader-program" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d6438ef9cec10d4c563e916a612bb06f50be13524bbd250de461633bde87e7a" +dependencies = [ + "bincode", + "byteorder", + "libsecp256k1", + "log 0.4.17", + "rand 0.7.3", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-program-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-zk-token-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana_rbpf", + "thiserror", +] + [[package]] name = "solana-bpf-loader-program" version = "1.15.2" @@ -5701,14 +5809,29 @@ dependencies = [ "libsecp256k1", "log 0.4.17", "rand 0.7.3", - "solana-measure", - "solana-program-runtime", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-program-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-zk-token-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana_rbpf", "thiserror", ] +[[package]] +name = "solana-bucket-map" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd2f6926a9f443f8c62f883f7348fc04ee1aa48246748c8193c161752e822b92" +dependencies = [ + "log 0.4.17", + "memmap2", + "modular-bitfield", + "rand 0.7.3", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile", +] + [[package]] name = "solana-bucket-map" version = "1.15.2" @@ -5718,11 +5841,29 @@ dependencies = [ "memmap2", "modular-bitfield", "rand 0.7.3", - "solana-measure", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "tempfile", ] +[[package]] +name = "solana-clap-utils" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f0a43f9bcf2405e50190cf3943046663caae557db9eb71a628f359e3f4f3eea" +dependencies = [ + "chrono", + "clap 2.34.0", + "rpassword", + "solana-perf 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-remote-wallet 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "tiny-bip39", + "uriparse", + "url 2.3.1", +] + [[package]] name = "solana-clap-utils" version = "1.15.2" @@ -5731,8 +5872,8 @@ dependencies = [ "chrono", "clap 2.34.0", "rpassword", - "solana-perf", - "solana-remote-wallet", + "solana-perf 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-remote-wallet 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", "tiny-bip39", @@ -5740,6 +5881,22 @@ dependencies = [ "url 2.3.1", ] +[[package]] +name = "solana-cli-config" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c79aa0d4d3cef702ca522c1b8dca170eb7137254b6d608f46bcb3a26d6fffd3" +dependencies = [ + "dirs-next", + "lazy_static", + "serde", + "serde_derive", + "serde_yaml 0.9.19", + "solana-clap-utils 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.3.1", +] + [[package]] name = "solana-cli-config" version = "1.15.2" @@ -5750,11 +5907,46 @@ dependencies = [ "serde", "serde_derive", "serde_yaml 0.9.19", - "solana-clap-utils", + "solana-clap-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "url 2.3.1", ] +[[package]] +name = "solana-client" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fe890559c3d8e29123ed0bfba47d5d714acb1db2e4a9a981c9171960ae01425" +dependencies = [ + "async-trait", + "bincode", + "enum_dispatch", + "futures 0.3.27", + "futures-util", + "indexmap", + "indicatif", + "log 0.4.17", + "quinn", + "rand 0.7.3", + "rayon", + "solana-connection-cache 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-net-utils 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-pubsub-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-quic-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc-client-api 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc-client-nonce-utils 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-streamer 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-thin-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-tpu-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-udp-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "tokio", +] + [[package]] name = "solana-client" version = "1.15.2" @@ -5771,33 +5963,57 @@ dependencies = [ "quinn", "rand 0.7.3", "rayon", - "solana-connection-cache", - "solana-measure", - "solana-metrics", - "solana-net-utils", - "solana-pubsub-client", - "solana-quic-client", - "solana-rpc-client", - "solana-rpc-client-api", - "solana-rpc-client-nonce-utils", + "solana-connection-cache 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-net-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-pubsub-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-quic-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client-api 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client-nonce-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-streamer", - "solana-thin-client", - "solana-tpu-client", - "solana-udp-client", + "solana-streamer 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-thin-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-tpu-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-udp-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", "tokio", ] +[[package]] +name = "solana-compute-budget-program" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "372ab0d248283e6c1b51317bd9a40bc0a6ef076ad29c237e7336cef1934a34f7" +dependencies = [ + "solana-program-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-compute-budget-program" version = "1.15.2" source = "git+https://github.com/solana-labs/solana.git?tag=v1.15.2#dea65f48e9920a71edd7c12c305c5ebadd192afa" dependencies = [ - "solana-program-runtime", + "solana-program-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", ] +[[package]] +name = "solana-config-program" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebb520c573b28060cadd8ae0fa6ae116cf74dac01078bc437d8b3e3ab00efd22" +dependencies = [ + "bincode", + "chrono", + "serde", + "serde_derive", + "solana-program-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-config-program" version = "1.15.2" @@ -5807,10 +6023,31 @@ dependencies = [ "chrono", "serde", "serde_derive", - "solana-program-runtime", + "solana-program-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", ] +[[package]] +name = "solana-connection-cache" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c913dfcaf847cecd8866e4aeaa440b34c8a5dae6c1c90b7a8cb3265ff9fc775" +dependencies = [ + "async-trait", + "bincode", + "futures-util", + "indexmap", + "log 0.4.17", + "rand 0.7.3", + "rayon", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-net-utils 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "tokio", +] + [[package]] name = "solana-connection-cache" version = "1.15.2" @@ -5823,9 +6060,9 @@ dependencies = [ "log 0.4.17", "rand 0.7.3", "rayon", - "solana-measure", - "solana-metrics", - "solana-net-utils", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-net-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", "tokio", @@ -5860,32 +6097,32 @@ dependencies = [ "rustc_version 0.4.0", "serde", "serde_derive", - "solana-address-lookup-table-program", - "solana-bloom", - "solana-client", - "solana-entry", + "solana-address-lookup-table-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-bloom 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-entry 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-frozen-abi 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-frozen-abi-macro 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-geyser-plugin-manager", - "solana-gossip", - "solana-ledger", - "solana-measure", - "solana-metrics", - "solana-net-utils", - "solana-perf", - "solana-poh", - "solana-program-runtime", - "solana-rayon-threadlimit", - "solana-rpc", - "solana-rpc-client-api", - "solana-runtime", + "solana-gossip 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-ledger 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-net-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-perf 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-poh 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-program-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rayon-threadlimit 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client-api 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-send-transaction-service", - "solana-streamer", - "solana-tpu-client", - "solana-transaction-status", - "solana-version", - "solana-vote-program", + "solana-send-transaction-service 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-streamer 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-tpu-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-transaction-status 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-version 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-vote-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "sys-info", "sysctl", "tempfile", @@ -5894,6 +6131,29 @@ dependencies = [ "trees", ] +[[package]] +name = "solana-entry" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d36e528b958d01d41fc482cf794aed4360a90200192b702428eaa82d4925f05" +dependencies = [ + "bincode", + "crossbeam-channel", + "dlopen", + "dlopen_derive", + "lazy_static", + "log 0.4.17", + "rand 0.7.3", + "rayon", + "serde", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-merkle-tree 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-perf 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rayon-threadlimit 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-entry" version = "1.15.2" @@ -5908,14 +6168,38 @@ dependencies = [ "rand 0.7.3", "rayon", "serde", - "solana-measure", - "solana-merkle-tree", - "solana-metrics", - "solana-perf", - "solana-rayon-threadlimit", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-merkle-tree 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-perf 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rayon-threadlimit 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", ] +[[package]] +name = "solana-faucet" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d90180632e0528cd46e0ebfaf98977b24fc4593422be9b200e0dfaf97ee09cc7" +dependencies = [ + "bincode", + "byteorder", + "clap 2.34.0", + "crossbeam-channel", + "log 0.4.17", + "serde", + "serde_derive", + "solana-clap-utils 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-cli-config 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-logger 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-version 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-memo", + "thiserror", + "tokio", +] + [[package]] name = "solana-faucet" version = "1.15.2" @@ -5928,12 +6212,12 @@ dependencies = [ "log 0.4.17", "serde", "serde_derive", - "solana-clap-utils", - "solana-cli-config", + "solana-clap-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-cli-config 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-logger 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-metrics", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-version", + "solana-version 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "spl-memo", "thiserror", "tokio", @@ -6036,7 +6320,7 @@ source = "git+https://github.com/solana-labs/solana.git?tag=v1.15.2#dea65f48e992 dependencies = [ "log 0.4.17", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-transaction-status", + "solana-transaction-status 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", ] @@ -6052,12 +6336,60 @@ dependencies = [ "log 0.4.17", "serde_json", "solana-geyser-plugin-interface", - "solana-measure", - "solana-metrics", - "solana-rpc", - "solana-runtime", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-transaction-status", + "solana-transaction-status 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "thiserror", +] + +[[package]] +name = "solana-gossip" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c99fdfc75fbe40aae6d60543786eb9c24fa1a633fb1566f75ca8a0471545115" +dependencies = [ + "bincode", + "bv", + "clap 2.34.0", + "crossbeam-channel", + "flate2 1.0.25", + "indexmap", + "itertools 0.10.5", + "log 0.4.17", + "lru", + "matches", + "num-traits", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rayon", + "rustc_version 0.4.0", + "serde", + "serde_bytes", + "serde_derive", + "solana-bloom 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-clap-utils 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-entry 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi-macro 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-ledger 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-logger 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-net-utils 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-perf 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rayon-threadlimit 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-streamer 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-thin-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-tpu-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-version 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-vote-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions", "thiserror", ] @@ -6084,30 +6416,90 @@ dependencies = [ "serde", "serde_bytes", "serde_derive", - "solana-bloom", - "solana-clap-utils", - "solana-client", - "solana-entry", + "solana-bloom 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-clap-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-entry 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-frozen-abi 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-frozen-abi-macro 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-ledger", + "solana-ledger 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-logger 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-measure", - "solana-metrics", - "solana-net-utils", - "solana-perf", - "solana-rayon-threadlimit", - "solana-runtime", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-net-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-perf 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rayon-threadlimit 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-streamer", - "solana-thin-client", - "solana-tpu-client", - "solana-version", - "solana-vote-program", + "solana-streamer 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-thin-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-tpu-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-version 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-vote-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "static_assertions", "thiserror", ] +[[package]] +name = "solana-ledger" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b84b4dcfe6aaabc5676ac35bba142d598e350b2f70315c94a46179d40e4d41bc" +dependencies = [ + "assert_matches", + "bincode", + "bitflags", + "byteorder", + "chrono", + "chrono-humanize", + "crossbeam-channel", + "dashmap 4.0.2", + "fs_extra", + "futures 0.3.27", + "itertools 0.10.5", + "lazy_static", + "libc", + "log 0.4.17", + "lru", + "num_cpus", + "num_enum", + "prost 0.11.8", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rayon", + "reed-solomon-erasure", + "rocksdb", + "rustc_version 0.4.0", + "serde", + "serde_bytes", + "sha2 0.10.6", + "solana-account-decoder 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-bpf-loader-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-entry 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi-macro 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-perf 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-program-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rayon-threadlimit 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-stake-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-storage-bigtable 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-storage-proto 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-transaction-status 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-vote-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token", + "spl-token-2022", + "static_assertions", + "tempfile", + "thiserror", + "tokio", + "tokio-stream", + "trees", +] + [[package]] name = "solana-ledger" version = "1.15.2" @@ -6140,23 +6532,23 @@ dependencies = [ "serde", "serde_bytes", "sha2 0.10.6", - "solana-account-decoder", - "solana-bpf-loader-program", - "solana-entry", + "solana-account-decoder 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-bpf-loader-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-entry 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-frozen-abi 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-frozen-abi-macro 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-measure", - "solana-metrics", - "solana-perf", - "solana-program-runtime", - "solana-rayon-threadlimit", - "solana-runtime", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-perf 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-program-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rayon-threadlimit 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-stake-program", - "solana-storage-bigtable", - "solana-storage-proto", - "solana-transaction-status", - "solana-vote-program", + "solana-stake-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-storage-bigtable 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-storage-proto 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-transaction-status 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-vote-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "spl-token", "spl-token-2022", "static_assertions", @@ -6188,6 +6580,16 @@ dependencies = [ "log 0.4.17", ] +[[package]] +name = "solana-measure" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52b03528be5a0fbbe4c06a4e1758d155363b51f7c782435b1eb1d4804ab124e3" +dependencies = [ + "log 0.4.17", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-measure" version = "1.15.2" @@ -6197,6 +6599,17 @@ dependencies = [ "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", ] +[[package]] +name = "solana-merkle-tree" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7466b876e55c17ddb3359dd9ccf3bcd9fbe4e8858b26c4affe9a760fbce0ab34" +dependencies = [ + "fast-math", + "matches", + "solana-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-merkle-tree" version = "1.15.2" @@ -6207,6 +6620,20 @@ dependencies = [ "solana-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", ] +[[package]] +name = "solana-metrics" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc5ff9cbbe50e9918576ff46b4e38d9a946c33fc442982ce7ff397a3b851922a" +dependencies = [ + "crossbeam-channel", + "gethostname", + "lazy_static", + "log 0.4.17", + "reqwest", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-metrics" version = "1.15.2" @@ -6220,6 +6647,28 @@ dependencies = [ "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", ] +[[package]] +name = "solana-net-utils" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26f35dff5b963ec471514e89bd99c7ac43545756221c99b63c2229cf5f37ebb2" +dependencies = [ + "bincode", + "clap 3.2.23", + "crossbeam-channel", + "log 0.4.17", + "nix", + "rand 0.7.3", + "serde", + "serde_derive", + "socket2", + "solana-logger 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-version 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio", + "url 2.3.1", +] + [[package]] name = "solana-net-utils" version = "1.15.2" @@ -6236,11 +6685,38 @@ dependencies = [ "socket2", "solana-logger 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-version", + "solana-version 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "tokio", "url 2.3.1", ] +[[package]] +name = "solana-perf" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d630964a18fb466d79c3f5e191f37083b52b584a3f596e17f4bd41a145254d" +dependencies = [ + "ahash 0.7.6", + "bincode", + "bv", + "caps", + "curve25519-dalek", + "dlopen", + "dlopen_derive", + "fnv", + "lazy_static", + "libc", + "log 0.4.17", + "nix", + "rand 0.7.3", + "rayon", + "serde", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rayon-threadlimit 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-vote-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-perf" version = "1.15.2" @@ -6261,10 +6737,29 @@ dependencies = [ "rand 0.7.3", "rayon", "serde", - "solana-metrics", - "solana-rayon-threadlimit", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rayon-threadlimit 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-vote-program", + "solana-vote-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", +] + +[[package]] +name = "solana-poh" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45548be47dab7dfbf6e549d16f2b23369db66f110474af1d97333b7de0012866" +dependencies = [ + "core_affinity", + "crossbeam-channel", + "log 0.4.17", + "solana-entry 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-ledger 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sys-tuner 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", ] [[package]] @@ -6275,13 +6770,13 @@ dependencies = [ "core_affinity", "crossbeam-channel", "log 0.4.17", - "solana-entry", - "solana-ledger", - "solana-measure", - "solana-metrics", - "solana-runtime", + "solana-entry 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-ledger 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-sys-tuner", + "solana-sys-tuner 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", ] @@ -6392,6 +6887,34 @@ dependencies = [ "zeroize", ] +[[package]] +name = "solana-program-runtime" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb3250dc9a0abc87693437ae0bb3eb02603396dcf7698c06f77c33b2c0291ca" +dependencies = [ + "base64 0.13.1", + "bincode", + "eager", + "enum-iterator", + "itertools 0.10.5", + "libc", + "libloading", + "log 0.4.17", + "num-derive", + "num-traits", + "rand 0.7.3", + "rustc_version 0.4.0", + "serde", + "solana-frozen-abi 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi-macro 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana_rbpf", + "thiserror", +] + [[package]] name = "solana-program-runtime" version = "1.15.2" @@ -6412,13 +6935,38 @@ dependencies = [ "serde", "solana-frozen-abi 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-frozen-abi-macro 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-measure", - "solana-metrics", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana_rbpf", "thiserror", ] +[[package]] +name = "solana-pubsub-client" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e441892b9a00fdceebb0e7eee3226f2f5985a15d081aab1924a298f24cdadb2" +dependencies = [ + "crossbeam-channel", + "futures-util", + "log 0.4.17", + "reqwest", + "semver 1.0.17", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc-client-api 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tungstenite", + "url 2.3.1", +] + [[package]] name = "solana-pubsub-client" version = "1.15.2" @@ -6432,8 +6980,8 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder", - "solana-rpc-client-api", + "solana-account-decoder 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client-api 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", "tokio", @@ -6443,6 +6991,34 @@ dependencies = [ "url 2.3.1", ] +[[package]] +name = "solana-quic-client" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d19f3bd22bd8cef3bd7007e878f8ee1e9534a2b2ad99abc1ac05ed3d9f9bed" +dependencies = [ + "async-mutex", + "async-trait", + "futures 0.3.27", + "itertools 0.10.5", + "lazy_static", + "log 0.4.17", + "quinn", + "quinn-proto", + "quinn-udp", + "rustls 0.20.8", + "solana-connection-cache 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-net-utils 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc-client-api 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-streamer 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-tpu-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "tokio", +] + [[package]] name = "solana-quic-client" version = "1.15.2" @@ -6458,18 +7034,28 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustls 0.20.8", - "solana-connection-cache", - "solana-measure", - "solana-metrics", - "solana-net-utils", - "solana-rpc-client-api", + "solana-connection-cache 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-net-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client-api 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-streamer", - "solana-tpu-client", + "solana-streamer 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-tpu-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", "tokio", ] +[[package]] +name = "solana-rayon-threadlimit" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30893a53deeb0a3e32451f4f7cb063484e1504a06b127c4b40c223ea90093d7b" +dependencies = [ + "lazy_static", + "num_cpus", +] + [[package]] name = "solana-rayon-threadlimit" version = "1.15.2" @@ -6479,6 +7065,25 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "solana-remote-wallet" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "970f142fbf6bda164847f60977ad56adde32cafb7c798d2e005110410754aa85" +dependencies = [ + "console", + "dialoguer", + "log 0.4.17", + "num-derive", + "num-traits", + "parking_lot 0.12.1", + "qstring", + "semver 1.0.17", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "uriparse", +] + [[package]] name = "solana-remote-wallet" version = "1.15.2" @@ -6497,6 +7102,61 @@ dependencies = [ "uriparse", ] +[[package]] +name = "solana-rpc" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbaccbc49d51f02e1ab0c05c84a64d77d301ccc81ef4f89b290996993b58b0c3" +dependencies = [ + "base64 0.13.1", + "bincode", + "bs58 0.4.0", + "crossbeam-channel", + "dashmap 4.0.2", + "itertools 0.10.5", + "jsonrpc-core 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core-client", + "jsonrpc-derive", + "jsonrpc-http-server", + "jsonrpc-pubsub 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "log 0.4.17", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "soketto", + "solana-account-decoder 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-entry 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-faucet 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-gossip 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-ledger 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-perf 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-poh 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rayon-threadlimit 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc-client-api 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-send-transaction-service 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-stake-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-storage-bigtable 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-streamer 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-tpu-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-transaction-status 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-version 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-vote-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token", + "spl-token-2022", + "stream-cancel", + "thiserror", + "tokio", + "tokio-util 0.6.10", +] + [[package]] name = "solana-rpc" version = "1.15.2" @@ -6521,28 +7181,28 @@ dependencies = [ "serde_derive", "serde_json", "soketto", - "solana-account-decoder", - "solana-client", - "solana-entry", - "solana-faucet", - "solana-gossip", - "solana-ledger", - "solana-measure", - "solana-metrics", - "solana-perf", - "solana-poh", - "solana-rayon-threadlimit", - "solana-rpc-client-api", - "solana-runtime", + "solana-account-decoder 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-entry 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-faucet 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-gossip 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-ledger 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-perf 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-poh 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rayon-threadlimit 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client-api 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-send-transaction-service", - "solana-stake-program", - "solana-storage-bigtable", - "solana-streamer", - "solana-tpu-client", - "solana-transaction-status", - "solana-version", - "solana-vote-program", + "solana-send-transaction-service 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-stake-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-storage-bigtable 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-streamer 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-tpu-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-transaction-status 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-version 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-vote-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "spl-token", "spl-token-2022", "stream-cancel", @@ -6551,6 +7211,32 @@ dependencies = [ "tokio-util 0.6.10", ] +[[package]] +name = "solana-rpc-client" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "075485c8ce9300df10b67f01bb9e9ecb79c4c96c58e4b8aacac20e63c6144149" +dependencies = [ + "async-trait", + "base64 0.13.1", + "bincode", + "bs58 0.4.0", + "indicatif", + "log 0.4.17", + "reqwest", + "semver 1.0.17", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc-client-api 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-transaction-status 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-version 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-vote-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio", +] + [[package]] name = "solana-rpc-client" version = "1.15.2" @@ -6567,15 +7253,37 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder", - "solana-rpc-client-api", + "solana-account-decoder 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client-api 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-transaction-status", - "solana-version", - "solana-vote-program", + "solana-transaction-status 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-version 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-vote-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "tokio", ] +[[package]] +name = "solana-rpc-client-api" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0623112b87c9e65ef00538e27203b6129518d40376a4aa2ddc4fae5bf78a8a2c" +dependencies = [ + "base64 0.13.1", + "bs58 0.4.0", + "jsonrpc-core 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest", + "semver 1.0.17", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-transaction-status 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-version 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-2022", + "thiserror", +] + [[package]] name = "solana-rpc-client-api" version = "1.15.2" @@ -6589,26 +7297,102 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder", + "solana-account-decoder 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-transaction-status", - "solana-version", + "solana-transaction-status 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-version 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "spl-token-2022", "thiserror", ] +[[package]] +name = "solana-rpc-client-nonce-utils" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a70673c11ff5d831c4e569b41aeb86c0e9c68dba79515b7c6f42b8f842be76fe" +dependencies = [ + "clap 2.34.0", + "solana-clap-utils 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", +] + [[package]] name = "solana-rpc-client-nonce-utils" version = "1.15.2" source = "git+https://github.com/solana-labs/solana.git?tag=v1.15.2#dea65f48e9920a71edd7c12c305c5ebadd192afa" dependencies = [ "clap 2.34.0", - "solana-clap-utils", - "solana-rpc-client", + "solana-clap-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", ] +[[package]] +name = "solana-runtime" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f2a24d899d5c2a339ed0887b0ef321d9ffb22849923dbedcdc23dba32682ec4" +dependencies = [ + "arrayref", + "bincode", + "blake3", + "bv", + "bytemuck", + "byteorder", + "bzip2", + "crossbeam-channel", + "dashmap 4.0.2", + "dir-diff", + "flate2 1.0.25", + "fnv", + "im", + "index_list", + "itertools 0.10.5", + "lazy_static", + "log 0.4.17", + "lru", + "lz4", + "memmap2", + "num-derive", + "num-traits", + "num_cpus", + "once_cell", + "ouroboros", + "rand 0.7.3", + "rayon", + "regex", + "rustc_version 0.4.0", + "serde", + "serde_derive", + "solana-address-lookup-table-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-bpf-loader-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-bucket-map 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-compute-budget-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-config-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi-macro 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-perf 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-program-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rayon-threadlimit 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-stake-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-vote-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-zk-token-proof-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-zk-token-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "strum", + "strum_macros", + "symlink", + "tar", + "tempfile", + "thiserror", + "zstd", +] + [[package]] name = "solana-runtime" version = "1.15.2" @@ -6645,22 +7429,22 @@ dependencies = [ "rustc_version 0.4.0", "serde", "serde_derive", - "solana-address-lookup-table-program", - "solana-bpf-loader-program", - "solana-bucket-map", - "solana-compute-budget-program", - "solana-config-program", + "solana-address-lookup-table-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-bpf-loader-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-bucket-map 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-compute-budget-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-config-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-frozen-abi 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-frozen-abi-macro 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-measure", - "solana-metrics", - "solana-perf", - "solana-program-runtime", - "solana-rayon-threadlimit", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-perf 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-program-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rayon-threadlimit 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-stake-program", - "solana-vote-program", - "solana-zk-token-proof-program", + "solana-stake-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-vote-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-zk-token-proof-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-zk-token-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "strum", "strum_macros", @@ -6801,6 +7585,22 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "solana-send-transaction-service" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a9997fdab12ca016e2d44ba83ac4d1624a7883a9b123e085a2cd3ea13ce9d68" +dependencies = [ + "crossbeam-channel", + "log 0.4.17", + "solana-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-tpu-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-send-transaction-service" version = "1.15.2" @@ -6808,12 +7608,27 @@ source = "git+https://github.com/solana-labs/solana.git?tag=v1.15.2#dea65f48e992 dependencies = [ "crossbeam-channel", "log 0.4.17", - "solana-client", - "solana-measure", - "solana-metrics", - "solana-runtime", + "solana-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-tpu-client", + "solana-tpu-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", +] + +[[package]] +name = "solana-stake-program" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eace3b30e9b6a58864c6ffe76726880a60e1feddefdfe0cbaffbddedf7a90d30" +dependencies = [ + "bincode", + "log 0.4.17", + "rustc_version 0.4.0", + "solana-config-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-program-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-vote-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -6824,10 +7639,44 @@ dependencies = [ "bincode", "log 0.4.17", "rustc_version 0.4.0", - "solana-config-program", - "solana-program-runtime", + "solana-config-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-program-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-vote-program", + "solana-vote-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", +] + +[[package]] +name = "solana-storage-bigtable" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37be265389aa18237e2589ad9051144cd923c3cd2ea16f39ef34057aea61cb1a" +dependencies = [ + "backoff", + "bincode", + "bytes 1.4.0", + "bzip2", + "enum-iterator", + "flate2 1.0.25", + "futures 0.3.27", + "goauth", + "http", + "hyper 0.14.25", + "hyper-proxy", + "log 0.4.17", + "openssl", + "prost 0.11.8", + "prost-types 0.11.8", + "serde", + "serde_derive", + "smpl_jwt", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-storage-proto 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-transaction-status 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "tokio", + "tonic 0.8.3", + "zstd", ] [[package]] @@ -6853,16 +7702,33 @@ dependencies = [ "serde", "serde_derive", "smpl_jwt", - "solana-metrics", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-storage-proto", - "solana-transaction-status", + "solana-storage-proto 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-transaction-status 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", "tokio", "tonic 0.8.3", "zstd", ] +[[package]] +name = "solana-storage-proto" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "764664a1fce92fbcc6ba0b593f0c11e1d5ca961fcaa16d0f10e9fe85a4d88c4f" +dependencies = [ + "bincode", + "bs58 0.4.0", + "prost 0.11.8", + "protobuf-src", + "serde", + "solana-account-decoder 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-transaction-status 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tonic-build 0.8.4", +] + [[package]] name = "solana-storage-proto" version = "1.15.2" @@ -6873,12 +7739,43 @@ dependencies = [ "prost 0.11.8", "protobuf-src", "serde", - "solana-account-decoder", + "solana-account-decoder 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-transaction-status", + "solana-transaction-status 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "tonic-build 0.8.4", ] +[[package]] +name = "solana-streamer" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd5b3dad02879b083b7218b9f9596d97cee8deda2b625bff67db95d8920f5f7" +dependencies = [ + "crossbeam-channel", + "futures-util", + "histogram", + "indexmap", + "itertools 0.10.5", + "libc", + "log 0.4.17", + "nix", + "pem", + "percentage", + "pkcs8", + "quinn", + "quinn-proto", + "quinn-udp", + "rand 0.7.3", + "rcgen", + "rustls 0.20.8", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-perf 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "tokio", + "x509-parser", +] + [[package]] name = "solana-streamer" version = "1.15.2" @@ -6901,14 +7798,31 @@ dependencies = [ "rand 0.7.3", "rcgen", "rustls 0.20.8", - "solana-metrics", - "solana-perf", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-perf 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", "tokio", "x509-parser", ] +[[package]] +name = "solana-sys-tuner" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dfa7798c748c73a9e68c28ade656698ab6fff82fe5e3ad867b3e1c6c49bf9ec" +dependencies = [ + "clap 2.34.0", + "libc", + "log 0.4.17", + "nix", + "solana-logger 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-version 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "sysctl", + "unix_socket2", + "users", +] + [[package]] name = "solana-sys-tuner" version = "1.15.2" @@ -6919,12 +7833,28 @@ dependencies = [ "log 0.4.17", "nix", "solana-logger 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-version", + "solana-version 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "sysctl", "unix_socket2", "users", ] +[[package]] +name = "solana-thin-client" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16bdd6347caf841a007952c748cd35c3ec8395aa3816ac59b4a9b4c102237de" +dependencies = [ + "bincode", + "log 0.4.17", + "rayon", + "solana-connection-cache 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc-client-api 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-tpu-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-thin-client" version = "1.15.2" @@ -6933,11 +7863,37 @@ dependencies = [ "bincode", "log 0.4.17", "rayon", - "solana-connection-cache", - "solana-rpc-client", - "solana-rpc-client-api", + "solana-connection-cache 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client-api 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-tpu-client", + "solana-tpu-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", +] + +[[package]] +name = "solana-tpu-client" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50a7dfa7a85ba000656d91c8847b61f8fa9b8067443449fab8e4c35fe01dee5c" +dependencies = [ + "async-trait", + "bincode", + "futures-util", + "indexmap", + "indicatif", + "log 0.4.17", + "rand 0.7.3", + "rayon", + "solana-connection-cache 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-measure 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-net-utils 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-pubsub-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-rpc-client-api 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "tokio", ] [[package]] @@ -6953,18 +7909,44 @@ dependencies = [ "log 0.4.17", "rand 0.7.3", "rayon", - "solana-connection-cache", - "solana-measure", - "solana-metrics", - "solana-net-utils", - "solana-pubsub-client", - "solana-rpc-client", - "solana-rpc-client-api", + "solana-connection-cache 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-measure 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-net-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-pubsub-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-rpc-client-api 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", "tokio", ] +[[package]] +name = "solana-transaction-status" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b803e356fc2de0074866a6da007e721c950e754747e761a263b7f9e4c17edefa" +dependencies = [ + "Inflector", + "base64 0.13.1", + "bincode", + "borsh 0.9.3", + "bs58 0.4.0", + "lazy_static", + "log 0.4.17", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-address-lookup-table-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-associated-token-account", + "spl-memo", + "spl-token", + "spl-token-2022", + "thiserror", +] + [[package]] name = "solana-transaction-status" version = "1.15.2" @@ -6980,8 +7962,8 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account-decoder", - "solana-address-lookup-table-program", + "solana-account-decoder 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-address-lookup-table-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "spl-associated-token-account", "spl-memo", @@ -6990,21 +7972,53 @@ dependencies = [ "thiserror", ] +[[package]] +name = "solana-udp-client" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1b0d7efeb2cb7dafbf3b085c895e440b8947fe5def6bdad17ebae9badfdecb0" +dependencies = [ + "async-trait", + "solana-connection-cache 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-net-utils 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-streamer 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-tpu-client 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "tokio", +] + [[package]] name = "solana-udp-client" version = "1.15.2" source = "git+https://github.com/solana-labs/solana.git?tag=v1.15.2#dea65f48e9920a71edd7c12c305c5ebadd192afa" dependencies = [ "async-trait", - "solana-connection-cache", - "solana-net-utils", + "solana-connection-cache 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-net-utils 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-streamer", - "solana-tpu-client", + "solana-streamer 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", + "solana-tpu-client 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", "tokio", ] +[[package]] +name = "solana-version" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3df7b4a4dc0a39da78d790845089a8d112fcd6d2d003ae93830387a564cfc5" +dependencies = [ + "log 0.4.17", + "rustc_version 0.4.0", + "semver 1.0.17", + "serde", + "serde_derive", + "solana-frozen-abi 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi-macro 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-version" version = "1.15.2" @@ -7020,6 +8034,28 @@ dependencies = [ "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", ] +[[package]] +name = "solana-vote-program" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2439b8c68f000f8c3713eceabb5cabc8528d276e5bc971c694d4103d4be958ff" +dependencies = [ + "bincode", + "log 0.4.17", + "num-derive", + "num-traits", + "rustc_version 0.4.0", + "serde", + "serde_derive", + "solana-frozen-abi 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-frozen-abi-macro 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-metrics 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-program 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-program-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", +] + [[package]] name = "solana-vote-program" version = "1.15.2" @@ -7034,13 +8070,28 @@ dependencies = [ "serde_derive", "solana-frozen-abi 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-frozen-abi-macro 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-metrics", + "solana-metrics 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-program 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", - "solana-program-runtime", + "solana-program-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "thiserror", ] +[[package]] +name = "solana-zk-token-proof-program" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ed4b22ad82dee705d0eec53283b4b6871a7b7b5231f023c18bf103f0cb62bc3" +dependencies = [ + "bytemuck", + "getrandom 0.1.16", + "num-derive", + "num-traits", + "solana-program-runtime 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-zk-token-sdk 1.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-zk-token-proof-program" version = "1.15.2" @@ -7050,7 +8101,7 @@ dependencies = [ "getrandom 0.1.16", "num-derive", "num-traits", - "solana-program-runtime", + "solana-program-runtime 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", "solana-zk-token-sdk 1.15.2 (git+https://github.com/solana-labs/solana.git?tag=v1.15.2)", ] diff --git a/Cargo.toml b/Cargo.toml index 76b4645..aa2cc50 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ dashmap = "5.4.0" mango = { git = "https://github.com/blockworks-foundation/mango-v3.git", tag = "v3.6.0", default-features = false } mango-common = { git = "https://github.com/blockworks-foundation/mango-v3.git", tag = "v3.6.0" } +mango-feeds-connector = { git = "https://github.com/blockworks-foundation/mango-feeds.git", branch = "ckamm/solana-versions2", default-features = false, features = ["solana-1-15"] } yellowstone-grpc-proto = "1.0.1" solana-client = { git = "https://github.com/solana-labs/solana.git", tag="v1.15.2" } diff --git a/src/account_write_filter.rs b/src/account_write_filter.rs deleted file mode 100644 index 81c95cd..0000000 --- a/src/account_write_filter.rs +++ /dev/null @@ -1,146 +0,0 @@ -use crate::{ - chain_data::{AccountData, AccountWrite, ChainData, SlotData, SlotUpdate}, - metrics::Metrics, -}; - -use async_trait::async_trait; -use log::*; -use solana_sdk::{account::WritableAccount, pubkey::Pubkey, stake_history::Epoch}; -use std::{ - collections::{BTreeSet, HashMap}, - sync::Arc, - time::{Duration, Instant}, -}; - -#[async_trait] -pub trait AccountWriteSink { - async fn process(&self, pubkey: &Pubkey, account: &AccountData) -> Result<(), String>; -} - -#[derive(Clone)] -pub struct AccountWriteRoute { - pub matched_pubkeys: Vec, - pub sink: Arc, - pub timeout_interval: Duration, -} - -#[derive(Clone, Debug)] -struct AcountWriteRecord { - slot: u64, - write_version: u64, - timestamp: Instant, -} - -pub fn init( - routes: Vec, - metrics_sender: Metrics, -) -> anyhow::Result<( - async_channel::Sender, - async_channel::Sender, -)> { - // The actual message may want to also contain a retry count, if it self-reinserts on failure? - let (account_write_queue_sender, account_write_queue_receiver) = - async_channel::unbounded::(); - - // Slot updates flowing from the outside into the single processing thread. From - // there they'll flow into the postgres sending thread. - let (slot_queue_sender, slot_queue_receiver) = async_channel::unbounded::(); - - let mut chain_data = ChainData::new(metrics_sender); - let mut last_updated = HashMap::::new(); - - let all_queue_pks: BTreeSet = routes - .iter() - .flat_map(|r| r.matched_pubkeys.iter()) - .map(|pk| pk.clone()) - .collect(); - - // update handling thread, reads both sloths and account updates - tokio::spawn(async move { - loop { - tokio::select! { - Ok(account_write) = account_write_queue_receiver.recv() => { - if !all_queue_pks.contains(&account_write.pubkey) { - trace!("account write skipped {:?}", account_write.pubkey); - - continue; - } - - trace!("account write processed {:?}", account_write.pubkey); - - chain_data.update_account( - account_write.pubkey, - AccountData { - slot: account_write.slot, - write_version: account_write.write_version, - account: WritableAccount::create( - account_write.lamports, - account_write.data.clone(), - account_write.owner, - account_write.executable, - account_write.rent_epoch as Epoch, - ), - }, - ); - } - Ok(slot_update) = slot_queue_receiver.recv() => { - trace!("slot {:?}", slot_update); - - chain_data.update_slot(SlotData { - slot: slot_update.slot, - parent: slot_update.parent, - status: slot_update.status, - chain: 0, - }); - - } - } - - trace!("propagate chain data downstream"); - - for route in routes.iter() { - for pk in route.matched_pubkeys.iter() { - match chain_data.account(&pk) { - Ok(account_info) => { - let pk_b58 = pk.to_string(); - if let Some(record) = last_updated.get(&pk_b58) { - let is_unchanged = account_info.slot == record.slot - && account_info.write_version == record.write_version; - let is_throttled = - record.timestamp.elapsed() < route.timeout_interval; - if is_unchanged || is_throttled { - trace!("skipped is_unchanged={is_unchanged} is_throttled={is_throttled} {pk_b58}"); - continue; - } - }; - - trace!("process {pk_b58}"); - - match route.sink.process(pk, account_info).await { - Ok(()) => { - // todo: metrics - last_updated.insert( - pk_b58.clone(), - AcountWriteRecord { - slot: account_info.slot, - write_version: account_info.write_version, - timestamp: Instant::now(), - }, - ); - } - Err(_skip_reason) => { - // todo: metrics - } - } - } - Err(_) => { - // todo: metrics - } - } - } - } - } - }); - - Ok((account_write_queue_sender, slot_queue_sender)) -} diff --git a/src/chain_data.rs b/src/chain_data.rs deleted file mode 100644 index 2b5a7b7..0000000 --- a/src/chain_data.rs +++ /dev/null @@ -1,268 +0,0 @@ -use crate::metrics::{MetricType, MetricU64, Metrics}; - -use { - solana_sdk::{ - account::{Account, AccountSharedData, ReadableAccount}, - pubkey::Pubkey, - }, - std::collections::HashMap, -}; - -#[derive(Clone, Copy, Debug, PartialEq)] -pub enum SlotStatus { - Rooted, - Confirmed, - Processed, -} - -#[derive(Clone, Debug)] -pub struct SlotData { - pub slot: u64, - pub parent: Option, - pub status: SlotStatus, - pub chain: u64, // the top slot that this is in a chain with. uncles will have values < tip -} - -#[derive(Clone, Debug)] -pub struct AccountData { - pub slot: u64, - pub write_version: u64, - pub account: AccountSharedData, -} - -#[derive(Clone, PartialEq, Debug)] -pub struct AccountWrite { - pub pubkey: Pubkey, - pub slot: u64, - pub write_version: u64, - pub lamports: u64, - pub owner: Pubkey, - pub executable: bool, - pub rent_epoch: u64, - pub data: Vec, - pub is_selected: bool, -} - -impl AccountWrite { - pub fn from(pubkey: Pubkey, slot: u64, write_version: u64, account: Account) -> AccountWrite { - AccountWrite { - pubkey, - slot: slot, - write_version, - lamports: account.lamports, - owner: account.owner, - executable: account.executable, - rent_epoch: account.rent_epoch, - data: account.data, - is_selected: true, - } - } -} - -#[derive(Clone, Debug)] -pub struct SlotUpdate { - pub slot: u64, - pub parent: Option, - pub status: SlotStatus, -} - -/// Track slots and account writes -/// -/// - use account() to retrieve the current best data for an account. -/// - update_from_snapshot() and update_from_websocket() update the state for new messages -pub struct ChainData { - /// only slots >= newest_rooted_slot are retained - slots: HashMap, - /// writes to accounts, only the latest rooted write an newer are retained - accounts: HashMap>, - newest_rooted_slot: u64, - newest_processed_slot: u64, - account_versions_stored: usize, - account_bytes_stored: usize, - metric_accounts_stored: MetricU64, - metric_account_versions_stored: MetricU64, - metric_account_bytes_stored: MetricU64, -} - -impl ChainData { - pub fn new(metrics_sender: Metrics) -> Self { - Self { - slots: HashMap::new(), - accounts: HashMap::new(), - newest_rooted_slot: 0, - newest_processed_slot: 0, - account_versions_stored: 0, - account_bytes_stored: 0, - metric_accounts_stored: metrics_sender - .register_u64("chaindata_accounts_stored".into(), MetricType::Gauge), - metric_account_versions_stored: metrics_sender.register_u64( - "chaindata_account_versions_stored".into(), - MetricType::Gauge, - ), - metric_account_bytes_stored: metrics_sender - .register_u64("chaindata_account_bytes_stored".into(), MetricType::Gauge), - } - } - - pub fn update_slot(&mut self, new_slot: SlotData) { - let new_processed_head = new_slot.slot > self.newest_processed_slot; - if new_processed_head { - self.newest_processed_slot = new_slot.slot; - } - - let new_rooted_head = - new_slot.slot > self.newest_rooted_slot && new_slot.status == SlotStatus::Rooted; - if new_rooted_head { - self.newest_rooted_slot = new_slot.slot; - } - - let mut parent_update = false; - - use std::collections::hash_map::Entry; - match self.slots.entry(new_slot.slot) { - Entry::Vacant(v) => { - v.insert(new_slot); - } - Entry::Occupied(o) => { - let v = o.into_mut(); - parent_update = v.parent != new_slot.parent && new_slot.parent.is_some(); - v.parent = v.parent.or(new_slot.parent); - v.status = new_slot.status; - } - }; - - if new_processed_head || parent_update { - // update the "chain" field down to the first rooted slot - let mut slot = self.newest_processed_slot; - loop { - if let Some(data) = self.slots.get_mut(&slot) { - data.chain = self.newest_processed_slot; - if data.status == SlotStatus::Rooted { - break; - } - if let Some(parent) = data.parent { - slot = parent; - continue; - } - } - break; - } - } - - if new_rooted_head { - // for each account, preserve only writes > newest_rooted_slot, or the newest - // rooted write - self.account_versions_stored = 0; - self.account_bytes_stored = 0; - - for (_, writes) in self.accounts.iter_mut() { - let newest_rooted_write = writes - .iter() - .rev() - .find(|w| { - w.slot <= self.newest_rooted_slot - && self - .slots - .get(&w.slot) - .map(|s| { - // sometimes we seem not to get notifications about slots - // getting rooted, hence assume non-uncle slots < newest_rooted_slot - // are rooted too - s.status == SlotStatus::Rooted - || s.chain == self.newest_processed_slot - }) - // preserved account writes for deleted slots <= newest_rooted_slot - // are expected to be rooted - .unwrap_or(true) - }) - .map(|w| w.slot) - // no rooted write found: produce no effect, since writes > newest_rooted_slot are retained anyway - .unwrap_or(self.newest_rooted_slot + 1); - writes - .retain(|w| w.slot == newest_rooted_write || w.slot > self.newest_rooted_slot); - self.account_versions_stored += writes.len(); - self.account_bytes_stored += writes - .iter() - .map(|w| w.account.data().len()) - .fold(0, |acc, l| acc + l) - } - - // now it's fine to drop any slots before the new rooted head - // as account writes for non-rooted slots before it have been dropped - self.slots.retain(|s, _| *s >= self.newest_rooted_slot); - - self.metric_accounts_stored.set(self.accounts.len() as u64); - self.metric_account_versions_stored - .set(self.account_versions_stored as u64); - self.metric_account_bytes_stored - .set(self.account_bytes_stored as u64); - } - } - - pub fn update_account(&mut self, pubkey: Pubkey, account: AccountData) { - use std::collections::hash_map::Entry; - match self.accounts.entry(pubkey) { - Entry::Vacant(v) => { - self.account_versions_stored += 1; - self.account_bytes_stored += account.account.data().len(); - v.insert(vec![account]); - } - Entry::Occupied(o) => { - let v = o.into_mut(); - // v is ordered by slot ascending. find the right position - // overwrite if an entry for the slot already exists, otherwise insert - let rev_pos = v - .iter() - .rev() - .position(|d| d.slot <= account.slot) - .unwrap_or(v.len()); - let pos = v.len() - rev_pos; - if pos < v.len() && v[pos].slot == account.slot { - if v[pos].write_version < account.write_version { - v[pos] = account; - } - } else { - self.account_versions_stored += 1; - self.account_bytes_stored += account.account.data().len(); - v.insert(pos, account); - } - } - }; - } - - fn is_account_write_live(&self, write: &AccountData) -> bool { - self.slots - .get(&write.slot) - // either the slot is rooted or in the current chain - .map(|s| s.status == SlotStatus::Rooted || s.chain == self.newest_processed_slot) - // if the slot can't be found but preceeds newest rooted, use it too (old rooted slots are removed) - .unwrap_or( - write.slot <= self.newest_rooted_slot || write.slot > self.newest_processed_slot, - ) - } - - /// Cloned snapshot of all the most recent live writes per pubkey - pub fn accounts_snapshot(&self) -> HashMap { - self.accounts - .iter() - .filter_map(|(pubkey, writes)| { - let latest_good_write = writes - .iter() - .rev() - .find(|w| self.is_account_write_live(w))?; - Some((pubkey.clone(), latest_good_write.clone())) - }) - .collect() - } - - /// Ref to the most recent live write of the pubkey - pub fn account<'a>(&'a self, pubkey: &Pubkey) -> anyhow::Result<&'a AccountData> { - self.accounts - .get(pubkey) - .ok_or(anyhow::anyhow!("account {} not found", pubkey))? - .iter() - .rev() - .find(|w| self.is_account_write_live(w)) - .ok_or(anyhow::anyhow!("account {} has no live data", pubkey)) - } -} diff --git a/src/crank.rs b/src/crank.rs index 71054c1..aeee5e3 100644 --- a/src/crank.rs +++ b/src/crank.rs @@ -1,14 +1,19 @@ use crate::{ - account_write_filter::{self, AccountWriteRoute}, - grpc_plugin_source::FilterConfig, helpers::to_sp_pk, mango::GroupConfig, mango_v3_perp_crank_sink::MangoV3PerpCrankSink, - metrics, states::{KeeperInstruction, TransactionSendRecord}, tpu_manager::TpuManager, - websocket_source::{self, KeeperConfig}, }; + +use mango_feeds_connector::{ + account_write_filter::{self, AccountWriteRoute}, + FilterConfig, + websocket_source, + metrics, SourceConfig, + SnapshotSourceConfig, MetricsConfig, +}; + use async_channel::unbounded; use chrono::Utc; use log::*; @@ -26,6 +31,16 @@ use std::{ }; use tokio::sync::RwLock; + + +#[derive(Debug, Clone)] +pub struct KeeperConfig { + pub program_id: Pubkey, + pub rpc_url: String, + pub websocket_url: String, +} + + pub fn start( config: KeeperConfig, exit_signal: Arc, @@ -49,7 +64,7 @@ pub fn start( let group_pk = Pubkey::from_str(&group.public_key).unwrap(); let cache_pk = Pubkey::from_str(&group.cache_key).unwrap(); let mango_program_id = Pubkey::from_str(&group.mango_program_id).unwrap(); - let filter_config = FilterConfig { + let _filter_config = FilterConfig { program_ids: vec![group.mango_program_id.clone()], account_ids: group .perp_markets @@ -98,7 +113,7 @@ pub fn start( tokio::spawn(async move { let metrics_tx = metrics::start( - metrics::MetricsConfig { + MetricsConfig { output_stdout: true, output_http: false, }, @@ -108,7 +123,7 @@ pub fn start( let routes = vec![AccountWriteRoute { matched_pubkeys: perp_queue_pks .iter() - .map(|(_, evq_pk)| evq_pk.clone()) + .map(|(_, evq_pk)| mango_feeds_connector::solana_sdk::pubkey::Pubkey::new_from_array(evq_pk.to_bytes())) .collect(), sink: Arc::new(MangoV3PerpCrankSink::new( perp_queue_pks, @@ -134,8 +149,15 @@ pub fn start( // ).await; websocket_source::process_events( - config, - &filter_config, + &SourceConfig { + dedup_queue_size: 0, + grpc_sources: vec![], + snapshot: SnapshotSourceConfig { + rpc_http_url: config.rpc_url, + program_id: config.program_id.to_string(), + }, + rpc_ws_url: config.websocket_url, + }, account_write_queue_sender, slot_queue_sender, ) diff --git a/src/grpc_plugin_source.rs b/src/grpc_plugin_source.rs deleted file mode 100644 index 0f60046..0000000 --- a/src/grpc_plugin_source.rs +++ /dev/null @@ -1,617 +0,0 @@ -use futures::stream::once; -use jsonrpc_core::futures::StreamExt; -use jsonrpc_core_client::transports::http; - -use serde::Deserialize; -use solana_account_decoder::{UiAccount, UiAccountEncoding}; -use solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig}; -use solana_client::rpc_response::{OptionalContext, RpcKeyedAccount}; -use solana_rpc::rpc::rpc_accounts::AccountsDataClient; -use solana_rpc::rpc::rpc_accounts_scan::AccountsScanClient; -use solana_sdk::{account::Account, commitment_config::CommitmentConfig, pubkey::Pubkey}; - -use futures::{future, future::FutureExt}; -use yellowstone_grpc_proto::tonic::{ - metadata::MetadataValue, - transport::{Certificate, Channel, ClientTlsConfig, Identity}, - Request, -}; - -use log::*; -use std::{collections::HashMap, env, str::FromStr, time::Duration}; - -use yellowstone_grpc_proto::prelude::{ - geyser_client::GeyserClient, subscribe_update, SubscribeRequest, - SubscribeRequestFilterAccounts, SubscribeRequestFilterSlots, SubscribeUpdate, - SubscribeUpdateSlotStatus, -}; - -use crate::websocket_source::KeeperConfig; -use crate::{ - chain_data::{AccountWrite, SlotStatus, SlotUpdate}, - metrics::{MetricType, Metrics}, - AnyhowWrap, -}; - -#[derive(Clone, Debug, Deserialize)] -pub struct GrpcSourceConfig { - pub name: String, - pub connection_string: String, - pub retry_connection_sleep_secs: u64, - pub token: String, -} - -#[derive(Clone, Debug, Deserialize)] -pub struct TlsConfig { - pub ca_cert_path: String, - pub client_cert_path: String, - pub client_key_path: String, - pub domain_name: String, -} - -#[derive(Clone, Debug, Deserialize)] -pub struct FilterConfig { - pub program_ids: Vec, - pub account_ids: Vec, -} - -#[derive(Clone, Debug, Deserialize)] -pub struct SnapshotSourceConfig { - pub rpc_http_url: String, - pub program_id: String, -} - -#[derive(Clone, Debug)] -pub struct GrpcConfig { - pub dedup_queue_size: usize, - pub grpc_sources: Vec, -} - -//use solana_geyser_connector_plugin_grpc::compression::zstd_decompress; - -struct SnapshotData { - slot: u64, - accounts: Vec<(String, Option)>, -} -enum Message { - GrpcUpdate(SubscribeUpdate), - Snapshot(SnapshotData), -} - -async fn get_snapshot_gpa( - rpc_http_url: String, - program_id: String, -) -> anyhow::Result>> { - let rpc_client = http::connect_with_options::(&rpc_http_url, true) - .await - .map_err_anyhow()?; - - let account_info_config = RpcAccountInfoConfig { - encoding: Some(UiAccountEncoding::Base64), - commitment: Some(CommitmentConfig::finalized()), - data_slice: None, - min_context_slot: None, - }; - let program_accounts_config = RpcProgramAccountsConfig { - filters: None, - with_context: Some(true), - account_config: account_info_config.clone(), - }; - - info!("requesting snapshot {}", program_id); - let account_snapshot = rpc_client - .get_program_accounts(program_id.clone(), Some(program_accounts_config.clone())) - .await - .map_err_anyhow()?; - info!("snapshot received {}", program_id); - Ok(account_snapshot) -} - -async fn get_snapshot_gma( - rpc_http_url: String, - ids: Vec, -) -> anyhow::Result>>> { - let rpc_client = http::connect_with_options::(&rpc_http_url, true) - .await - .map_err_anyhow()?; - - let account_info_config = RpcAccountInfoConfig { - encoding: Some(UiAccountEncoding::Base64), - commitment: Some(CommitmentConfig::finalized()), - data_slice: None, - min_context_slot: None, - }; - - info!("requesting snapshot {:?}", ids); - let account_snapshot = rpc_client - .get_multiple_accounts(ids.clone(), Some(account_info_config)) - .await - .map_err_anyhow()?; - info!("snapshot received {:?}", ids); - Ok(account_snapshot) -} - -async fn feed_data_geyser( - grpc_config: &GrpcSourceConfig, - keeper_config: &KeeperConfig, - filter_config: &FilterConfig, - sender: async_channel::Sender, -) -> anyhow::Result<()> { - let connection_string = match &grpc_config.connection_string.chars().next().unwrap() { - '$' => env::var(&grpc_config.connection_string[1..]) - .expect("reading connection string from env"), - _ => grpc_config.connection_string.clone(), - }; - let rpc_http_url = match &keeper_config.rpc_url.chars().next().unwrap() { - '$' => env::var(&keeper_config.rpc_url[1..]).expect("reading connection string from env"), - _ => keeper_config.rpc_url.clone(), - }; - info!("connecting to {}", connection_string); - - let res = Channel::from_shared(connection_string.clone()); - let endpoint = res.map(|e| { - if e.uri().scheme_str() == Some("https") { - info!("enable tls"); - e.tls_config(ClientTlsConfig::new()) - } else { - Ok(e) - } - })??; - let channel = endpoint.connect_lazy(); - - let token: MetadataValue<_> = grpc_config.token.parse()?; - let mut client = GeyserClient::with_interceptor(channel, move |mut req: Request<()>| { - req.metadata_mut().insert("x-token", token.clone()); - Ok(req) - }); - - // If account_ids are provided, snapshot will be gMA. If only program_ids, then only the first id will be snapshot - // TODO: handle this better - if filter_config.program_ids.len() > 1 { - warn!("only one program id is supported for gPA snapshots") - } - let mut accounts = HashMap::new(); - accounts.insert( - "client".to_owned(), - SubscribeRequestFilterAccounts { - account: filter_config.account_ids.clone(), - owner: filter_config.program_ids.clone(), - filters: vec![], - }, - ); - let mut slots = HashMap::new(); - slots.insert("client".to_owned(), SubscribeRequestFilterSlots {}); - let blocks = HashMap::new(); - let blocks_meta = HashMap::new(); - let transactions = HashMap::new(); - - let request = SubscribeRequest { - accounts, - blocks, - blocks_meta, - slots, - transactions, - }; - info!("Going to send request: {:?}", request); - - let response = client.subscribe(once(async move { request })).await?; - let mut update_stream = response.into_inner(); - - // We can't get a snapshot immediately since the finalized snapshot would be for a - // slot in the past and we'd be missing intermediate updates. - // - // Delay the request until the first slot we received all writes for becomes rooted - // to avoid that problem - partially. The rooted slot will still be larger than the - // finalized slot, so add a number of slots as a buffer. - // - // If that buffer isn't sufficient, there'll be a retry. - - // The first slot that we will receive _all_ account writes for - let mut first_full_slot: u64 = u64::MAX; - - // If a snapshot should be performed when ready. - let mut snapshot_needed = true; - - // The highest "rooted" slot that has been seen. - let mut max_rooted_slot = 0; - - // Data for slots will arrive out of order. This value defines how many - // slots after a slot was marked "rooted" we assume it'll not receive - // any more account write information. - // - // This is important for the write_version mapping (to know when slots can - // be dropped). - let max_out_of_order_slots = 40; - - // Number of slots that we expect "finalized" commitment to lag - // behind "rooted". This matters for getProgramAccounts based snapshots, - // which will have "finalized" commitment. - let mut rooted_to_finalized_slots = 30; - - let mut snapshot_gma = future::Fuse::terminated(); - let mut snapshot_gpa = future::Fuse::terminated(); - - // The plugin sends a ping every 10s - let fatal_idle_timeout = Duration::from_secs(60); - - // Highest slot that an account write came in for. - let mut newest_write_slot: u64 = 0; - - struct WriteVersion { - // Write version seen on-chain - global: u64, - // The per-pubkey per-slot write version - slot: u32, - } - - // map slot -> (pubkey -> WriteVersion) - // - // Since the write_version is a private indentifier per node it can't be used - // to deduplicate events from multiple nodes. Here we rewrite it such that each - // pubkey and each slot has a consecutive numbering of writes starting at 1. - // - // That number will be consistent for each node. - let mut slot_pubkey_writes = HashMap::>::new(); - - loop { - tokio::select! { - update = update_stream.next() => { - use subscribe_update::UpdateOneof; - let mut update = update.ok_or(anyhow::anyhow!("geyser plugin has closed the stream"))??; - trace!("update={:?}", update); - match update.update_oneof.as_mut().expect("invalid grpc") { - UpdateOneof::Slot(slot_update) => { - let status = slot_update.status; - if status == SubscribeUpdateSlotStatus::Finalized as i32 { - if first_full_slot == u64::MAX { - // TODO: is this equivalent to before? what was highesy_write_slot? - first_full_slot = slot_update.slot + 1; - } - if slot_update.slot > max_rooted_slot { - max_rooted_slot = slot_update.slot; - - // drop data for slots that are well beyond rooted - slot_pubkey_writes.retain(|&k, _| k >= max_rooted_slot - max_out_of_order_slots); - } - - if snapshot_needed && max_rooted_slot - rooted_to_finalized_slots > first_full_slot { - snapshot_needed = false; - if filter_config.account_ids.len() > 0 { - snapshot_gma = tokio::spawn(get_snapshot_gma(rpc_http_url.clone(), filter_config.account_ids.clone())).fuse(); - } else if filter_config.program_ids.len() > 0 { - snapshot_gpa = tokio::spawn(get_snapshot_gpa(rpc_http_url.clone(), filter_config.program_ids[0].clone())).fuse(); - } - } - } - }, - UpdateOneof::Account(info) => { - if info.slot < first_full_slot { - // Don't try to process data for slots where we may have missed writes: - // We could not map the write_version correctly for them. - continue; - } - - if info.slot > newest_write_slot { - newest_write_slot = info.slot; - } else if max_rooted_slot > 0 && info.slot < max_rooted_slot - max_out_of_order_slots { - anyhow::bail!("received write {} slots back from max rooted slot {}", max_rooted_slot - info.slot, max_rooted_slot); - } - - let pubkey_writes = slot_pubkey_writes.entry(info.slot).or_default(); - let mut write = match info.account.clone() { - Some(x) => x, - None => { - // TODO: handle error - continue; - }, - }; - - let pubkey_bytes: [u8;32] = write.pubkey.try_into().expect("Pubkey be of size 32 bytes"); - let write_version_mapping = pubkey_writes.entry(pubkey_bytes).or_insert(WriteVersion { - global: write.write_version, - slot: 1, // write version 0 is reserved for snapshots - }); - - // We assume we will receive write versions for each pubkey in sequence. - // If this is not the case, logic here does not work correctly because - // a later write could arrive first. - if write.write_version < write_version_mapping.global { - anyhow::bail!("unexpected write version: got {}, expected >= {}", write.write_version, write_version_mapping.global); - } - - // Rewrite the update to use the local write version and bump it - write.write_version = write_version_mapping.slot as u64; - write_version_mapping.slot += 1; - }, - UpdateOneof::Ping(_) => {}, - UpdateOneof::Block(_) => {}, - UpdateOneof::BlockMeta(_) => {}, - UpdateOneof::Transaction(_) => {}, - } - sender.send(Message::GrpcUpdate(update)).await.expect("send success"); - }, - snapshot = &mut snapshot_gma => { - let snapshot = snapshot??; - info!("snapshot is for slot {}, first full slot was {}", snapshot.context.slot, first_full_slot); - if snapshot.context.slot >= first_full_slot { - let accounts: Vec<(String, Option)> = filter_config.account_ids.iter().zip(snapshot.value).map(|x| (x.0.clone(), x.1)).collect(); - sender - .send(Message::Snapshot(SnapshotData { - accounts, - slot: snapshot.context.slot, - })) - .await - .expect("send success"); - } else { - info!( - "snapshot is too old: has slot {}, expected {} minimum", - snapshot.context.slot, - first_full_slot - ); - // try again in another 10 slots - snapshot_needed = true; - rooted_to_finalized_slots += 10; - } - }, - snapshot = &mut snapshot_gpa => { - let snapshot = snapshot??; - if let OptionalContext::Context(snapshot_data) = snapshot { - info!("snapshot is for slot {}, first full slot was {}", snapshot_data.context.slot, first_full_slot); - if snapshot_data.context.slot >= first_full_slot { - let accounts: Vec<(String, Option)> = snapshot_data.value.iter().map(|x| { - let deref = x.clone(); - (deref.pubkey, Some(deref.account)) - }).collect(); - sender - .send(Message::Snapshot(SnapshotData { - accounts, - slot: snapshot_data.context.slot, - })) - .await - .expect("send success"); - } else { - info!( - "snapshot is too old: has slot {}, expected {} minimum", - snapshot_data.context.slot, - first_full_slot - ); - // try again in another 10 slots - snapshot_needed = true; - rooted_to_finalized_slots += 10; - } - } else { - anyhow::bail!("bad snapshot format"); - } - }, - _ = tokio::time::sleep(fatal_idle_timeout) => { - anyhow::bail!("geyser plugin hasn't sent a message in too long"); - } - } - } -} - -fn _make_tls_config(config: &TlsConfig) -> ClientTlsConfig { - let server_root_ca_cert = match &config.ca_cert_path.chars().next().unwrap() { - '$' => env::var(&config.ca_cert_path[1..]) - .expect("reading server root ca cert from env") - .into_bytes(), - _ => std::fs::read(&config.ca_cert_path).expect("reading server root ca cert from file"), - }; - let server_root_ca_cert = Certificate::from_pem(server_root_ca_cert); - let client_cert = match &config.client_cert_path.chars().next().unwrap() { - '$' => env::var(&config.client_cert_path[1..]) - .expect("reading client cert from env") - .into_bytes(), - _ => std::fs::read(&config.client_cert_path).expect("reading client cert from file"), - }; - let client_key = match &config.client_key_path.chars().next().unwrap() { - '$' => env::var(&config.client_key_path[1..]) - .expect("reading client key from env") - .into_bytes(), - _ => std::fs::read(&config.client_key_path).expect("reading client key from file"), - }; - let client_identity = Identity::from_pem(client_cert, client_key); - let domain_name = match &config.domain_name.chars().next().unwrap() { - '$' => env::var(&config.domain_name[1..]).expect("reading domain name from env"), - _ => config.domain_name.clone(), - }; - ClientTlsConfig::new() - .ca_certificate(server_root_ca_cert) - .identity(client_identity) - .domain_name(domain_name) -} - -pub async fn process_events( - grpc_config: GrpcConfig, - keeper_config: KeeperConfig, - filter_config: &FilterConfig, - account_write_queue_sender: async_channel::Sender, - slot_queue_sender: async_channel::Sender, - metrics_sender: Metrics, -) { - // Subscribe to geyser - let (msg_sender, msg_receiver) = - async_channel::bounded::(grpc_config.dedup_queue_size); - for grpc_source in grpc_config.grpc_sources.clone() { - let msg_sender = msg_sender.clone(); - let snapshot_source = keeper_config.clone(); - let metrics_sender = metrics_sender.clone(); - let filter_config = filter_config.clone(); - - tokio::spawn(async move { - let mut metric_retries = metrics_sender.register_u64( - format!("grpc_source_{}_connection_retries", grpc_source.name,), - MetricType::Counter, - ); - let metric_connected = - metrics_sender.register_bool(format!("grpc_source_{}_status", grpc_source.name)); - - // Continuously reconnect on failure - loop { - metric_connected.set(true); - let out = feed_data_geyser( - &grpc_source, - &snapshot_source, - &filter_config, - msg_sender.clone(), - ); - let result = out.await; - // assert!(result.is_err()); - if let Err(err) = result { - warn!( - "error during communication with the geyser plugin. retrying. {:?}", - err - ); - } - - metric_connected.set(false); - metric_retries.increment(); - - tokio::time::sleep(std::time::Duration::from_secs( - grpc_source.retry_connection_sleep_secs, - )) - .await; - } - }); - } - - // slot -> (pubkey -> write_version) - // - // To avoid unnecessarily sending requests to SQL, we track the latest write_version - // for each (slot, pubkey). If an already-seen write_version comes in, it can be safely - // discarded. - let mut latest_write = HashMap::>::new(); - - // Number of slots to retain in latest_write - let latest_write_retention = 50; - - let mut metric_account_writes = - metrics_sender.register_u64("grpc_account_writes".into(), MetricType::Counter); - let mut metric_account_queue = - metrics_sender.register_u64("grpc_account_write_queue".into(), MetricType::Gauge); - let mut metric_dedup_queue = - metrics_sender.register_u64("grpc_dedup_queue".into(), MetricType::Gauge); - let mut metric_slot_queue = - metrics_sender.register_u64("grpc_slot_update_queue".into(), MetricType::Gauge); - let mut metric_slot_updates = - metrics_sender.register_u64("grpc_slot_updates".into(), MetricType::Counter); - let mut metric_snapshots = - metrics_sender.register_u64("grpc_snapshots".into(), MetricType::Counter); - let mut metric_snapshot_account_writes = - metrics_sender.register_u64("grpc_snapshot_account_writes".into(), MetricType::Counter); - - loop { - metric_dedup_queue.set(msg_receiver.len() as u64); - let msg = msg_receiver.recv().await.expect("sender must not close"); - use subscribe_update::UpdateOneof; - match msg { - Message::GrpcUpdate(update) => { - match update.update_oneof.expect("invalid grpc") { - UpdateOneof::Account(info) => { - let update = match info.account.clone() { - Some(x) => x, - None => { - // TODO: handle error - continue; - } - }; - assert!(update.pubkey.len() == 32); - assert!(update.owner.len() == 32); - - metric_account_writes.increment(); - metric_account_queue.set(account_write_queue_sender.len() as u64); - - // Skip writes that a different server has already sent - let pubkey_writes = latest_write.entry(info.slot).or_default(); - let pubkey_bytes: [u8; 32] = update - .pubkey - .clone() - .try_into() - .expect("Pubkey should be of size 32 bytes"); - let writes = pubkey_writes.entry(pubkey_bytes).or_insert(0); - if update.write_version <= *writes { - continue; - } - *writes = update.write_version; - latest_write.retain(|&k, _| k >= info.slot - latest_write_retention); - // let mut uncompressed: Vec = Vec::new(); - // zstd_decompress(&update.data, &mut uncompressed).unwrap(); - account_write_queue_sender - .send(AccountWrite { - pubkey: Pubkey::new_from_array( - update - .pubkey - .try_into() - .expect("Pubkey be of size 32 bytes"), - ), - slot: info.slot, - write_version: update.write_version, - lamports: update.lamports, - owner: Pubkey::new_from_array( - update.owner.try_into().expect("Pubkey be of size 32 bytes"), - ), - executable: update.executable, - rent_epoch: update.rent_epoch, - data: update.data, - // TODO: what should this be? related to account deletes? - is_selected: true, - }) - .await - .expect("send success"); - } - UpdateOneof::Slot(update) => { - metric_slot_updates.increment(); - metric_slot_queue.set(slot_queue_sender.len() as u64); - - let status = - SubscribeUpdateSlotStatus::from_i32(update.status).map(|v| match v { - SubscribeUpdateSlotStatus::Processed => SlotStatus::Processed, - SubscribeUpdateSlotStatus::Confirmed => SlotStatus::Confirmed, - SubscribeUpdateSlotStatus::Finalized => SlotStatus::Rooted, - }); - if status.is_none() { - error!("unexpected slot status: {}", update.status); - continue; - } - let slot_update = SlotUpdate { - slot: update.slot, - parent: update.parent, - status: status.expect("qed"), - }; - - slot_queue_sender - .send(slot_update) - .await - .expect("send success"); - } - UpdateOneof::Ping(_) => {} - UpdateOneof::Block(_) => {} - UpdateOneof::BlockMeta(_) => {} - UpdateOneof::Transaction(_) => {} - } - } - Message::Snapshot(update) => { - metric_snapshots.increment(); - info!("processing snapshot..."); - for account in update.accounts.iter() { - metric_snapshot_account_writes.increment(); - metric_account_queue.set(account_write_queue_sender.len() as u64); - - match account { - (key, Some(ui_account)) => { - // TODO: Resnapshot on invalid data? - let pubkey = Pubkey::from_str(key).unwrap(); - let account: Account = ui_account.decode().unwrap(); - account_write_queue_sender - .send(AccountWrite::from(pubkey, update.slot, 0, account)) - .await - .expect("send success"); - } - (key, None) => warn!("account not found {}", key), - } - } - info!("processing snapshot done"); - } - } - } -} diff --git a/src/lib.rs b/src/lib.rs index c31b76c..db0f5a1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,21 +1,17 @@ -pub mod account_write_filter; -pub mod chain_data; + pub mod cli; pub mod confirmation_strategies; pub mod crank; -pub mod grpc_plugin_source; pub mod helpers; pub mod keeper; pub mod mango; pub mod mango_v3_perp_crank_sink; pub mod market_markers; -pub mod metrics; pub mod result_writer; pub mod rotating_queue; pub mod states; pub mod stats; pub mod tpu_manager; -pub mod websocket_source; trait AnyhowWrap { type Value; diff --git a/src/main.rs b/src/main.rs index e5dfdad..1a04bbe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use { mango_simulation::{ cli, confirmation_strategies::confirmations_by_blocks, - crank, + crank::{self, KeeperConfig}, helpers::{ get_latest_blockhash, get_mango_market_perps_cache, start_blockhash_polling_service, to_sdk_pk, @@ -16,7 +16,6 @@ use { states::PerpMarketCache, stats::MangoSimulationStats, tpu_manager::TpuManager, - websocket_source::KeeperConfig, }, solana_client::{nonblocking::rpc_client::RpcClient as NbRpcClient, rpc_client::RpcClient}, solana_program::pubkey::Pubkey, diff --git a/src/mango_v3_perp_crank_sink.rs b/src/mango_v3_perp_crank_sink.rs index b798bbb..d6d9650 100644 --- a/src/mango_v3_perp_crank_sink.rs +++ b/src/mango_v3_perp_crank_sink.rs @@ -8,14 +8,17 @@ use mango::{ instruction::consume_events, queue::{AnyEvent, EventQueueHeader, EventType, FillEvent, OutEvent, Queue}, }; -use solana_sdk::account::ReadableAccount; +use mango_feeds_connector::solana_sdk::account::ReadableAccount; use solana_sdk::{instruction::Instruction, pubkey::Pubkey}; use bytemuck::cast_ref; -use crate::{ +use mango_feeds_connector::{ account_write_filter::AccountWriteSink, chain_data::AccountData, +}; + +use crate::{ helpers::{to_sdk_instruction, to_sp_pk}, }; @@ -58,7 +61,7 @@ type EventQueueEvents = [AnyEvent; QUEUE_LEN]; #[async_trait] impl AccountWriteSink for MangoV3PerpCrankSink { - async fn process(&self, pk: &Pubkey, account: &AccountData) -> Result<(), String> { + async fn process(&self, pk: &mango_feeds_connector::solana_sdk::pubkey::Pubkey, account: &AccountData) -> Result<(), String> { let account = &account.account; let (ix, mkt_pk): (Result, Pubkey) = { @@ -109,9 +112,11 @@ impl AccountWriteSink for MangoV3PerpCrankSink { ) .collect(); + + let pk = solana_sdk::pubkey::Pubkey::new_from_array(pk.to_bytes()); let mkt_pk = self .mkt_pks_by_evq_pks - .get(pk) + .get(&pk) .expect(&format!("{pk:?} is a known public key")); let ix = to_sdk_instruction( @@ -120,7 +125,7 @@ impl AccountWriteSink for MangoV3PerpCrankSink { &to_sp_pk(&self.group_pk), &to_sp_pk(&self.cache_pk), &to_sp_pk(mkt_pk), - &to_sp_pk(pk), + &to_sp_pk(&pk), &mut mango_accounts, MAX_EVENTS_PER_TX, ) diff --git a/src/metrics.rs b/src/metrics.rs deleted file mode 100644 index e426ba5..0000000 --- a/src/metrics.rs +++ /dev/null @@ -1,337 +0,0 @@ -use serde::Deserialize; - -use { - log::*, - std::collections::HashMap, - std::fmt, - std::sync::{atomic, Arc, Mutex, RwLock}, - tokio::time, - warp::{Filter, Rejection, Reply}, -}; - -#[derive(Debug)] -enum Value { - U64 { - value: Arc, - metric_type: MetricType, - }, - I64 { - value: Arc, - metric_type: MetricType, - }, - Bool { - value: Arc>, - metric_type: MetricType, - }, -} - -#[derive(Debug, Clone)] -pub enum MetricType { - Counter, - Gauge, -} - -impl fmt::Display for MetricType { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - MetricType::Counter => { - write!(f, "counter") - } - MetricType::Gauge => { - write!(f, "gauge") - } - } - } -} - -#[derive(Debug)] -enum PrevValue { - U64(u64), - I64(i64), - Bool(bool), -} - -#[derive(Clone)] -pub struct MetricU64 { - value: Arc, -} -impl MetricU64 { - pub fn value(&self) -> u64 { - self.value.load(atomic::Ordering::Acquire) - } - - pub fn set(&mut self, value: u64) { - self.value.store(value, atomic::Ordering::Release); - } - - pub fn set_max(&mut self, value: u64) { - self.value.fetch_max(value, atomic::Ordering::AcqRel); - } - - pub fn add(&mut self, value: u64) { - self.value.fetch_add(value, atomic::Ordering::AcqRel); - } - - pub fn increment(&mut self) { - self.value.fetch_add(1, atomic::Ordering::AcqRel); - } - - pub fn decrement(&mut self) { - self.value.fetch_sub(1, atomic::Ordering::AcqRel); - } -} - -#[derive(Clone)] -pub struct MetricI64 { - value: Arc, -} -impl MetricI64 { - pub fn set(&mut self, value: i64) { - self.value.store(value, atomic::Ordering::Release); - } - - pub fn increment(&mut self) { - self.value.fetch_add(1, atomic::Ordering::AcqRel); - } - - pub fn decrement(&mut self) { - self.value.fetch_sub(1, atomic::Ordering::AcqRel); - } -} - -#[derive(Clone)] -pub struct MetricBool { - value: Arc>, -} - -impl MetricBool { - pub fn set(&self, value: bool) { - *self.value.lock().unwrap() = value; - } -} - -#[derive(Clone)] -pub struct Metrics { - registry: Arc>>, - labels: HashMap, -} - -impl Metrics { - pub fn register_u64(&self, name: String, metric_type: MetricType) -> MetricU64 { - let mut registry = self.registry.write().unwrap(); - let value = registry.entry(name).or_insert(Value::U64 { - value: Arc::new(atomic::AtomicU64::new(0)), - metric_type: metric_type, - }); - MetricU64 { - value: match value { - Value::U64 { - value: v, - metric_type: _, - } => v.clone(), - _ => panic!("bad metric type"), - }, - } - } - - pub fn register_i64(&self, name: String, metric_type: MetricType) -> MetricI64 { - let mut registry = self.registry.write().unwrap(); - let value = registry.entry(name).or_insert(Value::I64 { - value: Arc::new(atomic::AtomicI64::new(0)), - metric_type: metric_type, - }); - MetricI64 { - value: match value { - Value::I64 { - value: v, - metric_type: _, - } => v.clone(), - _ => panic!("bad metric type"), - }, - } - } - - pub fn register_bool(&self, name: String) -> MetricBool { - let mut registry = self.registry.write().unwrap(); - let value = registry.entry(name).or_insert(Value::Bool { - value: Arc::new(Mutex::new(false)), - metric_type: MetricType::Gauge, - }); - MetricBool { - value: match value { - Value::Bool { - value: v, - metric_type: _, - } => v.clone(), - _ => panic!("bad metric type"), - }, - } - } - - pub fn get_registry_vec(&self) -> Vec<(String, String, String)> { - let mut vec: Vec<(String, String, String)> = Vec::new(); - let metrics = self.registry.read().unwrap(); - for (name, value) in metrics.iter() { - let (value_str, type_str) = match value { - Value::U64 { - value: v, - metric_type: t, - } => ( - format!("{}", v.load(atomic::Ordering::Acquire)), - t.to_string(), - ), - Value::I64 { - value: v, - metric_type: t, - } => ( - format!("{}", v.load(atomic::Ordering::Acquire)), - t.to_string(), - ), - Value::Bool { - value: v, - metric_type: t, - } => { - let bool_to_int = if *v.lock().unwrap() { 1 } else { 0 }; - (format!("{}", bool_to_int), t.to_string()) - } - }; - vec.push((name.clone(), value_str, type_str)); - } - vec - } -} - -async fn handle_prometheus_poll(metrics: Metrics) -> Result { - debug!("handle_prometheus_poll"); - let label_strings_vec: Vec = metrics - .labels - .iter() - .map(|(name, value)| format!("{}=\"{}\"", name, value)) - .collect(); - let lines: Vec = metrics - .get_registry_vec() - .iter() - .map(|(name, value, type_name)| { - let sanitized_name = str::replace(name, "-", "_"); - format!( - "# HELP {} \n# TYPE {} {}\n{}{{{}}} {}", - sanitized_name, - sanitized_name, - type_name, - sanitized_name, - label_strings_vec.join(","), - value - ) - }) - .collect(); - Ok(format!("{}\n", lines.join("\n"))) -} - -pub fn with_metrics( - metrics: Metrics, -) -> impl Filter + Clone { - warp::any().map(move || metrics.clone()) -} - -#[derive(Clone, Debug, Deserialize)] -pub struct MetricsConfig { - pub output_stdout: bool, - pub output_http: bool, - // TODO: add configurable port and endpoint url - // TODO: add configurable write interval -} - -pub fn start(config: MetricsConfig, process_name: String) -> Metrics { - let mut write_interval = time::interval(time::Duration::from_secs(60)); - - let registry = Arc::new(RwLock::new(HashMap::::new())); - let registry_c = Arc::clone(®istry); - let labels = HashMap::from([(String::from("process"), process_name)]); - let metrics_tx = Metrics { registry, labels }; - let metrics_route = warp::path!("metrics") - .and(with_metrics(metrics_tx.clone())) - .and_then(handle_prometheus_poll); - - if config.output_http { - // serve prometheus metrics endpoint - tokio::spawn(async move { - warp::serve(metrics_route).run(([0, 0, 0, 0], 9091)).await; - }); - } - - if config.output_stdout { - // periodically log to stdout - tokio::spawn(async move { - let mut previous_values = HashMap::::new(); - loop { - write_interval.tick().await; - - // Nested locking! Safe because the only other user locks registry for writing and doesn't - // acquire any interior locks. - let metrics = registry_c.read().unwrap(); - for (name, value) in metrics.iter() { - let previous_value = previous_values.get_mut(name); - match value { - Value::U64 { - value: v, - metric_type: _, - } => { - let new_value = v.load(atomic::Ordering::Acquire); - let previous_value = if let Some(PrevValue::U64(v)) = previous_value { - let prev = *v; - *v = new_value; - prev - } else { - previous_values.insert(name.clone(), PrevValue::U64(new_value)); - 0 - }; - let diff = new_value.wrapping_sub(previous_value) as i64; - info!("metric: {}: {} ({:+})", name, new_value, diff); - } - Value::I64 { - value: v, - metric_type: _, - } => { - let new_value = v.load(atomic::Ordering::Acquire); - let previous_value = if let Some(PrevValue::I64(v)) = previous_value { - let prev = *v; - *v = new_value; - prev - } else { - previous_values.insert(name.clone(), PrevValue::I64(new_value)); - 0 - }; - let diff = new_value - previous_value; - info!("metric: {}: {} ({:+})", name, new_value, diff); - } - Value::Bool { - value: v, - metric_type: _, - } => { - let new_value = v.lock().unwrap(); - let previous_value = if let Some(PrevValue::Bool(v)) = previous_value { - let mut prev = new_value.clone(); - std::mem::swap(&mut prev, v); - prev - } else { - previous_values - .insert(name.clone(), PrevValue::Bool(new_value.clone())); - false - }; - if *new_value == previous_value { - info!("metric: {}: {} (unchanged)", name, &*new_value); - } else { - info!( - "metric: {}: {} (before: {})", - name, &*new_value, previous_value - ); - } - } - } - } - } - }); - } - - metrics_tx -} diff --git a/src/websocket_source.rs b/src/websocket_source.rs deleted file mode 100644 index db5b3af..0000000 --- a/src/websocket_source.rs +++ /dev/null @@ -1,218 +0,0 @@ -use jsonrpc_core::futures::StreamExt; -use jsonrpc_core_client::transports::{http, ws}; - -use solana_account_decoder::UiAccountEncoding; -use solana_client::{ - rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig}, - rpc_response::{OptionalContext, Response, RpcKeyedAccount}, -}; -use solana_rpc::{rpc::rpc_accounts_scan::AccountsScanClient, rpc_pubsub::RpcSolPubSubClient}; -use solana_sdk::{account::Account, commitment_config::CommitmentConfig, pubkey::Pubkey}; - -use log::*; -use std::{ - collections::HashSet, - str::FromStr, - sync::Arc, - time::{Duration, Instant}, -}; - -use crate::{ - chain_data::{AccountWrite, SlotStatus, SlotUpdate}, - grpc_plugin_source::FilterConfig, - AnyhowWrap, -}; - -enum WebsocketMessage { - SingleUpdate(Response), - SnapshotUpdate(Response>), - SlotUpdate(Arc), -} - -#[derive(Debug, Clone)] -pub struct KeeperConfig { - pub program_id: Pubkey, - pub rpc_url: String, - pub websocket_url: String, -} - -// TODO: the reconnecting should be part of this -async fn feed_data( - config: KeeperConfig, - _filter_config: &FilterConfig, - sender: async_channel::Sender, -) -> anyhow::Result<()> { - let program_id = config.program_id; - let snapshot_duration = Duration::from_secs(10); - - info!("feed_data {config:?}"); - let connect = ws::try_connect::(&config.websocket_url).map_err_anyhow()?; - let client: RpcSolPubSubClient = connect.await.map_err_anyhow()?; - - let rpc_client = http::connect_with_options::(&config.rpc_url, true) - .await - .map_err_anyhow()?; - - let account_info_config = RpcAccountInfoConfig { - encoding: Some(UiAccountEncoding::Base64), - commitment: Some(CommitmentConfig::processed()), - data_slice: None, - min_context_slot: None, - }; - let program_accounts_config = RpcProgramAccountsConfig { - filters: None, - with_context: Some(true), - account_config: account_info_config.clone(), - }; - - let mut update_sub = client - .program_subscribe( - program_id.to_string(), - Some(program_accounts_config.clone()), - ) - .map_err_anyhow()?; - - let mut slot_sub = client.slots_updates_subscribe().map_err_anyhow()?; - - let mut last_snapshot = Instant::now() - snapshot_duration; - - loop { - // occasionally cause a new snapshot to be produced - // including the first time - if last_snapshot + snapshot_duration <= Instant::now() { - let account_snapshot = rpc_client - .get_program_accounts( - program_id.to_string(), - Some(program_accounts_config.clone()), - ) - .await - .map_err_anyhow()?; - if let OptionalContext::Context(account_snapshot_response) = account_snapshot { - info!("snapshot"); - sender - .send(WebsocketMessage::SnapshotUpdate(account_snapshot_response)) - .await - .expect("sending must succeed"); - } - last_snapshot = Instant::now(); - } - - tokio::select! { - account = update_sub.next() => { - trace!("account {account:?}"); - match account { - Some(account) => { - sender.send(WebsocketMessage::SingleUpdate(account.map_err_anyhow()?)).await.expect("sending must succeed"); - }, - None => { - warn!("account stream closed"); - return Ok(()); - }, - } - }, - slot_update = slot_sub.next() => { - trace!("slot {slot_update:?}"); - match slot_update { - Some(slot_update) => { - sender.send(WebsocketMessage::SlotUpdate(slot_update.map_err_anyhow()?)).await.expect("sending must succeed"); - }, - None => { - warn!("slot update stream closed"); - return Ok(()); - }, - } - }, - _ = tokio::time::sleep(Duration::from_secs(60)) => { - warn!("websocket timeout"); - return Ok(()) - } - } - } -} - -// TODO: rename / split / rework -pub async fn process_events( - config: KeeperConfig, - filter_config: &FilterConfig, - account_write_queue_sender: async_channel::Sender, - slot_queue_sender: async_channel::Sender, -) { - let account_wl = HashSet::::from_iter(filter_config.account_ids.iter().cloned()); - - // Subscribe to program account updates websocket - let (update_sender, update_receiver) = async_channel::unbounded::(); - let filter_config = filter_config.clone(); - tokio::spawn(async move { - // if the websocket disconnects, we get no data in a while etc, reconnect and try again - loop { - let out = feed_data(config.clone(), &filter_config, update_sender.clone()); - let res = out.await; - info!("loop {res:?}"); - } - }); - - // The thread that pulls updates and forwards them to the account write queue - loop { - let update = update_receiver.recv().await.unwrap(); - - match update { - WebsocketMessage::SingleUpdate(update) => { - if !account_wl.is_empty() && !account_wl.contains(&update.value.pubkey) { - continue; - } - trace!("single update"); - let account: Account = update.value.account.decode().unwrap(); - let pubkey = Pubkey::from_str(&update.value.pubkey).unwrap(); - account_write_queue_sender - .send(AccountWrite::from(pubkey, update.context.slot, 0, account)) - .await - .expect("send success"); - } - WebsocketMessage::SnapshotUpdate(update) => { - trace!("snapshot update"); - for keyed_account in update.value { - if !account_wl.is_empty() && !account_wl.contains(&keyed_account.pubkey) { - continue; - } - let account: Account = keyed_account.account.decode().unwrap(); - let pubkey = Pubkey::from_str(&keyed_account.pubkey).unwrap(); - account_write_queue_sender - .send(AccountWrite::from(pubkey, update.context.slot, 0, account)) - .await - .expect("send success"); - } - } - WebsocketMessage::SlotUpdate(update) => { - trace!("slot update"); - let message = match *update { - solana_client::rpc_response::SlotUpdate::CreatedBank { - slot, parent, .. - } => Some(SlotUpdate { - slot, - parent: Some(parent), - status: SlotStatus::Processed, - }), - solana_client::rpc_response::SlotUpdate::OptimisticConfirmation { - slot, - .. - } => Some(SlotUpdate { - slot, - parent: None, - status: SlotStatus::Confirmed, - }), - solana_client::rpc_response::SlotUpdate::Root { slot, .. } => { - Some(SlotUpdate { - slot, - parent: None, - status: SlotStatus::Rooted, - }) - } - _ => None, - }; - if let Some(message) = message { - slot_queue_sender.send(message).await.expect("send success"); - } - } - } - } -}