v0.1.0 — binary decoder
New: solana-go/binary
A minimal, reflection-free decoder for the little-endian ("bincode") and Borsh layouts used by Solana account state and instruction data. No encode side, no struct tags — callers read fields explicitly in layout order, so every read is a bounds check and a fixed-width load.
- Sticky-error
Decoder: read a struct with straight-line calls and checkErr()once at the end. Cold paths record bare sentinels; offset context is formatted lazily, keeping the hot reads inlineable and allocation-free. - Reads:
Uint8/16/32/64,Int64,Bool,Bytes(n)(zero-copy, withCopyvariant),BorshString(zero-copy viaunsafe.String, withCopyvariant), typedPublicKey/Signature/Hash, BorshOptionand SPLCOptiontags (validated), canonical compact-u16 (shortvec) lengths,Skip/Pos/Len/Remaining. - Sentinel errors matchable with
errors.Is:ErrUnexpectedEOF,ErrInvalidTag,ErrNonCanonical,ErrOverflow.
Benchmarks vs gagliardetto/binary
| Operation | fluxrpc | upstream | speedup |
|---|---|---|---|
| SPL token account decode (165 B) | 36 ns, 0 allocs | 150 ns, 1 alloc | 4.1x |
| Metaplex metadata (zero-copy strings) | 123 ns, 1 alloc | 369 ns, 5 allocs | 3.0x |
| Metaplex metadata (copied strings) | 202 ns | 336 ns | 1.7x |
| compact-u16 (3-byte worst case) | 6.5 ns | 8.6 ns | 1.3x |
Verified by differential parity tests in benchcmp (identical decode results vs upstream on token account, mint and metadata fixtures, plus the full 0–0xFFFF compact-u16 range) and 700k+ fuzz executions with no panics.
Root package additions
MPK(string) PublicKey— convenience alias forMustPublicKeyFromBase58.PublicKeySlice—[]PublicKey, JSON-encodes as an array of base58 strings.TransactionFromBase58— base58 counterpart toTransactionFromBase64.