Skip to content

Commit

Permalink
geyser: runtime error on invalid commitment (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid authored Feb 5, 2025
1 parent 924ee5a commit 9db04a9
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,15 @@ jobs:
- name: cargo tree
run: |
cargo tree
git diff Cargo.lock
git checkout Cargo.lock
cargo tree --frozen
- name: cargo tree wasm
run: |
cd yellowstone-grpc-client-nodejs/solana-encoding-wasm
cargo tree
git diff Cargo.lock
git checkout Cargo.lock
cargo tree --frozen
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ The minor version will be incremented upon a breaking change and the patch versi

## 2025-02-05

- yellowstone-grpc-client-simple-4.4.1
- yellowstone-grpc-client-4.2.1
- yellowstone-grpc-geyser-4.3.1
- yellowstone-grpc-proto-4.2.1

### Fixes

- geyser: runtime error on invalid commitment ([#528](https://github.com/rpcpool/yellowstone-grpc/pull/528))

## 2025-02-05

- @triton-one/yellowstone-grpc@2.1.0
- yellowstone-grpc-client-simple-4.4.0
- yellowstone-grpc-client-4.2.0
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

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

12 changes: 6 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", # 4.4.0
"yellowstone-grpc-client", # 4.2.0
"yellowstone-grpc-geyser", # 4.3.0
"yellowstone-grpc-proto", # 4.2.0
"examples/rust", # 4.4.1
"yellowstone-grpc-client", # 4.2.1
"yellowstone-grpc-geyser", # 4.3.1
"yellowstone-grpc-proto", # 4.2.1
]
exclude = [
"yellowstone-grpc-client-nodejs/solana-encoding-wasm", # 3.0.0
Expand Down Expand Up @@ -69,8 +69,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 = "4.2.0" }
yellowstone-grpc-proto = { path = "yellowstone-grpc-proto", version = "4.2.0", default-features = false }
yellowstone-grpc-client = { path = "yellowstone-grpc-client", version = "4.2.1" }
yellowstone-grpc-proto = { path = "yellowstone-grpc-proto", version = "4.2.1", 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 = "4.4.0"
version = "4.4.1"
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
Expand Down

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

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 = "4.2.0"
version = "4.2.1"
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 = "4.3.0"
version = "4.3.1"
authors = { workspace = true }
edition = { workspace = true }
description = "Yellowstone gRPC Geyser Plugin"
Expand Down
2 changes: 1 addition & 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 = "4.2.0"
version = "4.2.1"
authors = { workspace = true }
edition = { workspace = true }
description = "Yellowstone gRPC Geyser Protobuf Definitions"
Expand Down
14 changes: 12 additions & 2 deletions yellowstone-grpc-proto/src/plugin/filter/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,19 @@ impl Filter {

fn decode_commitment(commitment: Option<i32>) -> FilterResult<CommitmentLevel> {
let commitment = commitment.unwrap_or(CommitmentLevelProto::Processed as i32);
CommitmentLevelProto::try_from(commitment)
let commitment = CommitmentLevelProto::try_from(commitment)
.map(Into::into)
.map_err(|_error| FilterError::InvalidCommitment { commitment })
.map_err(|_error| FilterError::InvalidCommitment { commitment })?;
if !matches!(
commitment,
CommitmentLevel::Processed | CommitmentLevel::Confirmed | CommitmentLevel::Finalized
) {
Err(FilterError::InvalidCommitment {
commitment: commitment as i32,
})
} else {
Ok(commitment)
}
}

fn decode_pubkeys<'a>(
Expand Down

0 comments on commit 9db04a9

Please sign in to comment.