Skip to content

Commit 33962d4

Browse files
authored
Merge pull request #70 from helius-labs/json-parsed
Fix: Preserve internal slot tracker in write() calls
2 parents 361710f + 6255ed9 commit 33962d4

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

javascript/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.

javascript/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "laserstream-napi"
3-
version = "0.2.6"
3+
version = "0.2.7"
44
edition = "2021"
55

66
[lib]

javascript/napi-src/stream.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const FORK_DEPTH_SAFETY_MARGIN: u64 = 31; // Max fork depth for processed commit
2222

2323
// SDK metadata constants
2424
const SDK_NAME: &str = "laserstream-javascript";
25-
const SDK_VERSION: &str = "0.2.6";
25+
const SDK_VERSION: &str = "0.2.7";
2626

2727
/// Custom interceptor that adds SDK metadata headers to all gRPC requests
2828
#[derive(Clone)]
@@ -478,6 +478,11 @@ impl StreamInner {
478478
current: &mut geyser::SubscribeRequest,
479479
modification: &geyser::SubscribeRequest,
480480
) {
481+
// Save the internal slot tracker before replacing slots
482+
let internal_tracker = current.slots.iter()
483+
.find(|(k, _)| k.starts_with("__internal_slot_tracker_"))
484+
.map(|(k, v)| (k.clone(), v.clone()));
485+
481486
// Replace all subscription types (Yellowstone gRPC replaces, not merges)
482487
current.accounts = modification.accounts.clone();
483488
current.slots = modification.slots.clone();
@@ -488,6 +493,11 @@ impl StreamInner {
488493
current.entry = modification.entry.clone();
489494
current.accounts_data_slice = modification.accounts_data_slice.clone();
490495

496+
// Restore the internal slot tracker if it existed
497+
if let Some((key, value)) = internal_tracker {
498+
current.slots.insert(key, value);
499+
}
500+
491501
// Update commitment if specified
492502
if modification.commitment.is_some() {
493503
current.commitment = modification.commitment;

javascript/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "helius-laserstream",
3-
"version": "0.2.6",
3+
"version": "0.2.7",
44
"description": "High-performance Laserstream gRPC client with automatic reconnection",
55
"main": "client.js",
66
"types": "client.d.ts",
@@ -83,12 +83,12 @@
8383
}
8484
},
8585
"optionalDependencies": {
86-
"helius-laserstream-darwin-arm64": "0.2.6",
87-
"helius-laserstream-darwin-x64": "0.2.6",
88-
"helius-laserstream-linux-arm64-gnu": "0.2.6",
89-
"helius-laserstream-linux-arm64-musl": "0.2.6",
90-
"helius-laserstream-linux-x64-gnu": "0.2.6",
91-
"helius-laserstream-linux-x64-musl": "0.2.6"
86+
"helius-laserstream-darwin-arm64": "0.2.7",
87+
"helius-laserstream-darwin-x64": "0.2.7",
88+
"helius-laserstream-linux-arm64-gnu": "0.2.7",
89+
"helius-laserstream-linux-arm64-musl": "0.2.7",
90+
"helius-laserstream-linux-x64-gnu": "0.2.7",
91+
"helius-laserstream-linux-x64-musl": "0.2.7"
9292
},
9393
"dependencies": {
9494
"@types/protobufjs": "^6.0.0",

0 commit comments

Comments
 (0)