Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
394 lines (356 loc) · 13.1 KB
/
Copy pathCargo.toml
File metadata and controls
394 lines (356 loc) · 13.1 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
[package]
name = "enroute"
description = "The headless Git platform: the node, its configuration and its CLI."
version.workspace = true
edition.workspace = true
publish.workspace = true
license.workspace = true
[lib]
name = "enroute"
path = "src/lib.rs"
[[bin]]
name = "enroute"
path = "src/main.rs"
[lints]
workspace = true
# Named only in `#[serde(with = "humantime_serde")]`, which machete does not
# read.
[package.metadata.cargo-machete]
ignored = ["humantime-serde"]
[dependencies]
# The CLI's client for the contract.
enroute-api.workspace = true
enroute-signature.workspace = true
# The seed of `enroute dev`'s signing key.
rand.workspace = true
# `enroute diagnose` reads each node's `/status`.
reqwest.workspace = true
enroute-shared.workspace = true
enroute-ledger.workspace = true
enroute-compute.workspace = true
tonic.workspace = true
object_store.workspace = true
url.workspace = true
# For `HeaderName` alone: a header a deployment names is refused where it is
# configured rather than by the first call that carries it.
http.workspace = true
tokio.workspace = true
axum.workspace = true
serde.workspace = true
serde_json.workspace = true
toml.workspace = true
dotenvy.workspace = true
bytesize.workspace = true
humantime-serde.workspace = true
humantime.workspace = true
anyhow.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
tracing-appender.workspace = true
opentelemetry.workspace = true
opentelemetry_sdk.workspace = true
# `reqwest-rustls`: an OTLP collector is usually `https://`.
opentelemetry-otlp = { workspace = true, features = ["reqwest-rustls"] }
tracing-opentelemetry.workspace = true
clap.workspace = true
mimalloc.workspace = true
[target.'cfg(target_os = "linux")'.dependencies]
rustix = { workspace = true, features = ["thread"] }
[dev-dependencies]
async-trait.workspace = true
bytes.workspace = true
ed25519-dalek.workspace = true
futures.workspace = true
# The in-memory exporter, which a test reads its spans from.
opentelemetry_sdk = { workspace = true, features = ["testing"] }
parking_lot.workspace = true
reqwest = { workspace = true, features = ["stream"] }
tempfile.workspace = true
test-support = { path = "dev/test-support" }
tonic-prost.workspace = true
tower = { workspace = true, features = ["util"] }
[workspace]
resolver = "2"
members = [
"crates/api/types",
"crates/api/signature",
"crates/shared",
"crates/ledger",
"crates/compute",
"dev/e2e",
"dev/test-support",
"dev/xtask",
]
[workspace.package]
version = "0.4.1"
edition = "2024"
publish = false
license = "Apache-2.0"
# Incremental state is most of `target/`, and a caching rustc wrapper cannot
# reuse an incremental build. Line tables are enough for backtraces.
[profile.dev]
incremental = false
debug = "line-tables-only"
# The ledger's shard log model checks (tests/shardlog_model.rs) explore
# millions of states: optimized, they take seconds in a debug build's test run
# instead of many minutes.
[profile.dev.package.enroute-ledger]
opt-level = 3
[profile.dev.package.stateright]
opt-level = 3
# What ships. Fat LTO across the whole graph prunes the dependency code nothing
# reaches, and one codegen unit lets it: the default sixteen give the optimizer
# sixteen partial views. `strip` drops symbols the deployed binary never reads.
#
# No `panic = "abort"`. A panic in one git request must not take the other
# connections down with it, and axum catches an unwinding handler; abort would
# turn one malformed pack into an outage.
[profile.release]
lto = "fat"
codegen-units = 1
strip = true
# The fast loop: release codegen without the fat-LTO relink that dominates a
# rebuild, plus incremental state. Never what ships — `cargo build --profile lab`
# is for measuring something under optimization while still iterating on it.
[profile.lab]
inherits = "release"
lto = "thin"
codegen-units = 16
incremental = true
strip = false
# Release codegen with full debug info, so a sampling profiler can attribute
# time in inlined code to its source line.
[profile.profiling]
inherits = "release"
debug = "full"
# `release` strips, and this profile inherits that.
strip = false
# A self-contained `.dSYM` on macOS, so symbols survive a clean of `target/`.
split-debuginfo = "packed"
[workspace.dependencies]
enroute-api = { path = "crates/api/types" }
enroute-signature = { path = "crates/api/signature" }
enroute-shared = { path = "crates/shared" }
enroute-ledger = { path = "crates/ledger" }
enroute-compute = { path = "crates/compute" }
# git protocol primitives
gix-packetline = { version = "0.24", features = ["blocking-io"] }
# Parsing and writing commits, trees and tags, of both object formats. Ids
# hash in `git::oid` (SHA-1 with `sha1dc`).
gix-object = { version = "0.66", features = ["sha1", "sha256"] }
gix-hash = { version = "0.28", features = ["sha1", "sha256"] }
gix-actor = "0.44"
gix-date = "0.18"
# Git's `check_refname_format`.
gix-validate = "0.13"
# plain (hardware-accelerated) SHA-1 for hashing data we serve; object ids get
# the collision-detecting one, `sha1dc`
sha1 = "0.11"
# Deflate and inflate in safe Rust; inflate reports where a stream ends,
# which walking a pack needs.
sirocco = "0.3"
# a fast, randomly seeded hasher for hot maps keyed by pushed content
foldhash = "0.2"
# object storage. Every backend it can reach, because which one a deployment
# uses is named by a URL at startup and is not a choice this repository makes.
object_store = { version = "0.14", features = ["aws", "azure", "gcp", "http", "tokio"] }
# The store URL type object_store itself parses, so both ends agree on what a
# URL is.
url = "2"
tonic = "0.14"
tonic-prost = "0.14"
tonic-reflection = "0.14"
prost = "0.14"
# The well-known types, which the contract names for timestamps. Generated
# code refers to them, so this is a dependency of the generated crate rather
# than of anything hand-written.
prost-types = "0.14"
# Codegen, at build time only. `protox` compiles the `.proto` in-process, so a
# `cargo build` needs no `protoc` and no `buf` — buf checks the contract (see
# `buf.yaml`), it does not build it.
tonic-prost-build = "0.14"
protox = "0.9"
futures = "0.3"
roaring = "0.11"
# Persistent maps: a state copy shares its refs.
rpds = "1"
# http server
axum = { version = "0.8", features = ["macros"] }
tokio = { version = "1", features = ["full"] }
tokio-stream = "0.1"
# A push body read as a byte stream, gunzipped as it arrives.
tokio-util = { version = "0.7", features = ["io", "io-util"] }
async-compression = { version = "0.4", features = ["tokio", "gzip"] }
tower = "0.5"
bytes = "1"
# Decoding a git URL segment by segment. Not `url`, which parses a whole URL
# and would resolve the `.` and `..` a repository path must instead refuse.
percent-encoding = "2"
# error handling
anyhow = "1"
thiserror = "2"
# serde
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# syntax-only cross-crate analysis for `cargo xtask lint` (no name resolution:
# see dev/xtask/src/lint/dead_code.rs)
tree-sitter = "0.27"
tree-sitter-rust = "0.24"
# the skill's frontmatter, read the way an installer reads it rather than by a
# parser of ours (see dev/xtask/src/lint/skill.rs). `encoding` off: the lint
# hands it a `&str`, so there is nothing to detect an encoding of.
yaml-rust2 = { version = "0.12", default-features = false }
# misc
rayon = "1"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# console lines written from a thread of their own, off the async workers.
tracing-appender = "0.2"
# distributed tracing export (OTLP over HTTP). The batch span processor runs
# on its own dedicated thread regardless of the app's async runtime, so the
# exporter needs the *blocking* reqwest client — a `reqwest-client` (async)
# exporter panics there with "no reactor running", since that thread never
# enters a Tokio context.
opentelemetry = { version = "0.32", default-features = false, features = [
"trace",
] }
opentelemetry_sdk = { version = "0.32", default-features = false, features = [
"trace",
] }
opentelemetry-otlp = { version = "0.32", default-features = false, features = [
"http-proto",
"reqwest-blocking-client",
"trace",
] }
tracing-opentelemetry = { version = "0.33", default-features = false }
# `http::HeaderMap` as a carrier of trace context.
opentelemetry-http = { version = "0.32", default-features = false }
http = "1"
# Configuration a deployment writes, and xtask's manifest reading.
toml = "1"
# `.env` files for the CLI, read without setting the environment.
dotenvy = "0.15"
# Sizes and durations in the configuration file, such as "512 MiB" and "15m".
bytesize = { version = "2", features = ["serde"] }
humantime-serde = "1"
humantime = "2"
arc-swap = "1"
crc32fast = "1"
# The buffer pool's eviction queues.
crossbeam-queue = "0.3"
hex = "0.4"
integer-encoding = "4"
libc = "0.2"
rustix = { version = "1", features = ["fs", "process"] }
# The enroute binary's allocator: glibc's costs a busy compute much CPU.
mimalloc = "0.1"
parking_lot = "0.12"
quick_cache = "0.7"
# Internal-port tokens (enroute-ledger::token): EdDSA only, on aws-lc-rs, which
# rustls already brings.
jsonwebtoken = { version = "11", default-features = false, features = ["aws_lc_rs"] }
sha1dc = "0.1.5"
slog = "2"
zerocopy = { version = "0.8", features = ["derive"] }
# The ledger's on-disk state machine (enroute-ledger::state_store). Pure Rust:
# no C++ to build. The LSM tree alone, without Fjall's write-ahead log: the
# Raft log already holds what a crash loses.
lsm-tree = { version = "3.1", features = ["lz4"] }
# raft-rs's own messages are prost 0.11; used only where we encode or decode
# them (the log store's codec, the Raft transport).
raft-prost = { package = "prost", version = "0.11" }
# raft-rs and raft-engine from git, as TiKV does, pinned for
# reproducibility. raft-rs: the crates.io release (0.7.0, 2023) needs a 3.x
# `protoc` at build time and lacks later fixes; master with the prost codec
# does not. raft-engine: pluggable value codecs (prost entries, see
# `logdb.rs`) are newer than its last release (0.4.2).
raft-engine = { git = "https://github.com/tikv/raft-engine", rev = "097c499a19fbb38754c73aa2f31532329df7c0c6", default-features = false }
raft = { git = "https://github.com/tikv/raft-rs", rev = "ad13f3d90780f53aea2488c6a4b76c0d334bf136", default-features = false, features = ["prost-codec"] }
tempfile = "3"
rand = "0.10"
reqwest = { version = "0.13", default-features = false }
async-trait = "0.1"
clap = { version = "4", features = ["derive", "env"] }
# tests and dev tools only
walkdir = "2"
proptest = "1"
proptest-state-machine = "0.8"
stateright = "0.31"
uuid = { version = "1", features = ["v4"] }
# auth: Basic-auth header decoding, and the digests the hook signatures cover.
base64 = "0.23"
sha2 = "0.11"
# The hook endpoint's RFC 9421 signatures. `pkcs8`/`pem` so a key is whatever
# `openssl genpkey -algorithm ed25519` already wrote, rather than a shape only
# this workspace knows how to read.
ed25519-dalek = { version = "3", features = ["pkcs8", "pem"] }
# RFC 9651 structured fields, the syntax of the RFC 9421 headers.
sfv = "0.16"
[workspace.lints.rust]
# Only sees within a crate, and only for items that are not `pub` — rustc has
# to assume a `pub` one has a caller it cannot see. `cargo xtask lint` covers
# that half, across the workspace, where nothing is published and so the whole
# set of callers is here.
dead_code = "deny"
missing_docs = "deny"
unsafe_code = "deny"
single_use_lifetimes = "deny"
unused_lifetimes = "deny"
redundant_lifetimes = "deny"
variant_size_differences = "deny"
non_ascii_idents = "deny"
unit_bindings = "deny"
let_underscore_drop = "deny"
absolute_paths_not_starting_with_crate = "deny"
unreachable_pub = "deny"
unused_qualifications = "deny"
trivial_casts = "deny"
missing_debug_implementations = "deny"
[workspace.lints.clippy]
suspicious = { level = "deny", priority = -1 }
style = { level = "deny", priority = -1 }
complexity = { level = "deny", priority = -1 }
perf = { level = "deny", priority = -1 }
pedantic = { level = "deny", priority = -1 }
# internal workspace, not a published generic library — the standard
# HashMap/HashSet hasher is fine everywhere, so generalizing over BuildHasher
# would just be noise
implicit_hasher = "allow"
# `assert!(v.is_empty())` reads better than its suggested `assert_eq!(v, []
# as [T; 0])`, and a failing test can print the value when it matters
assert_is_empty = "allow"
# restriction lints
allow_attributes = "deny"
allow_attributes_without_reason = "deny"
as_conversions = "deny"
assertions_on_result_states = "deny"
cognitive_complexity = "deny"
dbg_macro = "deny"
debug_assert_with_mut_call = "deny"
expect_used = "deny"
float_cmp_const = "deny"
format_push_string = "deny"
get_unwrap = "deny"
indexing_slicing = "deny"
large_futures = "deny"
let_underscore_future = "deny"
let_underscore_must_use = "deny"
lossy_float_literal = "deny"
map_err_ignore = "deny"
mem_forget = "deny"
multiple_unsafe_ops_per_block = "deny"
panic = "deny"
panic_in_result_fn = "deny"
path_buf_push_overwrite = "deny"
print_stderr = "deny"
print_stdout = "deny"
rc_mutex = "deny"
string_slice = "deny"
todo = "deny"
unchecked_time_subtraction = "deny"
undocumented_unsafe_blocks = "deny"
unimplemented = "deny"
unreachable = "deny"
unused_result_ok = "deny"
unwrap_in_result = "deny"
unwrap_used = "deny"