Skip to content

brainblast v0.7.2 — Deployment Intelligence

Choose a tag to compare

@DSB-117 DSB-117 released this 20 Jun 06:23
· 4 commits to main since this release
810cfbd

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 init parsing (tree-sitter-rust) extracts space, seeds, and payer per init / init_if_needed account.
  • Non-literal space (e.g. 8 + State::INIT_SPACE) is flagged and excluded from totals rather than guessed.
  • --program-len BYTES models an uncompiled build; --max-len-mult N overrides the 2× headroom; --json emits the full plan for an agent.
  • New /brainblast-deploy-plan slash 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).