From 9e0775068db215bb5e3488d9aefa1caf2c9cc110 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Mon, 29 May 2023 16:46:31 -0400 Subject: [PATCH] geyser: change default commitment to processed (#137) --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- examples/rust/src/bin/client.rs | 2 +- yellowstone-grpc-geyser/Cargo.toml | 2 +- yellowstone-grpc-geyser/src/filters.rs | 2 +- yellowstone-grpc-geyser/src/grpc.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 499b73b..7243099 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -149,9 +149,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.62" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1485d4d2cc45e7b201ee3767015c96faa5904387c9d87c6efdd0fb511f12d305" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" [[package]] name = "ark-bn254" @@ -4290,7 +4290,7 @@ dependencies = [ [[package]] name = "yellowstone-grpc-geyser" -version = "0.7.0+solana.1.15.2" +version = "0.8.0+solana.1.15.2" dependencies = [ "anyhow", "base64 0.21.0", diff --git a/Cargo.toml b/Cargo.toml index 6861ea9..c6eb493 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ members = [ "examples/rust", # 1.2.0+solana.1.15.2 "yellowstone-grpc-client", # 1.2.0+solana.1.15.2 - "yellowstone-grpc-geyser", # 0.7.0+solana.1.15.2 + "yellowstone-grpc-geyser", # 0.8.0+solana.1.15.2 "yellowstone-grpc-proto", # 1.2.0+solana.1.15.2 ] diff --git a/examples/rust/src/bin/client.rs b/examples/rust/src/bin/client.rs index ff101a6..1736d36 100644 --- a/examples/rust/src/bin/client.rs +++ b/examples/rust/src/bin/client.rs @@ -52,9 +52,9 @@ impl Args { #[derive(Debug, Clone, Copy, Default, ValueEnum)] enum ArgsCommitment { + #[default] Processed, Confirmed, - #[default] Finalized, } diff --git a/yellowstone-grpc-geyser/Cargo.toml b/yellowstone-grpc-geyser/Cargo.toml index 1aa3b29..145cd98 100644 --- a/yellowstone-grpc-geyser/Cargo.toml +++ b/yellowstone-grpc-geyser/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yellowstone-grpc-geyser" -version = "0.7.0+solana.1.15.2" +version = "0.8.0+solana.1.15.2" authors = ["Triton One"] edition = "2021" description = "Yellowstone gRPC Geyser Plugin" diff --git a/yellowstone-grpc-geyser/src/filters.rs b/yellowstone-grpc-geyser/src/filters.rs index d886fb8..fc84d0f 100644 --- a/yellowstone-grpc-geyser/src/filters.rs +++ b/yellowstone-grpc-geyser/src/filters.rs @@ -49,7 +49,7 @@ impl Filter { } fn decode_commitment(commitment: Option) -> anyhow::Result { - let commitment = commitment.unwrap_or(CommitmentLevel::Finalized as i32); + let commitment = commitment.unwrap_or(CommitmentLevel::Processed as i32); CommitmentLevel::from_i32(commitment) .ok_or_else(|| anyhow::anyhow!("failed to create CommitmentLevel from {commitment:?}")) } diff --git a/yellowstone-grpc-geyser/src/grpc.rs b/yellowstone-grpc-geyser/src/grpc.rs index ddacbd5..cde2a85 100644 --- a/yellowstone-grpc-geyser/src/grpc.rs +++ b/yellowstone-grpc-geyser/src/grpc.rs @@ -400,7 +400,7 @@ impl BlockMetaStorage { } fn parse_commitment(commitment: Option) -> Result { - let commitment = commitment.unwrap_or(CommitmentLevel::Finalized as i32); + let commitment = commitment.unwrap_or(CommitmentLevel::Processed as i32); CommitmentLevel::from_i32(commitment).ok_or_else(|| { let msg = format!("failed to create CommitmentLevel from {commitment:?}"); Status::unknown(msg)