Skip to content

Commit 9db04a9

Browse files
authored
geyser: runtime error on invalid commitment (#528)
1 parent 924ee5a commit 9db04a9

File tree

10 files changed

+40
-17
lines changed

10 files changed

+40
-17
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,15 @@ jobs:
7676
- name: cargo tree
7777
run: |
7878
cargo tree
79+
git diff Cargo.lock
7980
git checkout Cargo.lock
8081
cargo tree --frozen
8182
8283
- name: cargo tree wasm
8384
run: |
8485
cd yellowstone-grpc-client-nodejs/solana-encoding-wasm
8586
cargo tree
87+
git diff Cargo.lock
8688
git checkout Cargo.lock
8789
cargo tree --frozen
8890

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ The minor version will be incremented upon a breaking change and the patch versi
1818

1919
## 2025-02-05
2020

21+
- yellowstone-grpc-client-simple-4.4.1
22+
- yellowstone-grpc-client-4.2.1
23+
- yellowstone-grpc-geyser-4.3.1
24+
- yellowstone-grpc-proto-4.2.1
25+
26+
### Fixes
27+
28+
- geyser: runtime error on invalid commitment ([#528](https://github.com/rpcpool/yellowstone-grpc/pull/528))
29+
30+
## 2025-02-05
31+
2132
- @triton-one/yellowstone-grpc@2.1.0
2233
- yellowstone-grpc-client-simple-4.4.0
2334
- yellowstone-grpc-client-4.2.0

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[workspace]
22
resolver = "2"
33
members = [
4-
"examples/rust", # 4.4.0
5-
"yellowstone-grpc-client", # 4.2.0
6-
"yellowstone-grpc-geyser", # 4.3.0
7-
"yellowstone-grpc-proto", # 4.2.0
4+
"examples/rust", # 4.4.1
5+
"yellowstone-grpc-client", # 4.2.1
6+
"yellowstone-grpc-geyser", # 4.3.1
7+
"yellowstone-grpc-proto", # 4.2.1
88
]
99
exclude = [
1010
"yellowstone-grpc-client-nodejs/solana-encoding-wasm", # 3.0.0
@@ -69,8 +69,8 @@ tonic = "0.12.1"
6969
tonic-build = "0.12.1"
7070
tonic-health = "0.12.1"
7171
vergen = "9.0.0"
72-
yellowstone-grpc-client = { path = "yellowstone-grpc-client", version = "4.2.0" }
73-
yellowstone-grpc-proto = { path = "yellowstone-grpc-proto", version = "4.2.0", default-features = false }
72+
yellowstone-grpc-client = { path = "yellowstone-grpc-client", version = "4.2.1" }
73+
yellowstone-grpc-proto = { path = "yellowstone-grpc-proto", version = "4.2.1", default-features = false }
7474

7575
[workspace.lints.clippy]
7676
clone_on_ref_ptr = "deny"

examples/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yellowstone-grpc-client-simple"
3-
version = "4.4.0"
3+
version = "4.4.1"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
homepage = { workspace = true }

yellowstone-grpc-client-nodejs/solana-encoding-wasm/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

yellowstone-grpc-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yellowstone-grpc-client"
3-
version = "4.2.0"
3+
version = "4.2.1"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
description = "Yellowstone gRPC Geyser Simple Client"

yellowstone-grpc-geyser/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yellowstone-grpc-geyser"
3-
version = "4.3.0"
3+
version = "4.3.1"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
description = "Yellowstone gRPC Geyser Plugin"

yellowstone-grpc-proto/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yellowstone-grpc-proto"
3-
version = "4.2.0"
3+
version = "4.2.1"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
description = "Yellowstone gRPC Geyser Protobuf Definitions"

yellowstone-grpc-proto/src/plugin/filter/filter.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,19 @@ impl Filter {
170170

171171
fn decode_commitment(commitment: Option<i32>) -> FilterResult<CommitmentLevel> {
172172
let commitment = commitment.unwrap_or(CommitmentLevelProto::Processed as i32);
173-
CommitmentLevelProto::try_from(commitment)
173+
let commitment = CommitmentLevelProto::try_from(commitment)
174174
.map(Into::into)
175-
.map_err(|_error| FilterError::InvalidCommitment { commitment })
175+
.map_err(|_error| FilterError::InvalidCommitment { commitment })?;
176+
if !matches!(
177+
commitment,
178+
CommitmentLevel::Processed | CommitmentLevel::Confirmed | CommitmentLevel::Finalized
179+
) {
180+
Err(FilterError::InvalidCommitment {
181+
commitment: commitment as i32,
182+
})
183+
} else {
184+
Ok(commitment)
185+
}
176186
}
177187

178188
fn decode_pubkeys<'a>(

0 commit comments

Comments
 (0)