Skip to content

Commit

Permalink
proto: add timestamp field to SubscribeUpdate message
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid committed Nov 15, 2024
1 parent 549e20e commit dad81b0
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
- 'v1.17'
- 'v1.18'
- 'v2.0'
- 'v1.17-gamma'
- 'v1.18-gamma'
- 'v2.0-gamma'
workflow_dispatch:

env:
Expand Down
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
21 changes: 11 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion yellowstone-grpc-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion yellowstone-grpc-geyser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
23 changes: 15 additions & 8 deletions yellowstone-grpc-geyser/src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};

Expand Down Expand Up @@ -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())),
})
}
}),
Expand All @@ -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())),
})
}
}
Expand Down
3 changes: 3 additions & 0 deletions yellowstone-grpc-geyser/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use {
atomic::{AtomicUsize, Ordering},
Arc,
},
time::SystemTime,
},
tokio::{
fs,
Expand Down Expand Up @@ -56,6 +57,7 @@ use {
SubscribeUpdateSlot, SubscribeUpdateTransaction, SubscribeUpdateTransactionInfo,
SubscribeUpdateTransactionStatus, TransactionError as SubscribeUpdateTransactionError,
},
prost_types::Timestamp,
},
};

Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion yellowstone-grpc-proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 }
Expand Down
2 changes: 2 additions & 0 deletions yellowstone-grpc-proto/proto/geyser.proto
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -104,6 +105,7 @@ message SubscribeUpdate {
SubscribeUpdateBlockMeta block_meta = 7;
SubscribeUpdateEntry entry = 8;
}
google.protobuf.Timestamp timestamp = 11;
}

message SubscribeUpdateAccount {
Expand Down
2 changes: 1 addition & 1 deletion yellowstone-grpc-proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit dad81b0

Please sign in to comment.