Skip to content

v5.0.0 — the udp feature without solana-ledger

Latest

Choose a tag to compare

@POPPIN-FUMI POPPIN-FUMI released this 13 Nov 22:47
de658bb

5.0.0 - 2026-11-13 — the udp feature without solana-ledger

Published 2026-11-13: crates.io solana-stream-sdk 5.0.0, from main de658bb by .github/workflows/release.yml with crates.io trusted publishing (run 43461974320). Rust only: no npm package was published. Migration: docs/migration-v5.md.

Rust SDK 5.0.0: the udp feature without solana-ledger (breaking)

  • The SDK decodes shreds itself: solana_stream_sdk::shred (behind udp) replaces solana-ledger in the UDP receiver. It decodes the Merkle shreds Agave 4.4.1 sends (chained, resigned or not; Agave 4.4.1 no longer accepts legacy or unchained shreds, and neither does the SDK), makes the checks Agave's sanitize makes in the same order with the same error messages (except TruncatedHeaders, where Agave reports its header deserializer's error, and InvalidErasureShardIndex, where Agave prints the headers), computes the Merkle root from a shred and its proof, checks the leader's signature, and deshreds. Each piece names the solana-ledger 4.4.1 function it follows.
  • udp no longer builds solana-ledger, and with it RocksDB, OpenSSL, native-tls, hyper-tls and bzip2 (libbz2-rs-sys, licence bzip2-1.0.6). It needs no [patch.crates-io] and no libclang. It resolves 419 crates instead of 648 (cargo tree -p solana-stream-sdk --features udp -e normal). It keeps solana-rpc-client, for block times only (the SDK fetches no leader schedule), whose reqwest uses rustls. scripts/check-udp-deps.sh (run in CI on cargo tree --target all, with a self-test in scripts/tests/) fails if the feature builds any of these, bindgen, solana-runtime, solana-storage-bigtable, agave-precompiles, or ed25519-dalek < 2.0.0 / curve25519-dalek < 4.1.3. CI also runs cargo test -p solana-stream-sdk --features udp on its own.
  • Breaking: deshred_shreds_to_entries, deshred_shreds_to_component, ShredReadyBatch::shreds, DecodedShred::shred and the receiver's batches use solana_stream_sdk::shred::Shred instead of solana_ledger::shred::Shred. The function names and what they do are unchanged. Shred keeps Agave's variants (ShredCode, ShredData) and the accessors the receiver and its clients use. Code written against solana_ledger::shred needs more than the import where it uses what differs: proof_size() returns u8, payload() returns the SDK's read-only shred::Payload, layout::get_shred takes &[u8] and layout::get_flags returns u8; Shred::id, into_payload, has_correct_proof_size, is_shred_duplicate, retransmitter_signature_offset, ShredFlags, ShredId and the layout functions that write or take packets (get_shred_id, get_shred_and_repair_nonce, get_common_header_bytes, get_shred_mut, set_retransmitter_signature, resign_shred, resign_packet) are absent. docs/migration-v5.md lists each with its replacement.
  • New API in solana_stream_sdk::shred: Shred::new_from_serialized_shred, sanitize, merkle_root, chained_merkle_root, retransmitter_signature, verify(&leader); deshred (Agave's Shredder::deshred); ShredError; wire (also layout): get_slot, get_index, get_fec_set_index, get_signature, get_merkle_root, … and verify_shred(packet, &leader), the check Agave's sigverify_shreds::verify_shred_cpu makes on a received packet.
  • Tests: tests/shred_differential.rs runs the SDK and solana-ledger 4.4.1 on the same bytes and requires the same answer (every field, every public reader, sanitize, the Merkle roots, the leader signature on the decoded shred and through Agave's verify_shred_cpu, deshred), on 14,912 shreds from Agave's Shredder, 36,580 corrupted copies, 88,600 header values at the limits sanitize checks, 2,100 coding shreds whose erasure batch ends at or near the slot limit, 6,848 shreds with every proof size, all 256 variant bytes, 18,336 deshred lists and 30,000 random inputs; and 1,024 shreds carrying a genuine signature of the same leader from another erasure batch (including the batch whose root they chain to) must be rejected by both. Keys and inputs are seeded, so the counts repeat. solana-ledger is a dev-dependency only (these tests, and the Shredder fixtures of the older UDP tests); the workspace keeps the rust-rocksdb [patch.crates-io] for it, and cargo test in this repository still needs libclang.
  • The UDP receiver does not check leader signatures (it did not in 4.x either), and run_shreds_udp has no hook for it. shred::wire::verify_shred does it, with the slot's leader from a leader schedule you trust, in a receive loop of your own (recv_raw, verify_shred, decode_udp_datagram, insert_shred); see the migration guide.

Moving from 4.x (only if you enable udp):

  1. solana-stream-sdk = { version = "5.0.0", features = ["udp"] }. Remove the librocksdb-sys and rocksdb lines under [patch.crates-io], and solana-ledger, unless something else in your workspace needs them (tests that make shreds with Shredder keep it as a dev-dependency, with the patch).
  2. Replace solana_ledger::shred::{Shred, layout} with solana_stream_sdk::shred::{Shred, layout}; shred::Error is shred::ShredError, Shredder::deshred(…) is shred::deshred(…). Checking a received packet's signature: shred::wire::verify_shred(&packet, &leader) with the leader of wire::get_slot(&packet). Then adapt the calls that differ, listed in docs/migration-v5.md.
  3. client/shreds-udp-rs needs no source change, and a crate like the temp-release/shreds-udp-rs starter needs only Cargo.toml changes: SDK 5.0.0, no solana-ledger, no [patch.crates-io].

High-throughput gRPC defaults (#133)

  • ShredstreamClient::connect opens 16 MiB HTTP/2 stream and connection receive windows, with adaptive windows off, instead of tonic's defaults: a small window caps a stream at about window / round-trip time.
  • New module transport, re-exported at the crate root: tune_grpc_endpoint (a tonic Endpoint) and tune_geyser_grpc_builder (a Yellowstone GeyserGrpcBuilder) apply the same windows, and builder calls after them override them; HIGH_THROUGHPUT_GRPC_WINDOW_BYTES (16 MiB). The re-exported GeyserGrpcClient keeps its upstream defaults. client/geyser-rs, client/geyser-ts, the geyser_reconnect example and the geyser-rs/geyser-ts starters open the same windows.

Other changes

  • package/solana-shreds-client (the source of the npm native client, which does not use udp) requires the SDK at 5.0.0 so that it keeps building against this repository's crate. The workspace optimizes solana-ed25519 and sha2 in its dev builds: the shred tests check hundreds of thousands of signatures, which take 5 ms each unoptimized.
  • shreds_udp::TransactionsBySlot names the map type (Arc<DashMap<u64, Vec<(String, DateTime<Utc>)>>>) inside the Option that ShredsUdpState::transactions_by_slot returns; no type changes.
  • Starters (temp-release/, which slv bot init copies from main) move to the published 4.0.0:
    • geyser-rs and geyser-ts are now the same code as client/geyser-rs and client/geyser-ts: the reconnecting subscription with Disconnected handling, redacted logs, the plaintext-token warning, and the faster TypeScript queue.
    • shreds-rs, shreds-ts and shreds-udp-rs move to SDK 4.0. shreds-udp-rs enables the udp feature and carries the rust-rocksdb [patch.crates-io] lines it needs.
    • The Rust starters declare rust-version = "1.98.1".
  • trade-app builds again. ultima-swap-pumpfun is pinned to dbbe5f6e (later commits add a required field to SellParams / BuyParams, so cargo build failed). It moves to SDK 4.0 and dotenvy, and keeps its own runner: it trades at processed commitment without de-duplication, and the 4.0 runner replays from the last confirmed slot after each reconnect, which would resend recent pool creations.
  • TypeScript starters are standalone pnpm projects, as users get them. Each has a pnpm-workspace.yaml that decides esbuild's install script: without one, pnpm 11 stops pnpm install with ERR_PNPM_IGNORED_BUILDS. They are no longer packages of the repository's workspace.
  • CI installs, type-checks, tests and builds the TypeScript starters on their own, and runs cargo check --all-targets on the four Rust starters against the published SDK.
  • Docs: client/shreds-rs's README moved from SDK 3.0.0 and Rust 1.96.1 to SDK 4.0 and Rust 1.98.1; the crate README from Rust 1.96.1 to 1.98.1, and its examples name SDK 5.0.0.