0.7.0 (2026-03-29)
Breaking Changes
Pod Arithmetic (pina_pod_primitives)
Add full Quasar-style arithmetic, bitwise, ordering, and display traits to all Pod integer types (PodU16, PodU32, PodU64, PodU128, PodI16, PodI32, PodI64, PodI128).
Arithmetic operators (Add, Sub, Mul, Div, Rem) work between Pod types and between Pod + native types. Assign variants (AddAssign, SubAssign, etc.) allow ergonomic in-place mutation like my_account.count += 1u64;.
Arithmetic semantics: debug builds panic on overflow (checked), release builds use wrapping for CU efficiency on Solana.
Bitwise operators: BitAnd, BitOr, BitXor, Shl, Shr, Not with assign variants.
Signed types get Neg for unary negation.
Checked arithmetic: checked_add, checked_sub, checked_mul, checked_div return Option for explicit overflow detection.
Saturating arithmetic: saturating_add, saturating_sub, saturating_mul clamp at bounds.
Constants: ZERO, MIN, MAX for all types.
Helpers: get() method, is_zero(), improved Debug (e.g. PodU64(42)), Display, Ord, PartialOrd, PartialEq<native>, PartialOrd<native>.
PodBool: Not operator and Display added.
Backward compatible: all existing APIs preserved, no breaking changes.
IDL Parser Hardening (pina_cli)
Add static validation to the IDL parser that runs after IR assembly:
- Discriminator collision detection: checks within accounts and within instructions for duplicate discriminator values. Three-way collisions produce all pairwise diagnostics.
- Duplicate input field detection: checks within each instruction for name collisions between account names and argument names.
- Human-readable error formatting for both collision types.
Validation is automatically run during assemble_program_ir().
Static CU Profiler (pina profile)
Add a new pina profile CLI command for static compute unit profiling of compiled SBF programs.
pina profile <path-to-so>— text summary with per-function CU estimatespina profile <path-to-so> --json— JSON output for CI integrationpina profile <path-to-so> --output report.json— write to file
The profiler parses ELF binaries to extract .text sections and symbol tables, counts SBF instructions per function, and estimates CU costs without requiring a running validator. Works best with unstripped binaries.
v1 scope: text/JSON output, per-function breakdown, best-effort symbol resolution. Flamegraph/browser UI planned for v2.
Features
- Add
realloc_accountandrealloc_account_zeroCPI helpers for safe account reallocation with automatic rent recalculation. - Add instruction introspection helpers for reading the sysvar instructions account:
assert_no_cpi,get_instruction_count,get_current_instruction_index,has_instruction_before, andhas_instruction_after. - Add
pina init <name>scaffolding command that generates a new Pina program project with a minimal program structure, tests, and build configuration. - Add
InstructionBuilderand account metadata helper functions (writable_signer,writable,readonly_signer,readonly) for typed client-side instruction construction.
Fixes
- Expand snapshot test coverage for proc macros including edge cases for
#[account],#[instruction],#[event],#[error],#[discriminator], and#[derive(Accounts)]. - Add property-based fuzz tests using
proptestfor Pod type deserialization, round-trip correctness, and discriminator parsing safety. - Enforce the workspace's custom security dylints in CI, align
devenvwith the Node.js version selected bypnpm-workspace.yamlwithout a separate install step, and replace thepastedependency inpinawithpastey.
Reduce warning noise and restore local Codama client verification ergonomics.
- Annotate the generated Rust root
mod.rsre-export ofprograms::*with#[allow(unused_imports)]. - Add regression coverage for the generated root module allowance.
- Update the repository Codama JS test harness to type-check generated clients against the current
@solana/kitdependency layout using a local compatibility shim.
This keeps crate-internal program ID constants available at crate::<PROGRAM>_ID for generated instruction modules, while avoiding warnings for IDLs that only generate a programs module and keeping pnpm run check:js green.
Fix broken doc comments produced by mdt template expansion. The line-prefix mode was emitting -->// instead of --> followed by ///, and blank lines inside reusable doc blocks were missing the /// prefix. This caused rustdoc warnings and broken documentation rendering.
Also simplifies a raw string literal in pina_cli init templates and shortens a fully-qualified std::result::Result::ok path to Result::ok.
Add comprehensive end-to-end integration tests for the pina crate. The test suite covers:
- Full account lifecycle (create, write state, read/validate, update, close with rent return)
- Multi-instruction flows (Initialize then Update, verify state after each step)
- Error handling (invalid signer, wrong owner, discriminator mismatch, data length mismatch, invalid instruction discriminator, empty instruction data, wrong program ID, insufficient accounts, non-writable account, empty account rejection)
- Lamport transfer operations (send, insufficient funds, same-account rejection, close with recipient)
- PDA seed verification (derive and verify roundtrip, canonical bump assertion, assert_seeds_with_bump on AccountView)
- AccountView validation chains (chained assertions, short-circuit behavior)
- Discriminator dispatch across all instruction variants
- TryFromAccountInfos derive mapping and rejection of excess accounts
- Address assertion (single address and multi-address matching)
Tests use raw SVM input buffer construction to create AccountView instances without requiring compiled BPF programs, following the same memory layout as the pinocchio entrypoint deserializer.
Expand mdt documentation reuse across the workspace.
Added 10 new mdt provider blocks in template.t.md:
pinaProjectDescription— single-source project taglinepinaInstallation— cargo add instructionspodTypesTable— Pod types reference tablepodArithmeticDescription— Pod arithmetic semanticspinaWorkspacePackages— workspace crate tablepinaFeatureHighlights— feature bullet listsbfBuildInstructions— SBF build commandspinaTestingInstructions— testing commandspinaBadgeLinks— shared badge link referencespinaSecurityBestPractices— security checklist
Wired 15 new consumers across:
readme.md(root) — 10 consumer blockscrates/pina/readme.md— feature flags table + badge linkscrates/pina_pod_primitives/readme.md— pod types table + arithmetic descriptiondocs/src/security-model.md— security best practices
Provider/consumer counts: 13/31 → 23/46.
Improve diagnostics and validation ergonomics in pina.
parse_instructionstill remapsProgramError::Custom(_)discriminator errors toInvalidInstructionDatafor compatibility, but now logs the original custom error code when thelogsfeature is enabled.- The escrow example now adds stronger account checks in both
MakeandTakeflows, including explicit system program ID validation, vault owner validation, and associated-token-address validation fortaker_ata_bandmaker_ata_bbefore CPIs. - Regenerated escrow Codama IDL and generated clients to reflect account metadata changes (default
systemProgramand writable ATA fields where required). - Clean up internal test assertions in
traits.rsto avoid unnecessary qualification warnings. - Make
PinaProgramErrorindependent from proc-macro expansion sopinanow compiles with--no-default-features(without requiring thederivefeature), and add regression coverage to keep the enum wire-size aligned tou32. - Add a dedicated CI/devenv build gate (
build:pina:no-default) to continuously verifypinano-default feature compatibility across key feature subsets.
Update the committed escrow_program CLI example snapshot to match the regenerated Codama IDL.
This keeps the pina_cli example snapshot tests aligned with the generated escrow metadata after account validation changes introduced writable ATA requirements and default systemProgram addresses.
Notes
- Add compute unit benchmark tests measuring CU consumption for key Pina operations including account validation, PDA derivation, and CPI helpers.
- Document the workspace tooling refresh that updates the Codama JavaScript dependencies, adds
useNodeVersiontopnpm-workspace.yaml, and makesdevenvhonor that pnpm workspace Node version via shell-localnode/npm/npx/corepackshims while keeping the standalonepnpmbinary active.
Harden CI setup reliability by adding retries to the shared ./.github/actions/devenv action for transient Nix/devenv failures.
Also increase workflow timeouts for release-preview, semver, and binary-size so slow cold-cache environment provisioning does not cancel jobs before they execute their main steps.
Re-enable the anchor parity BPF artifact checks in CI by building sbpf-linker with the Blueshift upstream-gallery-21 LLVM toolchain.
This adds a cached install:sbpf-gallery devenv script and restores cargo build-bpf plus the ignored pina_bpf bpf_build_ tests in test:anchor-parity.