Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Architecture decision records

This section captures the durable architectural decisions behind Pina’s public model, safety posture, and verification strategy.

ADR format and naming

  • Files live under docs/src/adrs/.
  • ADRs use the naming pattern NNNN-short-slug.md.
  • The starter template lives at docs/src/adrs/0000-template.md.
  • Architecture-impacting pull requests should link the ADR they follow or update.

ADR index

ADRStatusDecision
ADR 0001AcceptedKeep discriminator bytes as the first field inside typed layouts.
ADR 0002AcceptedKeep zero-copy for fixed-size Pod layouts, but only behind explicit validation.
ADR 0003AcceptedKeep runtime borrow guards alive for the full typed loader lifetime.
ADR 0004AcceptedPreserve no_std / no-allocator constraints for on-chain code paths.
ADR 0005AcceptedKeep SPL token support optional and feature-gated.
ADR 0006AcceptedTreat CI as layered verification, not a single all-purpose test lane.

How to use this section

Use these ADRs when you need to answer questions like:

  • why Pina uses discriminator-first layouts instead of external headers
  • when zero-copy is allowed, and where the safety boundaries are
  • why typed account loaders must be guard-backed instead of returning bare references
  • why no_std and allocator constraints are treated as architecture, not implementation detail
  • why token helpers are optional instead of always-on
  • why Miri, compile-fail tests, feature matrices, and compute-unit checks all exist at once