Solana Stream SDK 5.2.1 supports Agave v4.5 with a choice of UDP recovery modes

ELSOUL LABO B.V. and Validators DAO have released Solana Stream SDK 5.2.1 for Rust on crates.io. Version 5.1.0 introduced Agave v4.5 compatibility and recovery of missing UDP shreds. Version 5.2.0 lets applications choose whether to process only the data shreds they receive or use coding shreds to recover missing data. A receiver racing other feeds can prioritize its next observation, while a receiver collecting transaction history can prioritize coverage. Rust SDK 5.2.1 on crates.io
The 5.2.1 maintenance release updates the Rust dependencies, including the stable Agave crates at 4.4.2. It retains the receiver modes and default introduced in 5.2.0. Upgrading to 5.2.1 brings in fixes to dependencies used for HTTP/2 transport, TLS and Protocol Buffers decoding.
The native Shreds client 2.0.1 is available on npm. The TypeScript SDK 4.1.0 is being prepared for npm. These builds shorten the path from a Shreds gRPC message received in Rust to its JavaScript callback, while preserving the existing JSON format. The Node.js measurements below are from release candidates. The UDP recovery results are for the Rust release.
Compatibility during the Agave v4.5 rollout
Applications can configure shred validation to enforce rules such as SIMD-0504's FEC-set consistency checks from the slot at which they take effect on the relevant cluster. This also lets a receiver replay historical traffic with the rules in effect for each slot. Validation settings and feature activation
Earlier versions already decoded Transaction v1. The 5.1.0 compatibility tests covered the boundary for the number of accounts a transaction uses. In Agave v4.5.0-rc.1 simulations, signed v1 transactions using 65 and 96 accounts succeeded when the SIMD-0596 feature gate was active. A transaction with 97 accounts was rejected even with the gate active. The gate was inactive on Mainnet when checked on December 2.
A standard transaction subscription to Yellowstone 18.0.0-rc5 running with Agave v4.5.0-rc.1 also received signed transactions using 64, 65 and 96 accounts. Applications can read their contents through the SDK. When submitting a transaction, use the execution rules active on the destination cluster. Compatibility results by version
Choosing a UDP recovery mode in Rust SDK 5.2.1
The UDP receiver defaults to
recover. No setting is needed, and applications upgrading from 5.1.0 keep this behavior. The receiver delivers a transaction as soon as the necessary data shreds arrive. If some are missing, it can use enough compatible coding shreds to fill the gap. This mode suits a consumer that wants to capture as many transactions as possible from this feed.For example, an application may use Shreds for an early signal and reconcile missed transactions later using a separate feed such as Yellowstone gRPC. In that design,
data-only lets the receiver validate and assemble the data shreds it receives and decode transactions without performing erasure recovery. A later packet does not have to wait behind a repair. If a necessary data shred never arrives, this feed can miss the transaction. The application handles reconciliation. To select this mode, set the following environment variable.bash
export SHREDS_UDP_RECOVERY_MODE=data-onlyexport SHREDS_UDP_RECOVERY_MODE=data-onlyFull FEC verification (
require_code_match) requires coding shreds and is available with recover.The two modes were compared in the same optimized build before the 5.2.0 release. In a loopback test where the preceding packet met the repair threshold, p99 time from sending the following healthy transaction’s final packet to decoding it was 17.4 µs with
data-only and 495.3 µs with recover. Both modes detected that transaction in all 2,048 trials. To evaluate first observations, compare detection timestamps for the same transactions across the feeds your application uses. Test resultsDetecting the next healthy transaction

The historical replay below compares 5.0.0 with 5.1.0, the version that introduced recovery. Solana distributes blocks in small pieces called shreds. A fixed forward error correction (FEC) set contains 32 data shreds and 32 coding shreds. The coding shreds supply the information needed to reconstruct missing data. The previous SDK recorded coding shreds but could miss a transaction if some of the data needed to decode it never arrived.
The new receiver takes two paths. In its default mode it delivers a component as soon as consecutive data shreds reach its completion boundary. If data is missing, any combination of at least 32 distinct compatible data and coding shreds from the same set enables Reed–Solomon recovery. Before using recovered data, the receiver checks headers, padding, erasure consistency, the Merkle root that identifies the committed set, and the supplied Merkle proofs.
Transaction recovery after shred loss

The comparison replayed the same signed slot containing two FEC sets. For each set, the test removed four data shreds, reversed the remaining data shreds, added a duplicate and supplied coding shreds. Across 128 replays, the previous version detected the transaction zero times and the new version detected it 128 times. On the ordered trace, both versions detected it in every replay. Recovery consumes additional CPU time and memory. In this experiment that work retrieved a transaction that the previous receiver missed on the same input.
Applications that require finality should check the required commitment downstream. To authenticate a shred, verify its signature against the trusted public key of the leader for that slot. FEC implementation and verification
Fewer conversions before the JavaScript callback, reaching 23,975 messages per second on one host
The native Shreds gRPC client passes a slot number and an array of bytes from Rust to a JavaScript callback. Previously, it constructed an intermediate JSON value for every byte, collected those values into an array, and serialized that array to a string. The candidate writes the same JSON string directly from a borrowed slice of the received bytes. For one 8 KiB message, Rust allocator calls, including reallocations, fell from 17 to nine.
Shreds delivery to Node.js

A server on the same Linux x64 host sent 8 KiB messages, with at most 32 outstanding. The test measured time to callback entry. The old and new release builds ran three times each in alternating order. All 8,192 messages in each run arrived in order with the expected contents.
| Same-host measurement | Before | After |
|---|---|---|
| Messages received per second | 6,965 | 23,975 |
| Median time to callback | 2.383 ms | 0.688 ms |
| p99 time to callback | 4.659 ms | 1.513 ms |
| Process CPU time per 8,192 messages | 1,356 ms | 523 ms |
The p99 is the time within which 99% of messages reached the callback. A transaction monitor that filters messages on receipt can start evaluating them sooner. The measured interval starts at the same-host server write and ends at callback entry. Remote network transit and work performed inside the callback, such as a database write, have their own costs. Peak process memory rose by about 1 MiB in this test. Measurement conditions and results
Choosing a package and starter
| Environment | Version | Availability | When to use it |
|---|---|---|---|
| Rust | solana-stream-sdk 5.2.1 | Published on crates.io | Receive and recover shreds with the udp feature, or detect transactions for watched programs. |
| TypeScript / Node.js | @validators-dao/solana-stream-sdk 4.1.0 | Being prepared for npm | Subscribe to transactions and accounts through Yellowstone, or build applications using Shreds gRPC. |
| Native Shreds receiver for Node.js | @validators-dao/solana-shreds-client 2.0.1 | Published on npm | The native receiver also used by the TypeScript SDK. Tested on Linux and macOS, each on x64 and ARM64. |
bash
cargo add [email protected] --features udpcargo add [email protected] --features udpTypeScript applications that perform asynchronous writes may also benefit from the updated Geyser starter. It waits for the Promise returned by each handler and processes accepted updates and disconnect events in arrival order. In a slow-handler test, the previous starter started 4,096 handlers concurrently. The new starter ran one and queued 128, as configured. It dropped the remaining 3,967 updates. If delivery consistently outpaces processing, narrow the subscription filters and choose queue capacity and replay behavior according to how much loss the application can tolerate. Geyser starter changes
Share feedback through GitHub Issues
Which updates are most likely to go missing in your environment? Where does time accumulate under load? Which APIs are awkward to use? Include the SDK version, OS and CPU, stream type (UDP, Shreds gRPC or Yellowstone gRPC), and expected and observed behavior so the maintainers can investigate under comparable conditions. Remove API keys and credentials from logs and reproduction steps before sharing them.


