Skip to content

Commit 024220d

Browse files
committed
add
1 parent d8b4481 commit 024220d

9 files changed

Lines changed: 6000 additions & 1099 deletions

File tree

Cargo.lock

Lines changed: 42 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = ["examples", "jito_protos", "proxy"]
33
resolver = "2"
44

55
[workspace.package]
6-
version = "0.2.13"
6+
version = "0.2.14"
77
description = "Fast path to receive shreds from Jito, forwarding to local consumers. See https://docs.jito.wtf/lowlatencytxnfeed/ for details."
88
authors = ["Jito Team <team@jito.wtf>"]
99
homepage = "https://jito.wtf/"
@@ -13,6 +13,7 @@ edition = "2021"
1313
ahash = "0.8"
1414
arc-swap = "1.6"
1515
bincode = "1.3.3"
16+
bitvec = "1"
1617
borsh = "1.5.3"
1718
clap = { version = "4", features = ["derive", "env"] }
1819
crossbeam-channel = "0.5.8"

examples/deshred.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use bincode::Options;
12
use jito_protos::shredstream::{
23
shredstream_proxy_client::ShredstreamProxyClient, SubscribeEntriesRequest,
34
};
@@ -12,16 +13,19 @@ async fn main() -> Result<(), std::io::Error> {
1213
.await
1314
.unwrap()
1415
.into_inner();
16+
let bincode_opts = bincode::DefaultOptions::new().with_fixint_encoding();
1517

1618
while let Some(slot_entry) = stream.message().await.unwrap() {
17-
let entries =
18-
match bincode::deserialize::<Vec<solana_entry::entry::Entry>>(&slot_entry.entries) {
19-
Ok(e) => e,
20-
Err(e) => {
21-
println!("Deserialization failed with err: {e}");
22-
continue;
23-
}
24-
};
19+
let entries = match bincode_opts
20+
.allow_trailing_bytes()
21+
.deserialize::<Vec<solana_entry::entry::Entry>>(&slot_entry.entries)
22+
{
23+
Ok(e) => e,
24+
Err(e) => {
25+
println!("Deserialization failed with err: {e}");
26+
continue;
27+
}
28+
};
2529
println!(
2630
"slot {}, entries: {}, transactions: {}",
2731
slot_entry.slot,

proxy/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ edition = { workspace = true }
1010
ahash = { workspace = true }
1111
arc-swap = { workspace = true }
1212
bincode = { workspace = true }
13+
bitvec = { workspace = true }
1314
borsh = { workspace = true }
1415
clap = { workspace = true }
1516
crossbeam-channel = { workspace = true }

0 commit comments

Comments
 (0)