Conversation
87ea711 to
adfee07
Compare
0d56ff2 to
0ea0bb7
Compare
karl-dz
approved these changes
Feb 4, 2026
Contributor
karl-dz
left a comment
There was a problem hiding this comment.
Beast of a PR, but deserialization looks safe
…hon, and TypeScript
…tent offset tracking
Add convenience constructors that use default program IDs and RPC URLs for each environment (mainnet-beta, testnet, devnet, localnet): - Go: NewForEnv(env), NewMainnetBeta(), NewTestnet(), etc. - Python: Client.from_env(env), Client.mainnet_beta(), etc. - TypeScript: Client.forEnv(env), Client.mainnetBeta(), etc. Also adds config.go to revdist Go SDK with ProgramID and RPC URL maps, and updates serviceability Go constructors to create RPC clients internally (matching telemetry SDK pattern).
Add assertions in from_bytes() methods to verify that all bytes up to STRUCT_SIZE are accounted for during deserialization. This catches bugs like missed fields or incorrect offset math, similar to Go's TestStructSizes approach.
8ab0cd6 to
3bf2ac2
Compare
Rename package from doublezero-borsh-incremental to borsh-incremental for both Python (PyPI) and TypeScript (npm). Add GitHub Actions release workflow triggered by borsh-incremental/v* tags.
Add example fetch CLIs for serviceability, telemetry, and revdist SDKs in Go, Python, and TypeScript. Each example demonstrates fetching and displaying onchain data. Also add sdk/Makefile with targets for running examples and tests.
Add DefensiveReader wrapper to borsh-incremental that uses try_read for all operations, returning zero/empty defaults on insufficient data. This matches Go's ByteReader behavior and makes Python/TypeScript SDKs resilient to schema changes when new fields are added. Update all SDKs (serviceability, telemetry, revdist) to use DefensiveReader instead of IncrementalReader. Also fix AccessPass to handle all enum variants (SOLANA_RPC, SOLANA_MULTICAST_PUBLISHER, SOLANA_MULTICAST_SUBSCRIBER, OTHERS).
Add tests that verify DefensiveReader returns zero/empty defaults when data is truncated or missing, rather than throwing errors. This ensures SDKs remain resilient when new trailing fields are added to onchain structs.
Add getProgramData compat tests to Python and TypeScript that fetch and deserialize all program accounts including AccessPass, ensuring we catch deserialization issues across all account types and variants.
- Add bun workspace at sdk level for TypeScript cross-package deps - Update telemetry examples to use serviceability for device discovery - Get current epoch from DZ Ledger RPC instead of approximation - Add bs58 dependency to revdist package - Update package.json files to use source entry points for dev
- Use bunx for tsc in Makefile - Add missing AccessPassTypeTag enum values to TypeScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
borsh-incrementallibrary (Go, Python, TypeScript) providing cursor-based Borsh deserialization with backward-compatible trailing field defaults viatryRead*methodsenum_strings.jsonfixture and bidirectional completeness checks to keep variants in syncsdk/README.mddocumenting the testing strategy and how to extend fixturesTesting Verification
make sdk-testandmake sdk-compat-testpass