From dad81b0e3c26f87e5b45a09ad4f5c710c27429b4 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Tue, 28 May 2024 23:19:35 -0400 Subject: [PATCH] proto: add `timestamp` field to `SubscribeUpdate` message --- .github/workflows/test.yml | 3 +++ CHANGELOG.md | 33 +++++++++++++++++++++++ Cargo.lock | 21 ++++++++------- Cargo.toml | 13 ++++----- examples/rust/Cargo.toml | 2 +- yellowstone-grpc-client/Cargo.toml | 2 +- yellowstone-grpc-geyser/Cargo.toml | 2 +- yellowstone-grpc-geyser/src/filters.rs | 23 ++++++++++------ yellowstone-grpc-geyser/src/grpc.rs | 3 +++ yellowstone-grpc-proto/Cargo.toml | 3 ++- yellowstone-grpc-proto/proto/geyser.proto | 2 ++ yellowstone-grpc-proto/src/lib.rs | 2 +- 12 files changed, 80 insertions(+), 29 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 09f11a1..daf48ca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,9 @@ on: - 'v1.17' - 'v1.18' - 'v2.0' + - 'v1.17-gamma' + - 'v1.18-gamma' + - 'v2.0-gamma' workflow_dispatch: env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c3b8c2..a1f75f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -345,6 +345,17 @@ The minor version will be incremented upon a breaking change and the patch versi ## 2024-02-06 +- yellowstone-grpc-client-1.13.0+solana.1.17.20.gamma +- yellowstone-grpc-geyser-1.12.0+solana.1.17.20.gamma +- yellowstone-grpc-proto-1.12.0+solana.1.17.20.gamma +- yellowstone-grpc-tools-1.0.0-rc.9+solana.1.17.20.gamma + +### Features + +- proto: add `timestamp` field to `SubscribeUpdate` message + +## 2024-02-06 + - yellowstone-grpc-client-1.13.0+solana.1.17.20 - yellowstone-grpc-geyser-1.12.0+solana.1.17.20 - yellowstone-grpc-proto-1.12.0+solana.1.17.20 @@ -387,6 +398,17 @@ The minor version will be incremented upon a breaking change and the patch versi - solana: update to 1.17.16 ([#274](https://github.com/rpcpool/yellowstone-grpc/pull/274)) +## 2024-01-09 + +- yellowstone-grpc-client-1.13.0+solana.1.17.15.gamma +- yellowstone-grpc-geyser-1.12.0+solana.1.17.15.gamma +- yellowstone-grpc-proto-1.12.0+solana.1.17.15.gamma +- yellowstone-grpc-tools-1.0.0-rc.9+solana.1.17.15.gamma + +### Features + +- proto: add `timestamp` field to `SubscribeUpdate` message + ## 2024-01-08 - yellowstone-grpc-client-1.13.0+solana.1.17.15 @@ -399,6 +421,17 @@ The minor version will be incremented upon a breaking change and the patch versi - proto: add more convert functions ([#264](https://github.com/rpcpool/yellowstone-grpc/pull/264)) - geyser: set plugin name to `{name}-{version}` ([#270](https://github.com/rpcpool/yellowstone-grpc/pull/270)) +## 2023-12-24 + +- yellowstone-grpc-client-1.13.0+solana.1.16.21 +- yellowstone-grpc-geyser-1.12.0+solana.1.16.21 +- yellowstone-grpc-proto-1.12.0+solana.1.16.21 +- yellowstone-grpc-tools-1.0.0-rc.10+solana.1.16.21 + +### Features + +- proto: add `timestamp` field to `SubscribeUpdate` message + ## 2023-12-22 - yellowstone-grpc-client-1.12.0+solana.1.17.12 diff --git a/Cargo.lock b/Cargo.lock index 1b03e31..c23f620 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2392,9 +2392,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", "prost-derive", @@ -2423,9 +2423,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", "itertools 0.12.1", @@ -2436,9 +2436,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" +checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" dependencies = [ "prost", ] @@ -4434,7 +4434,7 @@ dependencies = [ [[package]] name = "yellowstone-grpc-client" -version = "2.0.0+solana.2.0.15" +version = "2.0.0+solana.2.0.15.gamma" dependencies = [ "bytes", "futures", @@ -4447,7 +4447,7 @@ dependencies = [ [[package]] name = "yellowstone-grpc-client-simple" -version = "2.0.0+solana.2.0.15" +version = "2.0.0+solana.2.0.15.gamma" dependencies = [ "anyhow", "backoff", @@ -4471,7 +4471,7 @@ dependencies = [ [[package]] name = "yellowstone-grpc-geyser" -version = "2.0.0+solana.2.0.15" +version = "2.0.0+solana.2.0.15.gamma" dependencies = [ "agave-geyser-plugin-interface", "anyhow", @@ -4507,11 +4507,12 @@ dependencies = [ [[package]] name = "yellowstone-grpc-proto" -version = "2.0.0+solana.2.0.15" +version = "2.0.0+solana.2.0.15.gamma" dependencies = [ "anyhow", "bincode", "prost", + "prost-types", "protobuf-src", "solana-account-decoder", "solana-sdk", diff --git a/Cargo.toml b/Cargo.toml index d3c9577..9b998f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [workspace] resolver = "2" members = [ - "examples/rust", # 2.0.0+solana.2.0.15 - "yellowstone-grpc-client", # 2.0.0+solana.2.0.15 - "yellowstone-grpc-geyser", # 2.0.0+solana.2.0.15 - "yellowstone-grpc-proto", # 2.0.0+solana.2.0.15 + "examples/rust", # 2.0.0+solana.2.0.15.gamma + "yellowstone-grpc-client", # 2.0.0+solana.2.0.15.gamma + "yellowstone-grpc-geyser", # 2.0.0+solana.2.0.15.gamma + "yellowstone-grpc-proto", # 2.0.0+solana.2.0.15.gamma ] [workspace.package] @@ -43,6 +43,7 @@ log = "0.4.17" maplit = "1.0.2" prometheus = "0.13.2" prost = "0.13.1" +prost-types = "0.13.3" protobuf-src = "1.1.0" scylla = "0.13.0" serde = "1.0.145" @@ -59,8 +60,8 @@ tonic = "0.12.1" tonic-build = "0.12.1" tonic-health = "0.12.1" vergen = "9.0.0" -yellowstone-grpc-client = { path = "yellowstone-grpc-client", version = "2.0.0" } -yellowstone-grpc-proto = { path = "yellowstone-grpc-proto", version = "2.0.0", default-features = false } +yellowstone-grpc-client = { path = "yellowstone-grpc-client", version = "2.0.0+solana.2.0.15.gamma" } +yellowstone-grpc-proto = { path = "yellowstone-grpc-proto", version = "2.0.0+solana.2.0.15.gamma", default-features = false } [workspace.lints.clippy] clone_on_ref_ptr = "deny" diff --git a/examples/rust/Cargo.toml b/examples/rust/Cargo.toml index 213d1aa..6543d55 100644 --- a/examples/rust/Cargo.toml +++ b/examples/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yellowstone-grpc-client-simple" -version = "2.0.0+solana.2.0.15" +version = "2.0.0+solana.2.0.15.gamma" authors = { workspace = true } edition = { workspace = true } homepage = { workspace = true } diff --git a/yellowstone-grpc-client/Cargo.toml b/yellowstone-grpc-client/Cargo.toml index c8470c6..73d8142 100644 --- a/yellowstone-grpc-client/Cargo.toml +++ b/yellowstone-grpc-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yellowstone-grpc-client" -version = "2.0.0+solana.2.0.15" +version = "2.0.0+solana.2.0.15.gamma" authors = { workspace = true } edition = { workspace = true } description = "Yellowstone gRPC Geyser Simple Client" diff --git a/yellowstone-grpc-geyser/Cargo.toml b/yellowstone-grpc-geyser/Cargo.toml index 2a837af..1a82099 100644 --- a/yellowstone-grpc-geyser/Cargo.toml +++ b/yellowstone-grpc-geyser/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yellowstone-grpc-geyser" -version = "2.0.0+solana.2.0.15" +version = "2.0.0+solana.2.0.15.gamma" authors = { workspace = true } edition = { workspace = true } description = "Yellowstone gRPC Geyser Plugin" diff --git a/yellowstone-grpc-geyser/src/filters.rs b/yellowstone-grpc-geyser/src/filters.rs index 61210e6..b49aef0 100644 --- a/yellowstone-grpc-geyser/src/filters.rs +++ b/yellowstone-grpc-geyser/src/filters.rs @@ -16,15 +16,20 @@ use { std::{ collections::{HashMap, HashSet}, str::FromStr, + time::SystemTime, }, - yellowstone_grpc_proto::prelude::{ - subscribe_request_filter_accounts_filter::Filter as AccountsFilterDataOneof, - subscribe_request_filter_accounts_filter_memcmp::Data as AccountsFilterMemcmpOneof, - subscribe_update::UpdateOneof, CommitmentLevel, SubscribeRequest, - SubscribeRequestAccountsDataSlice, SubscribeRequestFilterAccounts, - SubscribeRequestFilterAccountsFilter, SubscribeRequestFilterBlocks, - SubscribeRequestFilterBlocksMeta, SubscribeRequestFilterEntry, SubscribeRequestFilterSlots, - SubscribeRequestFilterTransactions, SubscribeUpdate, SubscribeUpdatePong, + yellowstone_grpc_proto::{ + prelude::{ + subscribe_request_filter_accounts_filter::Filter as AccountsFilterDataOneof, + subscribe_request_filter_accounts_filter_memcmp::Data as AccountsFilterMemcmpOneof, + subscribe_update::UpdateOneof, CommitmentLevel, SubscribeRequest, + SubscribeRequestAccountsDataSlice, SubscribeRequestFilterAccounts, + SubscribeRequestFilterAccountsFilter, SubscribeRequestFilterBlocks, + SubscribeRequestFilterBlocksMeta, SubscribeRequestFilterEntry, + SubscribeRequestFilterSlots, SubscribeRequestFilterTransactions, SubscribeUpdate, + SubscribeUpdatePong, + }, + prost_types::Timestamp, }, }; @@ -158,6 +163,7 @@ impl Filter { Some(SubscribeUpdate { filters, update_oneof: Some(message.to_proto(&self.accounts_data_slice)), + timestamp: Some(Timestamp::from(SystemTime::now())), }) } }), @@ -168,6 +174,7 @@ impl Filter { self.ping.map(|id| SubscribeUpdate { filters: vec![], update_oneof: Some(UpdateOneof::Pong(SubscribeUpdatePong { id })), + timestamp: Some(Timestamp::from(SystemTime::now())), }) } } diff --git a/yellowstone-grpc-geyser/src/grpc.rs b/yellowstone-grpc-geyser/src/grpc.rs index fd82eba..85d2599 100644 --- a/yellowstone-grpc-geyser/src/grpc.rs +++ b/yellowstone-grpc-geyser/src/grpc.rs @@ -24,6 +24,7 @@ use { atomic::{AtomicUsize, Ordering}, Arc, }, + time::SystemTime, }, tokio::{ fs, @@ -56,6 +57,7 @@ use { SubscribeUpdateSlot, SubscribeUpdateTransaction, SubscribeUpdateTransactionInfo, SubscribeUpdateTransactionStatus, TransactionError as SubscribeUpdateTransactionError, }, + prost_types::Timestamp, }, }; @@ -1350,6 +1352,7 @@ impl Geyser for GrpcService { let ping_msg = SubscribeUpdate { filters: vec![], update_oneof: Some(UpdateOneof::Ping(SubscribeUpdatePing {})), + timestamp: Some(Timestamp::from(SystemTime::now())), }; loop { diff --git a/yellowstone-grpc-proto/Cargo.toml b/yellowstone-grpc-proto/Cargo.toml index 10d79b0..7c2a249 100644 --- a/yellowstone-grpc-proto/Cargo.toml +++ b/yellowstone-grpc-proto/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yellowstone-grpc-proto" -version = "2.0.0+solana.2.0.15" +version = "2.0.0+solana.2.0.15.gamma" authors = { workspace = true } edition = { workspace = true } description = "Yellowstone gRPC Geyser Protobuf Definitions" @@ -13,6 +13,7 @@ publish = true [dependencies] bincode = { workspace = true } prost = { workspace = true } +prost-types = { workspace = true } solana-account-decoder = { workspace = true, optional = true } solana-sdk = { workspace = true, optional = true } solana-transaction-status = { workspace = true, optional = true } diff --git a/yellowstone-grpc-proto/proto/geyser.proto b/yellowstone-grpc-proto/proto/geyser.proto index 153b8f5..caa220d 100644 --- a/yellowstone-grpc-proto/proto/geyser.proto +++ b/yellowstone-grpc-proto/proto/geyser.proto @@ -1,5 +1,6 @@ syntax = "proto3"; +import "google/protobuf/timestamp.proto"; import public "solana-storage.proto"; option go_package = "github.com/rpcpool/yellowstone-grpc/examples/golang/proto"; @@ -104,6 +105,7 @@ message SubscribeUpdate { SubscribeUpdateBlockMeta block_meta = 7; SubscribeUpdateEntry entry = 8; } + google.protobuf.Timestamp timestamp = 11; } message SubscribeUpdateAccount { diff --git a/yellowstone-grpc-proto/src/lib.rs b/yellowstone-grpc-proto/src/lib.rs index 40868a2..0f1d631 100644 --- a/yellowstone-grpc-proto/src/lib.rs +++ b/yellowstone-grpc-proto/src/lib.rs @@ -21,7 +21,7 @@ pub mod prelude { pub use super::{geyser::*, solana::storage::confirmed_block::*}; } -pub use {prost, tonic}; +pub use {prost, prost_types, tonic}; #[cfg(feature = "convert")] pub mod convert_to {