Release solana-streamer-sdk 1.5.13

This commit is contained in:
0xfnzero
2026-06-09 18:57:08 +08:00
parent e263caa75d
commit 7131fb3aa1
6 changed files with 35 additions and 40 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "solana-streamer-sdk"
version = "1.5.12"
version = "1.5.13"
edition = "2021"
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
repository = "https://github.com/0xfnzero/solana-streamer"
@@ -21,7 +21,7 @@ sdk-perf-stats = ["sol-parser-sdk/perf-stats"]
sdk-ultra-perf = ["sol-parser-sdk/ultra-perf"]
[dependencies]
sol-parser-sdk = { version = "0.5.12", default-features = false }
sol-parser-sdk = { version = "0.5.13", default-features = false }
solana-sdk = "3.0.0"
solana-client = "3.1.12"
solana-transaction-status = "3.1.12"
+9 -5
View File
@@ -124,30 +124,34 @@ Add the dependency to your `Cargo.toml`:
```toml
# Add to your Cargo.toml
solana-streamer-sdk = { path = "./solana-streamer", version = "1.5.11" }
solana-streamer-sdk = { path = "./solana-streamer", version = "1.5.13" }
```
### Use crates.io
```toml
# Add to your Cargo.toml
solana-streamer-sdk = "1.5.11"
solana-streamer-sdk = "1.5.13"
```
Parser backend features:
```toml
# Default: sol-parser-sdk parse-borsh backend
solana-streamer-sdk = "1.5.11"
solana-streamer-sdk = "1.5.13"
# Zero-copy parser backend for latency-sensitive bots
solana-streamer-sdk = { version = "1.5.11", default-features = false, features = ["sdk-parse-zero-copy"] }
solana-streamer-sdk = { version = "1.5.13", default-features = false, features = ["sdk-parse-zero-copy"] }
```
If both `sdk-parse-borsh` and `sdk-parse-zero-copy` are enabled, `sol-parser-sdk 0.5.11+` uses the zero-copy backend.
If both `sdk-parse-borsh` and `sdk-parse-zero-copy` are enabled, `sol-parser-sdk 0.5.13+` uses the zero-copy backend.
## 🔄 Migration Guide
### Upgrading to v1.5.13
Version 1.5.13 uses `sol-parser-sdk 0.5.13` from crates.io. Pump.fun gRPC and ShredStream create/trade outputs now preserve real WSOL quote mints (`So11111111111111111111111111111111111111112`). The Solscan SOL sentinel (`So11111111111111111111111111111111111111111`) is used only when legacy data omits a quote mint.
### Upgrading to v1.5.11
Version 1.5.11 uses `sol-parser-sdk 0.5.11` from crates.io. PumpSwap `PumpSwapCreatePoolEvent` now carries `is_cashback_coin` when it is available from the `create_pool` instruction args, including ShredStream outer-instruction parsing. Log-only `CreatePoolEvent` payloads still default this field to `false` because the on-chain log event IDL does not carry it. `AccountPumpSwapPool` remains the authoritative account-state source for the pool flag.
+9 -5
View File
@@ -123,30 +123,34 @@ git clone https://github.com/0xfnzero/solana-streamer
```toml
# 添加到您的 Cargo.toml
solana-streamer-sdk = { path = "./solana-streamer", version = "1.5.11" }
solana-streamer-sdk = { path = "./solana-streamer", version = "1.5.13" }
```
### 使用 crates.io
```toml
# 添加到您的 Cargo.toml
solana-streamer-sdk = "1.5.11"
solana-streamer-sdk = "1.5.13"
```
解析后端 feature
```toml
# 默认:sol-parser-sdk parse-borsh 后端
solana-streamer-sdk = "1.5.11"
solana-streamer-sdk = "1.5.13"
# 面向低延迟 Bot 的 zero-copy 解析后端
solana-streamer-sdk = { version = "1.5.11", default-features = false, features = ["sdk-parse-zero-copy"] }
solana-streamer-sdk = { version = "1.5.13", default-features = false, features = ["sdk-parse-zero-copy"] }
```
如果同时启用 `sdk-parse-borsh``sdk-parse-zero-copy``sol-parser-sdk 0.5.11+` 会优先使用 zero-copy 后端。
如果同时启用 `sdk-parse-borsh``sdk-parse-zero-copy``sol-parser-sdk 0.5.13+` 会优先使用 zero-copy 后端。
## 🔄 迁移指南
### 升级到 v1.5.13
v1.5.13 使用 crates.io 上的 `sol-parser-sdk 0.5.13`。Pump.fun gRPC 和 ShredStream create/trade 输出现在会保留真实 WSOL quote mint`So11111111111111111111111111111111111111112`)。只有 legacy 数据缺失 quote mint 时,才使用 Solscan SOL sentinel`So11111111111111111111111111111111111111111`)。
### 升级到 v1.5.11
v1.5.11 使用 crates.io 上的 `sol-parser-sdk 0.5.11`。PumpSwap `PumpSwapCreatePoolEvent` 现在会在 `create_pool` instruction args 可用时携带 `is_cashback_coin`,包括 ShredStream 外层指令解析。log-only 的 `CreatePoolEvent` payload 因为链上 log event IDL 不包含该字段,仍会保持默认 `false``AccountPumpSwapPool` 仍是读取池子账户状态里该标记的权威来源。
@@ -6,16 +6,9 @@ use solana_sdk::{pubkey, pubkey::Pubkey};
const PUMPFUN_SOLSCAN_SOL_QUOTE_MINT: Pubkey =
pubkey!("So11111111111111111111111111111111111111111");
const PUMPFUN_WSOL_QUOTE_MINT: Pubkey = pubkey!("So11111111111111111111111111111111111111112");
#[inline]
fn normalize_pumpfun_quote_mint(quote_mint: Pubkey) -> Pubkey {
let quote_mint = normalize_sdk_pumpfun_quote_mint(quote_mint);
if quote_mint == PUMPFUN_WSOL_QUOTE_MINT {
PUMPFUN_SOLSCAN_SOL_QUOTE_MINT
} else {
quote_mint
}
normalize_sdk_pumpfun_quote_mint(quote_mint)
}
#[inline]
@@ -932,21 +925,20 @@ mod tests {
}
#[test]
fn pumpfun_merge_treats_wsol_quote_as_sol_sentinel() {
fn pumpfun_merge_preserves_wsol_quote_mint() {
let quote_mint = sol_parser_sdk::core::events::PUMPFUN_WSOL_QUOTE_MINT;
let mut instruction_event = DexEvent::PumpFunTradeEvent(PumpFunTradeEvent {
quote_mint: PUMPFUN_SOLSCAN_SOL_QUOTE_MINT,
..Default::default()
});
let cpi_log_event = DexEvent::PumpFunTradeEvent(PumpFunTradeEvent {
quote_mint: PUMPFUN_WSOL_QUOTE_MINT,
..Default::default()
});
let cpi_log_event =
DexEvent::PumpFunTradeEvent(PumpFunTradeEvent { quote_mint, ..Default::default() });
merge(&mut instruction_event, cpi_log_event);
match instruction_event {
DexEvent::PumpFunTradeEvent(t) => {
assert_eq!(t.quote_mint, PUMPFUN_SOLSCAN_SOL_QUOTE_MINT)
assert_eq!(t.quote_mint, quote_mint)
}
_ => panic!("expected PumpFunTradeEvent"),
}
+3
View File
@@ -151,6 +151,7 @@ mod tests {
let mint = Pubkey::new_unique();
let global = Pubkey::new_unique();
let event_authority = Pubkey::new_unique();
let quote_mint = sol_parser_sdk::core::events::PUMPFUN_WSOL_QUOTE_MINT;
let c = PbPumpCreateV2 {
metadata: EventMetadata {
signature: Signature::default(),
@@ -165,6 +166,7 @@ mod tests {
mint,
global,
event_authority,
quote_mint,
is_mayhem_mode: true,
is_cashback_enabled: true,
..Default::default()
@@ -177,6 +179,7 @@ mod tests {
assert_eq!(st.mint, mint);
assert_eq!(st.global, global);
assert_eq!(st.event_authority, event_authority);
assert_eq!(st.quote_mint, quote_mint);
assert_eq!(st.ix_name, "create_v2");
assert!(st.is_mayhem_mode);
assert!(st.is_cashback_enabled);
@@ -21,23 +21,14 @@ use crate::streaming::event_parser::protocols::pumpswap::events::{
use crate::streaming::event_parser::DexEvent;
use prost_types::Timestamp;
use sol_parser_sdk::core::events::normalize_pumpfun_quote_mint as normalize_sdk_pumpfun_quote_mint;
use solana_sdk::{pubkey, pubkey::Pubkey};
use solana_sdk::pubkey::Pubkey;
use super::adapt::adapt_pm;
use super::program_ids::{pump_program, pumpswap_program};
const PUMPFUN_SOLSCAN_SOL_QUOTE_MINT: Pubkey =
pubkey!("So11111111111111111111111111111111111111111");
const PUMPFUN_WSOL_QUOTE_MINT: Pubkey = pubkey!("So11111111111111111111111111111111111111112");
#[inline]
fn normalize_pumpfun_quote_mint(quote_mint: Pubkey) -> Pubkey {
let quote_mint = normalize_sdk_pumpfun_quote_mint(quote_mint);
if quote_mint == PUMPFUN_WSOL_QUOTE_MINT {
PUMPFUN_SOLSCAN_SOL_QUOTE_MINT
} else {
quote_mint
}
normalize_sdk_pumpfun_quote_mint(quote_mint)
}
pub(crate) fn pumpfun_create_token_from_parser(
@@ -863,11 +854,12 @@ mod tests {
}
#[test]
fn pumpfun_wsol_quote_mint_uses_solscan_sol_sentinel() {
fn pumpfun_wsol_quote_mint_is_preserved() {
let quote_mint = sol_parser_sdk::core::events::PUMPFUN_WSOL_QUOTE_MINT;
let ev = pumpfun_trade_from_parser_with_event_type(
sol_parser_sdk::core::events::PumpFunTradeEvent {
is_buy: true,
quote_mint: PUMPFUN_WSOL_QUOTE_MINT,
quote_mint,
..Default::default()
},
None,
@@ -877,7 +869,7 @@ mod tests {
match ev {
DexEvent::PumpFunTradeEvent(t) => {
assert_eq!(t.quote_mint.to_string(), "So11111111111111111111111111111111111111111");
assert_eq!(t.quote_mint, quote_mint);
}
_ => panic!("expected PumpFunTradeEvent"),
}