SolTrace — structured, Borsh-serialized Anchor events for Solana programs.
Why this exists
Solana programs rely on msg! for observability, but msg! performs string
formatting on-chain. For a swap instruction logging an amount and a pubkey,
msg! costs roughly 11,000 CU. SolTrace replaces that with a single
emit! call over a Borsh-serialized struct, cutting the same log entry to
~781 CU — a 92.96% reduction.
The emitted events are standard Anchor events, visible as Program data:
entries in transaction metadata and decodable by any Borsh-aware client.
Quick start
use *;
use ;
Feature flags
| Flag | Default | Effect |
|---|---|---|
devnet-only |
off | Compiles out all emit! calls. Enable in mainnet builds. |
no-entrypoint |
off | Passes through to anchor-lang/no-entrypoint. |