Validate the instruction header first
Validate account indices before dereferencing
Read transaction instruction data once
Make account data writable before mutation
Resize before writing a larger account payload
Read and write packed account data carefully
TSDK_LOAD and TSDK_STORE.
Bubble up CPI failures explicitly
Emit human-readable logs
Emit raw event payloads
Derive a program-defined address
Parse proof tails safely
Notes
- The most reliable flow is: validate sizes, validate indices, validate ownership or auth, then mutate or invoke.
- If a page elsewhere shows a bigger end-to-end example, use this page as the short-form reference while implementing.