ratchetv0.3.2
readiness + upgrade safety for Solana programs

Is your Solana program ready for mainnet — and ready to scale?

ratchet lints one Anchor IDL for the traps that bite after launch — missing version fields, reserved padding, unstable discriminators, unsigned writes.

Already deployed? It also diffs old vs new IDL and flags every change that would corrupt on-chain state.

How it works
01

Snapshot a baseline

ratchet lock --program <PID> writes a ratchet.lock — the current on-chain schema, committed to your repo.
02

Diff on every PR

ratchet check-upgrade --lock ratchet.lock --new <NEW_IDL> runs 16 rules and exits non-zero on anything that would silently corrupt data.
03

Ship with confidence

Intentional renames? Migration declared? Pass --unsafe allow-rename or --migrated-account Vault. Every acknowledgement is visible in the report.
Rules that fire
See all 16 →
R006account-discriminator-change

Catches struct renames before every existing account on-chain fails AccountDiscriminatorMismatch.

R013pda-seed-change

Notices when the PDA seeds for an account input changed — every derived address is now at a different pubkey.

R005account-field-append

Flags appends that would need a realloc. Auto-demoted when Anchor's realloc = ... constraint is in source.

Install
cargo install solana-ratchet-cli
# GitHub Action
- uses: saicharanpogul/ratchet@main
  with:
    new: target/idl/my_program.json
    lock: ratchet.lock