tools: fix panic on Ping/Pong messages in google pubsub (#261)

This commit is contained in:
Kirill Fomichev 2023-12-08 14:40:28 -05:00 committed by GitHub
parent 96477484b7
commit 159b12b29e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 8 deletions

View File

@ -16,6 +16,14 @@ The minor version will be incremented upon a breaking change and the patch versi
### Breaking
## 2023-12-08
- yellowstone-grpc-tools-1.0.0-rc.9+solana.1.17.6
### Fixes
- tools: fix panic on Ping/Pong messages in google pubsub ([#261](https://github.com/rpcpool/yellowstone-grpc/pull/261))
## 2023-12-06
- yellowstone-grpc-tools-1.0.0-rc.8+solana.1.17.6

2
Cargo.lock generated
View File

@ -5041,7 +5041,7 @@ dependencies = [
[[package]]
name = "yellowstone-grpc-tools"
version = "1.0.0-rc.8+solana.1.17.6"
version = "1.0.0-rc.9+solana.1.17.6"
dependencies = [
"anyhow",
"async-trait",

View File

@ -5,7 +5,7 @@ members = [
"yellowstone-grpc-client", # 1.12.0+solana.1.17.6
"yellowstone-grpc-geyser", # 1.11.1+solana.1.17.6
"yellowstone-grpc-proto", # 1.11.0+solana.1.17.6
"yellowstone-grpc-tools", # 1.0.0-rc.8+solana.1.17.6
"yellowstone-grpc-tools", # 1.0.0-rc.9+solana.1.17.6
]
[workspace.package]

View File

@ -1,6 +1,6 @@
[package]
name = "yellowstone-grpc-tools"
version = "1.0.0-rc.8+solana.1.17.6"
version = "1.0.0-rc.9+solana.1.17.6"
authors = { workspace = true }
edition = { workspace = true }
description = "Yellowstone gRPC Tools"

View File

@ -147,17 +147,17 @@ impl ArgsAction {
None => break 'outer,
};
let payload = message.encode_to_vec();
let message = match &message.update_oneof {
Some(value) => value,
match &message.update_oneof {
Some(UpdateOneof::Ping(_)) => continue,
Some(UpdateOneof::Pong(_)) => continue,
Some(value) => prom_kind.push(GprcMessageKind::from(value)),
None => unreachable!("Expect valid message"),
};
messages.push(PubsubMessage {
data: payload,
data: message.encode_to_vec(),
..Default::default()
});
prom_kind.push(GprcMessageKind::from(message));
}
if messages.is_empty() {
continue;