mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-23 22:08:05 +00:00
Release solana-streamer-sdk 1.5.11
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "solana-streamer-sdk"
|
name = "solana-streamer-sdk"
|
||||||
version = "1.5.10"
|
version = "1.5.11"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
|
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
|
||||||
repository = "https://github.com/0xfnzero/solana-streamer"
|
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"]
|
sdk-ultra-perf = ["sol-parser-sdk/ultra-perf"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
sol-parser-sdk = { version = "0.5.10", default-features = false }
|
sol-parser-sdk = { version = "0.5.11", default-features = false }
|
||||||
solana-sdk = "3.0.0"
|
solana-sdk = "3.0.0"
|
||||||
solana-client = "3.1.12"
|
solana-client = "3.1.12"
|
||||||
solana-transaction-status = "3.1.12"
|
solana-transaction-status = "3.1.12"
|
||||||
|
|||||||
@@ -124,30 +124,34 @@ Add the dependency to your `Cargo.toml`:
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# Add to your Cargo.toml
|
# Add to your Cargo.toml
|
||||||
solana-streamer-sdk = { path = "./solana-streamer", version = "1.5.10" }
|
solana-streamer-sdk = { path = "./solana-streamer", version = "1.5.11" }
|
||||||
```
|
```
|
||||||
|
|
||||||
### Use crates.io
|
### Use crates.io
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# Add to your Cargo.toml
|
# Add to your Cargo.toml
|
||||||
solana-streamer-sdk = "1.5.10"
|
solana-streamer-sdk = "1.5.11"
|
||||||
```
|
```
|
||||||
|
|
||||||
Parser backend features:
|
Parser backend features:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# Default: sol-parser-sdk parse-borsh backend
|
# Default: sol-parser-sdk parse-borsh backend
|
||||||
solana-streamer-sdk = "1.5.10"
|
solana-streamer-sdk = "1.5.11"
|
||||||
|
|
||||||
# Zero-copy parser backend for latency-sensitive bots
|
# Zero-copy parser backend for latency-sensitive bots
|
||||||
solana-streamer-sdk = { version = "1.5.10", default-features = false, features = ["sdk-parse-zero-copy"] }
|
solana-streamer-sdk = { version = "1.5.11", 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.10+` uses the zero-copy backend.
|
If both `sdk-parse-borsh` and `sdk-parse-zero-copy` are enabled, `sol-parser-sdk 0.5.11+` uses the zero-copy backend.
|
||||||
|
|
||||||
## 🔄 Migration Guide
|
## 🔄 Migration Guide
|
||||||
|
|
||||||
|
### 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.
|
||||||
|
|
||||||
### Upgrading to v1.5.10
|
### Upgrading to v1.5.10
|
||||||
|
|
||||||
Version 1.5.10 uses `sol-parser-sdk 0.5.10` from crates.io. PumpSwap `CreatePoolEvent` now matches the on-chain IDL: it exposes `is_mayhem_mode` but does not expose `is_cashback_coin`. To read the cashback flag, subscribe to `AccountPumpSwapPool` and use `PumpSwapPoolAccountEvent.pool.is_cashback_coin`. The PumpSwap CreatePool log payload length check now includes the final `is_mayhem_mode` byte.
|
Version 1.5.10 uses `sol-parser-sdk 0.5.10` from crates.io. PumpSwap `CreatePoolEvent` now matches the on-chain IDL: it exposes `is_mayhem_mode` but does not expose `is_cashback_coin`. To read the cashback flag, subscribe to `AccountPumpSwapPool` and use `PumpSwapPoolAccountEvent.pool.is_cashback_coin`. The PumpSwap CreatePool log payload length check now includes the final `is_mayhem_mode` byte.
|
||||||
@@ -428,9 +432,11 @@ let event_type_filter = Some(EventTypeFilter::include_only(vec![
|
|||||||
]));
|
]));
|
||||||
```
|
```
|
||||||
|
|
||||||
`PumpSwapCreatePool` follows the on-chain `CreatePoolEvent` IDL and includes
|
`PumpSwapCreatePool` includes `is_mayhem_mode`. For `is_cashback_coin`,
|
||||||
`is_mayhem_mode`, but it does not include `is_cashback_coin`. To read the
|
ShredStream/outer-instruction parsing reads the flag from the `create_pool`
|
||||||
cashback flag, subscribe to `AccountPumpSwapPool` and use
|
instruction args, while log-only `CreatePoolEvent` payloads keep the default
|
||||||
|
`false` because the log event IDL does not carry this field. The authoritative
|
||||||
|
account value is also available from
|
||||||
`PumpSwapPoolAccountEvent.pool.is_cashback_coin`.
|
`PumpSwapPoolAccountEvent.pool.is_cashback_coin`.
|
||||||
|
|
||||||
## Dynamic Subscription Management
|
## Dynamic Subscription Management
|
||||||
|
|||||||
+14
-9
@@ -123,30 +123,34 @@ git clone https://github.com/0xfnzero/solana-streamer
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# 添加到您的 Cargo.toml
|
# 添加到您的 Cargo.toml
|
||||||
solana-streamer-sdk = { path = "./solana-streamer", version = "1.5.10" }
|
solana-streamer-sdk = { path = "./solana-streamer", version = "1.5.11" }
|
||||||
```
|
```
|
||||||
|
|
||||||
### 使用 crates.io
|
### 使用 crates.io
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# 添加到您的 Cargo.toml
|
# 添加到您的 Cargo.toml
|
||||||
solana-streamer-sdk = "1.5.10"
|
solana-streamer-sdk = "1.5.11"
|
||||||
```
|
```
|
||||||
|
|
||||||
解析后端 feature:
|
解析后端 feature:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# 默认:sol-parser-sdk parse-borsh 后端
|
# 默认:sol-parser-sdk parse-borsh 后端
|
||||||
solana-streamer-sdk = "1.5.10"
|
solana-streamer-sdk = "1.5.11"
|
||||||
|
|
||||||
# 面向低延迟 Bot 的 zero-copy 解析后端
|
# 面向低延迟 Bot 的 zero-copy 解析后端
|
||||||
solana-streamer-sdk = { version = "1.5.10", default-features = false, features = ["sdk-parse-zero-copy"] }
|
solana-streamer-sdk = { version = "1.5.11", default-features = false, features = ["sdk-parse-zero-copy"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
如果同时启用 `sdk-parse-borsh` 和 `sdk-parse-zero-copy`,`sol-parser-sdk 0.5.10+` 会优先使用 zero-copy 后端。
|
如果同时启用 `sdk-parse-borsh` 和 `sdk-parse-zero-copy`,`sol-parser-sdk 0.5.11+` 会优先使用 zero-copy 后端。
|
||||||
|
|
||||||
## 🔄 迁移指南
|
## 🔄 迁移指南
|
||||||
|
|
||||||
|
### 升级到 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` 仍是读取池子账户状态里该标记的权威来源。
|
||||||
|
|
||||||
### 升级到 v1.5.10
|
### 升级到 v1.5.10
|
||||||
|
|
||||||
v1.5.10 使用 crates.io 上的 `sol-parser-sdk 0.5.10`。PumpSwap `CreatePoolEvent` 现在与链上 IDL 对齐:暴露 `is_mayhem_mode`,但不暴露 `is_cashback_coin`。如果需要 cashback 标记,请订阅 `AccountPumpSwapPool`,并读取 `PumpSwapPoolAccountEvent.pool.is_cashback_coin`。PumpSwap CreatePool log payload 长度检查现在包含最后的 `is_mayhem_mode` 字节。
|
v1.5.10 使用 crates.io 上的 `sol-parser-sdk 0.5.10`。PumpSwap `CreatePoolEvent` 现在与链上 IDL 对齐:暴露 `is_mayhem_mode`,但不暴露 `is_cashback_coin`。如果需要 cashback 标记,请订阅 `AccountPumpSwapPool`,并读取 `PumpSwapPoolAccountEvent.pool.is_cashback_coin`。PumpSwap CreatePool log payload 长度检查现在包含最后的 `is_mayhem_mode` 字节。
|
||||||
@@ -427,10 +431,11 @@ let event_type_filter = Some(EventTypeFilter::include_only(vec![
|
|||||||
]));
|
]));
|
||||||
```
|
```
|
||||||
|
|
||||||
`PumpSwapCreatePool` 对齐链上 `CreatePoolEvent` IDL,包含
|
`PumpSwapCreatePool` 包含 `is_mayhem_mode`。对于 `is_cashback_coin`,
|
||||||
`is_mayhem_mode`,但不包含 `is_cashback_coin`。如果需要 cashback 标记,
|
ShredStream/外层指令解析会从 `create_pool` instruction args 读取;
|
||||||
请订阅 `AccountPumpSwapPool`,并读取
|
log-only 的 `CreatePoolEvent` payload 因为 IDL 不包含该字段,会保持默认
|
||||||
`PumpSwapPoolAccountEvent.pool.is_cashback_coin`。
|
`false`。账户里的权威值也可通过
|
||||||
|
`PumpSwapPoolAccountEvent.pool.is_cashback_coin` 读取。
|
||||||
|
|
||||||
## 动态订阅管理
|
## 动态订阅管理
|
||||||
|
|
||||||
|
|||||||
@@ -426,6 +426,7 @@ pub fn merge(instruction_event: &mut DexEvent, cpi_log_event: DexEvent) {
|
|||||||
e.user_quote_token_account = cpie.user_quote_token_account;
|
e.user_quote_token_account = cpie.user_quote_token_account;
|
||||||
e.coin_creator = cpie.coin_creator;
|
e.coin_creator = cpie.coin_creator;
|
||||||
e.is_mayhem_mode = cpie.is_mayhem_mode;
|
e.is_mayhem_mode = cpie.is_mayhem_mode;
|
||||||
|
e.is_cashback_coin |= cpie.is_cashback_coin;
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -163,6 +163,9 @@ pub struct PumpSwapCreatePoolEvent {
|
|||||||
pub coin_creator: Pubkey,
|
pub coin_creator: Pubkey,
|
||||||
pub is_mayhem_mode: bool,
|
pub is_mayhem_mode: bool,
|
||||||
#[borsh(skip)]
|
#[borsh(skip)]
|
||||||
|
#[serde(default)]
|
||||||
|
pub is_cashback_coin: bool,
|
||||||
|
#[borsh(skip)]
|
||||||
pub user_pool_token_account: Pubkey,
|
pub user_pool_token_account: Pubkey,
|
||||||
#[borsh(skip)]
|
#[borsh(skip)]
|
||||||
pub pool_base_token_account: Pubkey,
|
pub pool_base_token_account: Pubkey,
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ mod tests {
|
|||||||
base_mint: Pubkey::new_unique(),
|
base_mint: Pubkey::new_unique(),
|
||||||
quote_mint: Pubkey::new_unique(),
|
quote_mint: Pubkey::new_unique(),
|
||||||
is_mayhem_mode: true,
|
is_mayhem_mode: true,
|
||||||
|
is_cashback_coin: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -226,6 +227,7 @@ mod tests {
|
|||||||
DexEvent::PumpSwapCreatePoolEvent(st) => {
|
DexEvent::PumpSwapCreatePoolEvent(st) => {
|
||||||
assert_eq!(st.metadata.event_type, EventType::PumpSwapCreatePool);
|
assert_eq!(st.metadata.event_type, EventType::PumpSwapCreatePool);
|
||||||
assert!(st.is_mayhem_mode);
|
assert!(st.is_mayhem_mode);
|
||||||
|
assert!(st.is_cashback_coin);
|
||||||
}
|
}
|
||||||
_ => panic!("expected PumpSwapCreatePoolEvent"),
|
_ => panic!("expected PumpSwapCreatePoolEvent"),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -613,6 +613,7 @@ pub(crate) fn pumpswap_create_pool_from_parser(
|
|||||||
user_quote_token_account: c.user_quote_token_account,
|
user_quote_token_account: c.user_quote_token_account,
|
||||||
coin_creator: c.coin_creator,
|
coin_creator: c.coin_creator,
|
||||||
is_mayhem_mode: c.is_mayhem_mode,
|
is_mayhem_mode: c.is_mayhem_mode,
|
||||||
|
is_cashback_coin: c.is_cashback_coin,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user