Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
188 lines (170 loc) · 8.64 KB
/
Copy pathCargo.toml
File metadata and controls
188 lines (170 loc) · 8.64 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
[workspace]
resolver = "3"
default-members = ["bin/ethlambda"]
members = [
"bin/ethlambda",
"crates/blockchain",
"crates/blockchain/fork_choice",
"crates/blockchain/state_transition",
"crates/common/crypto",
"crates/common/ssz-tree",
"crates/common/metrics",
"crates/common/test-fixtures",
"crates/common/types",
"crates/net/api",
"crates/net/engine",
"crates/net/p2p",
"crates/net/rpc",
"crates/storage",
"crates/validator",
]
[workspace.package]
authors = ["LambdaClass"]
edition = "2024"
keywords = ["ethereum", "blockchain", "consensus", "protocol"]
license = "LICENSE"
readme = "README.md"
repository = "https://github.com/lambdaclass/ethlambda"
rust-version = "1.97.1"
version = "1.0.0"
# Cross-crate inlining matters here: the hot paths (SSZ encode/decode, hashing,
# fork choice traversal) are split across workspace crates and their
# dependencies, so keeping every crate in its own codegen unit leaves inlining
# opportunities on the table. Fat LTO plus a single codegen unit trades build
# time for that.
#
# Fat rather than thin: on an 8-node devnet, fat cut mean state transition time
# a further 2.1% over thin (every fat node beat every thin node) at no measurable
# build-time or image-size cost. ethrex uses thin here; we diverge deliberately.
[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
# Test profile (see the `test` target in the Makefile). Tests need release-grade
# opt-level: signature verification/aggregation stack-overflows without it. They
# do not need a whole-program-optimized binary, so this drops LTO, restores
# parallel codegen, and keeps line tables for backtraces, which makes test
# rebuilds finish in a fraction of the time of a `release` build.
[profile.release-fast]
inherits = "release"
lto = false
codegen-units = 16
debug = "line-tables-only"
incremental = true
# Inheriting `release` would leave these off, so a `debug_assert!` would run
# nowhere: the suite runs under this profile, and a plain `dev` build is not a
# fallback because signature verification and aggregation stack-overflow
# without release-grade opt-level. Turning them on here is what makes
# `debug_assertions` mean "checked in tests, absent from shipped binaries".
debug-assertions = true
# Set explicitly rather than inherited, so arithmetic behaviour stays identical
# to `release` regardless of what Cargo defaults this to alongside
# `debug-assertions`.
overflow-checks = false
[workspace.dependencies]
ethlambda-blockchain = { path = "crates/blockchain" }
ethlambda-fork-choice = { path = "crates/blockchain/fork_choice" }
ethlambda-state-transition = { path = "crates/blockchain/state_transition" }
ethlambda-crypto = { path = "crates/common/crypto" }
ethlambda-ssz-tree = { path = "crates/common/ssz-tree" }
ethlambda-metrics = { path = "crates/common/metrics" }
ethlambda-test-fixtures = { path = "crates/common/test-fixtures" }
ethlambda-types = { path = "crates/common/types" }
ethlambda-network-api = { path = "crates/net/api" }
ethlambda-engine = { path = "crates/net/engine" }
ethlambda-p2p = { path = "crates/net/p2p" }
ethlambda-rpc = { path = "crates/net/rpc" }
ethlambda-storage = { path = "crates/storage" }
ethlambda-validator = { path = "crates/validator" }
tracing = "0.1"
thiserror = "2.0.9"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0.117"
serde_yaml_ng = "0.10"
hex = "0.4"
hmac = "0.12"
base64 = "0.22"
spawned-concurrency = "0.5.0"
spawned-rt = "0.5.0"
tokio = "1.0"
tokio-util = "0.7"
prometheus = { version = "0.14", features = ["process"] }
clap = { version = "4.3", features = ["derive", "env"] }
# Version pinned to ethrex's workspace: `SecretKey` crosses that API boundary.
# `rand` is re-exported as `secp256k1::rand`, so nothing needs a direct dep on it
# to seed a key.
secp256k1 = { version = "0.30.0", default-features = false, features = ["global-context", "rand"] }
# Merkleizing a beacon state is almost entirely SHA-256 compressions, so which
# implementation `sha2` picks matters. What `asm` actually buys is aarch64: on
# x86/x86_64, sha2 0.10.9 compiles its `x86` backend and dispatches to the SHA-NI
# intrinsics through `cpufeatures` whether or not this feature is set, and `asm`
# only swaps the *fallback* for that dispatch from pure Rust to `sha2-asm`. On
# aarch64 the feature is the whole hardware path: without it the crate falls
# through to the pure-Rust backend. Selection stays at run time either way, so the
# build remains portable to hardware lacking the extensions.
sha2 = { version = "0.10.9", features = ["asm"] }
# XMSS signatures + recursive aggregation, through leanVM's own facade crate:
# it re-exports the aggregation API, the `xmss` module (keys, signing, and the
# SSZ codec for the two wire types) and the `rand` that signing draws from, so
# the whole crypto stack arrives as one dependency at one revision.
# Pinned to a `main` commit for reproducible builds; bump the rev to track main.
leanvm = { git = "https://github.com/leanEthereum/leanVM.git", rev = "48a904208d682848dac0e18ef8b01ebfc40df9ad" }
# leanVM's prover arena, for tests that read its slab accounting (the facade does
# not re-export it). Keep the rev equal to leanvm's: only then is this the same
# crate instance, with the same statics, as the one leanvm proves on.
zk_alloc = { git = "https://github.com/leanEthereum/leanVM.git", rev = "48a904208d682848dac0e18ef8b01ebfc40df9ad" }
# Secret-key (de)serialization for the leanVM xmss key format.
postcard = { version = "1.1.3", features = ["alloc"] }
# SSZ implementation.
#
# Tracked from git rather than crates.io because the Beacon Chain containers
# hand out `&mut` into an `SszList` (the validator registry, through
# `altair_validator_lists_mut`), which published libssz-types 0.3.0 cannot do:
# it exposes only `Deref` and `Index`. `DerefMut` and `IndexMut` landed after
# that release, in lambdaclass/libssz#33. Gloas's progressive state lists need
# the same in-place access on `ProgressiveList`, which lambdaclass/libssz#37
# adds.
#
# Pinned by `rev` rather than tracking `main`: the requirement is a commit that
# carries #33 and #37, not whatever `main` holds today, and `main` here is the
# SSZ encoder and merkleizer that decides every `hash_tree_root`, so a routine
# `cargo update` must not be able to move it. This rev is #37's PR branch head,
# not yet merged: it must move to #37's merge commit before this branch merges,
# since a PR branch ref stops being fetchable once the branch is deleted. Return
# these to a crates.io version once a release carrying #33 and #37 exists.
libssz = { git = "https://github.com/lambdaclass/libssz", rev = "5cb14378ffdadcb51b387c003567e2630d0c7073" }
libssz-derive = { git = "https://github.com/lambdaclass/libssz", rev = "5cb14378ffdadcb51b387c003567e2630d0c7073" }
libssz-merkle = { git = "https://github.com/lambdaclass/libssz", rev = "5cb14378ffdadcb51b387c003567e2630d0c7073" }
libssz-types = { git = "https://github.com/lambdaclass/libssz", rev = "5cb14378ffdadcb51b387c003567e2630d0c7073" }
# VCDIFF delta compression for beacon state diffs.
#
# Sigma Prime's maintained fork of the unmaintained liushuyu/xdelta3-rs on
# crates.io, kept alive for lighthouse's own state-diff layer. Pinned by rev
# rather than tracking a branch, for the same reason libssz is: this decides
# whether a reconstructed state is correct, so a routine `cargo update` must
# not be able to move it.
#
# `default-features = false` is required, not tidiness: the default `stream`
# feature pulls futures-io/futures-util for an async API whose module does not
# compile at this rev. The one-shot in-memory API used here is outside it.
xdelta3 = { git = "https://github.com/sigp/xdelta3-rs", rev = "fe3906605c87", default-features = false }
# Build-time version info
vergen-git2 = { version = "9", features = ["rustc"] }
# The commit hash `build.rs` embeds in full, which vergen only offers abbreviated
# beside the branch. vergen-git2 already builds this crate with no default
# features, so naming it directly adds nothing to the dependency graph.
git2 = { version = "0.20", default-features = false }
rayon = "1.11"
rand = "0.10"
lru = "0.16"
rocksdb = "0.24"
libc = "0.2"
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }
eyre = "0.6"
# Allocator + heap profiling
tikv-jemallocator = { version = "0.6", features = ["stats", "unprefixed_malloc_on_supported_platforms", "profiling"] }
jemalloc_pprof = { version = "0.8", features = ["flamegraph"] }
# NOTE: Shadow-simulator builds also replace quinn-udp with the fallback crate
# in `shadow/quinn-udp-patch` (no GSO/GRO batch syscalls). A Cargo `[patch]`
# cannot be feature-gated, so it is NOT committed here; `shadow/build.sh` injects
# it into this manifest at build time. See `make shadow-build`.