forked from zk-coins/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
69 lines (65 loc) · 2.68 KB
/
Copy pathCargo.toml
File metadata and controls
69 lines (65 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
[workspace]
members = [
"program-plonky2",
"script-plonky2",
"node",
"shared",
]
resolver = "2"
[workspace.dependencies]
sha2 = "0.10.8"
bincode = "1.3"
serde = { version = "1.0", features = ["derive"] }
rand = "0.8"
blake3 = "1.6.1"
lazy_static = "1.5.0"
bitcoin = { version = "0.32.5", features = ["rand", "rand-std", "serde"] }
# Structured logging facade + `fmt` subscriber. Workspace-level so any
# future crate adopting the partial-migration path (shared,
# script-plonky2) picks up the same version automatically.
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
[profile.dev]
opt-level = 3
# Release profile is what the Dockerfile builds (`cargo build --release -p
# node`). Defaults from Cargo are intentionally lax (codegen-units = 16,
# lto = false, incremental = false), tuned for build-time and developer
# laptops — not for a prover hot-path that runs for minutes per call.
#
# Three knobs are turned on here. Each is documented in
# https://doc.rust-lang.org/cargo/reference/profiles.html.
#
# `lto = "thin"` enables cross-crate Link-Time Optimization on a
# per-codegen-unit basis. Plonky2's hot path (`plonky2_field::goldilocks`
# `Mul`, `reduce128`, the FFT inner loops) is heavily `#[inline]`d
# intra-crate, but the `node` / `script-plonky2` boundary calls *into*
# those generics through a trait surface. `thin` lets LLVM inline
# across that boundary. `fat` was tried upstream and reverted (see
# `0xPolygonZero/plonky2/Cargo.toml` — `#lto = "fat"` commented out);
# `thin` keeps almost the full speedup with a far smaller link-time
# regression.
#
# `codegen-units = 1` forces the whole crate into a single LLVM
# compilation unit. Trades ~30-60% link-time on the node binary for
# the most aggressive intra-crate optimization. Justified because the
# binary's wall-clock is dominated by Plonky2 prove calls (3-15 min at
# `MAX_IN_COINS=8`), not by `cargo build` time.
#
# `incremental = false` is the default for release; restating it
# explicitly so a future `CARGO_INCREMENTAL=1` env var on a build host
# (or a global `~/.cargo/config.toml` override) cannot silently
# fragment the codegen unit and undo the line above. Plonky2 upstream
# left `incremental = true` in their release profile — that is
# explicitly counter to what we want here.
#
# `panic = "abort"` is *not* set: `node/src/main.rs` installs a global
# panic hook (PR #36, MINTING_ADDRESS bootstrap fix) and the account
# / state layers use `RwLock` poison recovery to fail a single request
# without taking the process down. `panic = "abort"` would defeat both.
[profile.release]
lto = "thin"
codegen-units = 1
incremental = false
[workspace.package]
version = "1.1.0"
edition = "2021"