Skip to content

Release: develop -> main - #139

Merged
TaprootFreak merged 1 commit into
mainfrom
develop
May 29, 2026
Merged

Release: develop -> main#139
TaprootFreak merged 1 commit into
mainfrom
develop

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Automatic Release PR

Commits: 1 new commit(s)

  • Review all changes
  • Verify CI passes
  • Merge when ready for production

* perf(build): tune release profile + adopt mimalloc on the node binary

Cargo's default release profile uses `codegen-units = 16` and
`lto = false`. For a binary whose wall-clock is dominated by Plonky2
prove calls (3-15 min at MAX_IN_COINS=8) those defaults leave
intra-crate inlining on the table at the `node` / `script-plonky2`
boundary that calls into `plonky2_field`'s heavily-inlined hot path
through a trait surface.

- `lto = "thin"` enables cross-crate inlining without the full link-
  time cost of `lto = "fat"` (upstream Plonky2 tried fat and reverted
  in their Cargo.toml — see the inline comment).
- `codegen-units = 1` forces the whole binary into a single LLVM
  compilation unit so the inliner sees everything at once.
- `incremental = false` is the cargo default for release, restated
  here so a future `CARGO_INCREMENTAL=1` on a build host cannot
  silently fragment the codegen unit.
- `panic = "abort"` is intentionally not set: `main.rs` installs a
  global panic hook (PR #36, MINTING_ADDRESS bootstrap recovery) and
  state / account layers use RwLock poison recovery to fail one
  request without taking the process down. Abort defeats both.

mimalloc replaces the system allocator in the binary only — library
crates, integration tests, and program/prover crates keep the system
allocator. The Plonky2 prove path allocates many polynomial and
witness buffers across the rayon worker pool; glibc-malloc on the
debian-bookworm-slim runtime image is not tuned for that pattern.
Scoping the swap to `main.rs` keeps unit-test behaviour identical to
CI and avoids pulling a C build dependency into every test target.

Local release build: 1m 57s on M3 Ultra (vs ~1m 26s pre-change),
within the ~5 min CI budget documented in README.md / CONTRIBUTING.md.
Pre-push hook (fmt + 3x clippy + workspace check) clean.

Expected proof-time impact is modest (single-digit-to-low-double-digit
percent on aggregate). The authoritative measurement is the pending
R2 wall-clock probe on the M3 Ultra (ROADMAP § Step 9) — this PR
makes the build profile what that measurement should be taken from,
not a separate one-off tune.

* docs(node): correct mimalloc default-features comment

The previous comment claimed `default-features = false` strips
"secure-mode overhead" and "debug rings". Upstream
`purpleprotocol/mimalloc_rust` ships `default = []`, so there are
no default features to disable — the original justification was
fictitious.

Reword the comment to state the real reason: it is a defensive
opt-in posture so a future upstream change that turns on `secure`,
`debug`, `extended`, or `v2` via default features cannot silently
land in the node binary without an explicit code change.

No behavioural change.
@github-actions github-actions Bot added the ci:full Trigger heavy CI jobs (Server + Shared Tests + Coverage Gate, ~60-90 min on M3 Ultra) label May 29, 2026
@TaprootFreak TaprootFreak added ci:full Trigger heavy CI jobs (Server + Shared Tests + Coverage Gate, ~60-90 min on M3 Ultra) and removed ci:full Trigger heavy CI jobs (Server + Shared Tests + Coverage Gate, ~60-90 min on M3 Ultra) labels May 29, 2026
@TaprootFreak
TaprootFreak merged commit 167657b into main May 29, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Trigger heavy CI jobs (Server + Shared Tests + Coverage Gate, ~60-90 min on M3 Ultra)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant