brainblast v0.7.2 — Deployment Intelligence
Deployment Intelligence — a new brainblast deploy-plan [dir] command that answers the two questions every Anchor builder works out by hand before anchor deploy: how much SOL do I need? and what's the exact ordered transaction sequence?
How much SOL do I need?
From the compiled .so under target/deploy/, modeled on the on-chain BPF upgradeable loader:
| Item | Formula | Recoverable? |
|---|---|---|
| Program account | rent(36) |
❌ until program closed |
| Program data (2× upgrade headroom) | rent(45 + 2·len) |
❌ until program closed |
| Buffer (transient) | rent(37 + len) |
✅ refunded at deploy |
| Init PDAs (treasury, config, …) | rent(space) each |
depends on close logic |
| Transaction fees | base fee × (buffer + writes + deploy + inits) | ❌ spent |
Reports a wallet funding figure (safe upper bound) and the steady-state lockup.
Exact transaction sequence
Create buffer → write program chunks → deploy → one initialize step per #[derive(Accounts)] struct, each annotated with the rent it locks/refunds and its fee.
Notable
- Anchor
initparsing (tree-sitter-rust) extractsspace,seeds, andpayerperinit/init_if_neededaccount. - Non-literal
space(e.g.8 + State::INIT_SPACE) is flagged and excluded from totals rather than guessed. --program-len BYTESmodels an uncompiled build;--max-len-mult Noverrides the 2× headroom;--jsonemits the full plan for an agent.- New
/brainblast-deploy-planslash command. 20 new tests (368 total green).
Also refreshed stale version + bundled-rule-count references (now 16 bundled rules incl. the 3 Anchor program-security checks).
npx brainblast@0.7.2 deploy-plan
The brainblast CLI publishes to npm automatically via the brainblast-v0.7.2 tag (publish-cli workflow).