forked from grandinetech/grandine
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Cargo.toml
563 lines (537 loc) · 19.6 KB
/
Cargo.toml
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
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
[workspace]
members = [
'ad_hoc_bench',
'allocator',
'arithmetic',
'attestation_verifier',
'benches',
'binary_utils',
'block_producer',
'bls',
'builder_api',
'clock',
'database',
'deposit_tree',
'directories',
'doppelganger_protection',
'eip_2335',
'eip_7594',
'eth1',
'eth1_api',
'eth2_cache_utils',
'execution_engine',
'factory',
'features',
'fork_choice_control',
'fork_choice_store',
'genesis',
'grandine',
'grandine_version',
'hashing',
'helper_functions',
'http_api',
'http_api_utils',
'interop',
'keymanager',
'kzg_utils',
'liveness_tracker',
'logging',
'metrics',
'operation_pools',
'p2p',
'panics',
'predefined_chains',
'prometheus_metrics',
'runtime',
'serde_utils',
'shuffling',
'signer',
'slasher',
'slashing_protection',
'snapshot_test_utils',
'spec_test_utils',
'ssz',
'ssz_derive',
'state_cache',
'std_ext',
'transition_functions',
'try_from_iterator',
'types',
'validator',
'validator_key_cache',
]
# Feature resolver version 2 is the default starting with Rust 2021, but that does not apply in
# virtual workspaces. Starting with Rust 1.72.0, Cargo warns if a Rust 2021 virtual workspace does
# not explicitly specify a feature resolver. See <https://github.com/rust-lang/cargo/pull/10910>.
resolver = '2'
[workspace.package]
edition = '2021'
[workspace.lints.rust]
unsafe_code = 'forbid'
# A subset of `rustc` lints that are allowed by default.
# A few notable ones that we do not enable:
#
# - `elided_lifetimes_in_paths`
# It hurts readability and doesn't provide a clear benefit.
#
# - `keyword_idents_2024`
# Starting with Rust 1.79.0, uses of `rand::Rng::gen` trigger `keyword_idents_2024`.
# `rand` has renamed the method to `random`, but the change has not been released. See:
# - <https://github.com/rust-random/rand/issues/1435>
# - <https://github.com/rust-random/rand/pull/1438>
#
# - `missing_copy_implementations`
# This would be more useful if it only triggered for types that are `Clone` but not `Copy`.
#
# - `variant_size_differences`
# `clippy::large_enum_variant` does nearly the same thing and is enabled by default.
#
# See the output of `rustc --warn help` for a full list of lints available in the current version.
# They are documented at <https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html>.
absolute_paths_not_starting_with_crate = 'warn'
anonymous_parameters = 'warn'
deprecated_in_future = 'warn'
deprecated_safe = 'warn'
keyword_idents_2018 = 'warn'
let_underscore_drop = 'warn'
macro_use_extern_crate = 'warn'
meta_variable_misuse = 'warn'
missing_unsafe_on_extern = 'warn'
non_ascii_idents = 'warn'
non_local_definitions = 'warn'
redundant_lifetimes = 'warn'
trivial_casts = 'warn'
trivial_numeric_casts = 'warn'
unit_bindings = 'warn'
unused_crate_dependencies = 'warn'
unused_extern_crates = 'warn'
unused_import_braces = 'warn'
unused_lifetimes = 'warn'
unused_macro_rules = 'warn'
unused_qualifications = 'warn'
[workspace.lints.clippy]
# Additional Clippy lint groups.
nursery = 'warn'
pedantic = 'warn'
# A subset of the `clippy::cargo` group.
negative_feature_names = 'warn'
redundant_feature_names = 'warn'
wildcard_dependencies = 'warn'
# A subset of the `clippy::restriction` group.
# Some notable lints from it that we do not enable:
#
# - `clippy::absolute_paths`
# It is triggered by functions, which contradicts the Rust convention of qualifying them.
#
# - `clippy::arithmetic_side_effects`
# It's the static equivalent of `overflow-checks` in `Cargo.toml`, but it hurts readability.
#
# - `clippy::error_impl_error`
# It's unidiomatic.
#
# - `clippy::infinite_loop`
# It is triggered by functions that return `core::convert::Infallible` or
# types parameterized with it like `anyhow::Result<core::convert::Infallible>`.
#
# - `clippy::integer_division_remainder_used`
# Most of our code is not cryptographic.
#
# - `clippy::iter_over_hash_type`
# Iteration order often does not matter.
# `HashMap`s and `HashSet`s tend to be faster than their ordered counterparts.
# On the other hand, enabling this produces surprisingly few warnings.
# We could easily rewrite the offending code to pass.
#
# - `clippy::min_ident_chars`
# It's unidiomatic.
# It's even triggered by identifiers imported from other crates.
#
# - `clippy::mem_forget`
# Setting it to deny (as opposed to forbid) makes no sense.
# `core::mem::forget` is impossible to use by mistake.
#
# - `clippy::renamed_function_params`
# It's unidiomatic.
#
# - `clippy::single_call_fn`.
# It's unidiomatic and conflicts with lints like `clippy::too_many_lines`.
# Public functions are not exempt from it if `avoid-breaking-exported-api` is `false`.
#
# - `clippy::std_instead_of_alloc`
# It would require adding `extern crate alloc;` everywhere.
#
# - `clippy::tests_outside_test_module`
# It is triggered by integration tests.
#
# - `clippy::unimplemented`
# It's useful to leave some trait methods unimplemented.
alloc_instead_of_core = 'warn'
allow_attributes = 'warn'
allow_attributes_without_reason = 'warn'
assertions_on_result_states = 'warn'
clone_on_ref_ptr = 'warn'
dbg_macro = 'warn'
decimal_literal_representation = 'warn'
empty_drop = 'warn'
empty_enum_variants_with_brackets = 'warn'
empty_structs_with_brackets = 'warn'
filetype_is_file = 'warn'
float_arithmetic = 'warn'
float_cmp_const = 'warn'
format_push_string = 'warn'
get_unwrap = 'warn'
host_endian_bytes = 'warn'
if_then_some_else_none = 'warn'
lossy_float_literal = 'warn'
missing_asserts_for_indexing = 'warn'
mixed_read_write_in_expression = 'warn'
multiple_inherent_impl = 'warn'
mutex_atomic = 'warn'
needless_raw_strings = 'warn'
partial_pub_fields = 'warn'
print_stderr = 'warn'
print_stdout = 'warn'
pub_without_shorthand = 'warn'
rc_buffer = 'warn'
rc_mutex = 'warn'
redundant_type_annotations = 'warn'
rest_pat_in_fully_bound_structs = 'warn'
same_name_method = 'warn'
semicolon_inside_block = 'warn'
std_instead_of_core = 'warn'
str_to_string = 'warn'
string_add = 'warn'
string_lit_chars_any = 'warn'
string_slice = 'warn'
string_to_string = 'warn'
todo = 'warn'
# Enable `clippy::undocumented_unsafe_blocks` in case we ever change our stance on unsafe code.
undocumented_unsafe_blocks = 'warn'
unnecessary_self_imports = 'warn'
unwrap_used = 'warn'
verbose_file_reads = 'warn'
# These are almost never helpful.
assertions_on_constants = { level = 'allow', priority = 1 }
map_unwrap_or = { level = 'allow', priority = 1 }
option_if_let_else = { level = 'allow', priority = 1 }
single_match_else = { level = 'allow', priority = 1 }
struct_field_names = { level = 'allow', priority = 1 }
# These are almost never helpful and require boilerplate.
into_iter_without_iter = { level = 'allow', priority = 1 }
len_without_is_empty = { level = 'allow', priority = 1 }
# `derivative::Derivative` and `fixed_hash::construct_fixed_hash!` generate code that triggers these.
# It is not just a bug in the macros.
# `clippy::expl_impl_clone_on_copy` produces false positives for types with type parameters.
# See <https://github.com/rust-lang/rust-clippy/issues/1254>.
# <https://github.com/rust-lang/rust-clippy/pull/6993> did not fix the issue.
# `clippy::incorrect_clone_impl_on_copy_type` does not have the same problem.
# `derivative` has open issues for 2 of the lints:
# - <https://github.com/mcarton/rust-derivative/issues/112>
# - <https://github.com/mcarton/rust-derivative/issues/115>
expl_impl_clone_on_copy = { level = 'allow', priority = 1 }
non_canonical_clone_impl = { level = 'allow', priority = 1 }
non_canonical_partial_ord_impl = { level = 'allow', priority = 1 }
# `clippy::implicit_hasher` has next to no benefit and sometimes requires nonlocal changes to code.
implicit_hasher = { level = 'allow', priority = 1 }
# `clippy::semicolon_if_nothing_returned` can lead to return values accidentally being left unused.
semicolon_if_nothing_returned = { level = 'allow', priority = 1 }
# `clippy::significant_drop_in_scrutinee` produces mostly false positives. See:
# - <https://github.com/rust-lang/rust-clippy/issues/8963>
# - <https://github.com/rust-lang/rust-clippy/issues/8987>
# - <https://github.com/rust-lang/rust-clippy/issues/9072>
significant_drop_in_scrutinee = { level = 'allow', priority = 1 }
# `clippy::significant_drop_tightening` often produces false positives.
# See <https://github.com/rust-lang/rust-clippy/issues/10413>.
significant_drop_tightening = { level = 'allow', priority = 1 }
# Some functions in the codebase trigger `clippy::large_stack_frames`, but the lint does not
# report which ones, making it nearly useless. The lint does report which crates they are in,
# but only after checking other crates, which suggests it is triggered by generic functions.
large_stack_frames = { level = 'allow', priority = 1 }
# This does not improve performance in any of our benchmarks. See discussions at:
# - <https://github.com/rust-lang/rust/issues/52274>
# - <https://github.com/rust-lang/rust-clippy/issues/4499>
large_types_passed_by_value = { level = 'allow', priority = 1 }
missing_errors_doc = { level = 'allow', priority = 1 }
missing_panics_doc = { level = 'allow', priority = 1 }
[workspace.lints.rustdoc]
private_intra_doc_links = 'allow'
[workspace.dependencies]
aes = { version = '0.8', features = ['zeroize'] }
anyhow = { version = '1', features = ['backtrace'] }
arc-swap = '1'
assert-json-diff = '2'
async-channel = '1'
async-trait = '0.1'
asynchronous-codec = '0.7'
axum = { version = '0.7' }
axum-extra = { version = '0.9', features = ['typed-header', 'query'] }
base64 = '0.22'
bincode = '1'
bit_field = '0.10'
bitvec = '1'
blst = { version = '0.3', features = ['portable'] }
bstr = '1'
build-time = '0.1'
byteorder = '1'
bytes = '1'
bytesize = { version = '1', features = ['serde'] }
cached = '0.53'
chrono = '0.4'
clap = { version = '4', features = ['derive'] }
const_format = '0.2'
constant_time_eq = '0.3'
conv = '0.3'
criterion = '0.5'
crossbeam-skiplist = '0.1'
crossbeam-utils = '0.8'
ctr = { version = '0.9', features = ['zeroize'] }
darling = '0.20'
dedicated_executor = { path = 'dedicated_executor' }
delay_map = '0.4'
derivative = '2'
derive_more = { version = '1', features = ["full"] }
dirs = '5'
discv5 = { version = '0.4', features = ['libp2p'] }
drain_filter_polyfill = '0.1'
duplicate = '1'
easy-ext = '1'
either = '1'
enum-iterator = '2'
enum-map = '2'
enumset = '1'
env_logger = '0.11'
ethereum-types = '0.14'
fixed-hash = '0.8.0'
fnv = '1'
fs-err = { version = '2', features = ['tokio'] }
fs_extra = '1'
futures = '0.3'
futures-ticker = '0.0.3'
futures-timer = '3'
generic-array = { version = '0.14', features = ['serde'] }
getrandom = '0.2'
git-version = '0.3'
glob = '0.3'
good_lp = { version = '1', default-features = false, features = ['highs'] }
hash_hasher = '2'
hex = { version = '0.4', features = ['serde'] }
hex-literal = '0.4'
hex_fmt = '0.3'
hmac = '0.12'
http = '1'
http-body-util = '0.1'
httparse = '1'
httpmock = '0.7'
hyper = '1'
igd-next = '0.15'
# Possible optimization: fork `im` and make it use `triomphe`.
# It's easy to do, but the amount of memory it saves is negligible.
im = '15'
impl-serde = '0.4'
integer-sqrt = '0.1'
instant = '0.1'
itertools = '0.13'
jemalloc-ctl = '0.5'
jemallocator = '0.5'
jwt-simple = { version = '0.12', default-features = false, features = ['pure-rust'] }
kzg = { git = 'https://github.com/grandinetech/rust-kzg.git', branch = 'integration-raw' }
lazy_static = '1'
libmdbx = { git = 'https://github.com/paradigmxyz/reth.git', package = 'reth-libmdbx', rev = 'c228fe15808c3acbf18dc3af1a03ef5cbdcda07a' }
libp2p = { version = '0.53', default-features = false, features = ['metrics', 'dns', 'ecdsa', 'identify', 'macros', 'noise', 'plaintext', 'secp256k1', 'serde', 'tcp', 'tokio', 'yamux', 'quic', 'upnp'] }
libp2p-mplex = '0.41'
log = '0.4'
lru = '0.12'
mediatype = '0.19'
memoffset = '0.9'
mime = '0.3'
nonzero_ext = '0.3'
num-bigint = '0.4'
num-integer = '0.1'
num-traits = '0.2'
num_cpus = '1'
num_threads = '0.1'
once_cell = '1'
openssl = '0.10'
parking_lot = '0.12'
parse-display = '0.10'
pathdiff = '0.2'
pbkdf2 = '0.12'
primitive-types = '0.12'
proc-macro-crate = '3'
proc-macro2 = '1'
prometheus = '0.13'
prometheus-client = '0.22'
psutil = '3'
quick-protobuf = '0.8'
quick-protobuf-codec = '0.3'
quickcheck = '1'
quickcheck_macros = '1'
quote = '1'
rand = '0.8'
rayon = '1'
rc-box = '1'
# Currently refinery does not support rusqlite version 0.32
refinery = { git = 'https://github.com/manuteleco/refinery.git', rev = '63f3c39a8adb40e9e7b7f9c8b21a4fee2d685e3d', features = ['rusqlite'] }
regex = '1'
replace_with = '0.1'
reqwest = { version = '0.12', features = ['json', 'native-tls-vendored'] }
rusqlite = { version = '0.32', features = ['bundled'] }
rust-kzg-blst = { git = 'https://github.com/grandinetech/rust-kzg.git', branch = 'integration-raw' }
scrypt = '0.11'
semver = '1'
serde = { version = '1', features = ['derive', 'rc'] }
serde-aux = '4'
serde_json = { version = '1', features = ['preserve_order'] }
serde_qs = { version = '0.13', features = ['axum'] }
serde_repr = '0.1'
serde_with = '3'
# TODO: replace serde_yaml with alternative, since it is deprecated:
# https://users.rust-lang.org/t/serde-yaml-deprecation-alternatives/108868/18
serde_yaml = '0.9'
# The `asm` feature in `sha2` doesn't do anything on recent `x86_64` CPUs
# because `sha2` defaults to using CPU intrinsics.
sha2 = { version = '0.10', features = ['compress'] }
slog = { version = '2', features = ['max_level_trace'] }
slog-async = '2'
slog-stdlog = '4'
slog-term = '2'
smallvec = { version = '1', features = ['serde', 'union'] }
snap = '1'
static_assertions = '1'
strum = { version = '0.26', features = ['derive'] }
syn = { version = '2', features = ['full'] }
sysinfo = '0.31'
tap = '1'
tempfile = '3'
test-case = '3'
test-generator = '0.3'
testing_logger = '0.1'
thiserror = '1'
tiny-keccak = '2'
tokio = { version = '1', features = ['fs', 'macros', 'rt-multi-thread', 'signal', 'sync', 'time'] }
tokio-io-timeout = '1'
tokio-stream = { version = '0.1', features = ['sync'] }
tokio-util = { version = '0.7', features = ['codec', 'compat', 'time'] }
tower = { version = '0.5', features = ['timeout'] }
tower-http = { version = '0.5', features = ['cors', 'trace'] }
tracing = '0.1'
triomphe = '0.1'
tynm = '0.1'
typenum = '1'
unicode-normalization = '0.1'
unsigned-varint = { version = '= 0.8', features = ['codec'] }
unwrap_none = '0.1'
url = '2'
uuid = { version = '1', features = ['serde', 'v4'] }
variant_count = '1'
void = '1'
web3 = { git = 'https://github.com/grandinetech/rust-web3.git' }
zeroize = { version = '1', features = ['derive', 'serde'] }
allocator = { path = 'allocator' }
arithmetic = { path = 'arithmetic' }
attestation_verifier = { path = 'attestation_verifier' }
binary_utils = { path = 'binary_utils' }
block_producer = { path = 'block_producer' }
bls = { path = 'bls' }
builder_api = { path = 'builder_api' }
clock = { path = 'clock' }
database = { path = 'database' }
deposit_tree = { path = 'deposit_tree' }
directories = { path = 'directories' }
doppelganger_protection = { path = 'doppelganger_protection' }
eip_2335 = { path = 'eip_2335' }
eip_7594 = { path = 'eip_7594' }
eth1 = { path = 'eth1' }
eth1_api = { path = 'eth1_api' }
eth2_cache_utils = { path = 'eth2_cache_utils' }
eth2_libp2p = { path = 'eth2_libp2p' }
execution_engine = { path = 'execution_engine' }
factory = { path = 'factory' }
features = { path = 'features' }
fork_choice_control = { path = 'fork_choice_control' }
fork_choice_store = { path = 'fork_choice_store' }
genesis = { path = 'genesis' }
gossipsub = { path = 'eth2_libp2p/gossipsub', features = ['serde'] }
grandine_version = { path = 'grandine_version' }
hashing = { path = 'hashing' }
helper_functions = { path = 'helper_functions' }
http_api = { path = 'http_api' }
http_api_utils = { path = 'http_api_utils' }
interop = { path = 'interop' }
keymanager = { path = 'keymanager' }
kzg_utils = { path = 'kzg_utils' }
liveness_tracker = { path = 'liveness_tracker' }
logging = { path = 'logging' }
metrics = { path = 'metrics' }
operation_pools = { path = 'operation_pools' }
p2p = { path = 'p2p' }
panics = { path = 'panics' }
predefined_chains = { path = 'predefined_chains' }
prometheus_metrics = { path = 'prometheus_metrics' }
runtime = { path = 'runtime' }
serde_utils = { path = 'serde_utils' }
shuffling = { path = 'shuffling' }
signer = { path = 'signer' }
slasher = { path = 'slasher' }
slashing_protection = { path = 'slashing_protection' }
snapshot_test_utils = { path = 'snapshot_test_utils' }
spec_test_utils = { path = 'spec_test_utils' }
ssz = { path = 'ssz' }
ssz_derive = { path = 'ssz_derive' }
state_cache = { path = 'state_cache' }
std_ext = { path = 'std_ext' }
transition_functions = { path = 'transition_functions' }
try_from_iterator = { path = 'try_from_iterator' }
types = { path = 'types' }
validator = { path = 'validator' }
validator_key_cache = { path = 'validator_key_cache' }
# Banned crates
#
# `educe` version 0.4 had multiple bugs we had to work around.
# `educe` version 0.5 fixed them, but also made it impossible to specify
# different bounds for type parameters in `Clone` and `Copy` impls.
# Use the `derivative` crate or write impls manually.
# `derivative` is unmaintained but less buggy than `educe`.
educe = '<0.0.0'
# `owning_ref` is unsound and unmaintained:
# - <https://github.com/Kimundi/owning-ref-rs/issues/61>
# - <https://github.com/Kimundi/owning-ref-rs/issues/71>
# - <https://github.com/Kimundi/owning-ref-rs/issues/77>
# - <https://github.com/Kimundi/owning-ref-rs/issues/81>
#
# Use one of the following crates instead:
# - `reffers`
# - `rental`
owning_ref = '<0.0.0'
# `serde-hex` is prone to failing at runtime due to its reliance on zero-copy deserialization.
# It's also unsound:
# <https://github.com/fspmarshall/serde-hex/blob/4e2d830d39ebda7655dc2d7b34dfe81105df05d8/src/lib.rs#L113-L116>
#
# Use one of the following crates instead:
# - `serde_utils`
# - `hex`
# - `hex_fmt`
serde-hex = '<0.0.0'
[profile.release]
debug = 'full'
overflow-checks = true
[profile.bench]
overflow-checks = true
[profile.compact]
inherits = 'release'
# 708 MiB -> 105 MiB at the time of writing.
# This makes file names and line numbers unavailable in backtraces.
# Some stack frames disappear, but the ones that remain should still have identifiers.
debug = 'none'
# 105 MiB -> 90 MiB
lto = true
# 90 MiB -> 86 MiB
codegen-units = 1
# 86 MiB -> 88 MiB
# Optimizing for size previously caused a significant decrease in performance (and might still do).
# It actually makes the executable bigger now.
# opt-level = 's'
[patch.crates-io]
# `geth` responds to invalid payloads with objects containing `method` and `params`.
# We had to fork `jsonrpc` because it does not allow nonstandard members.
jsonrpc-core = { git = 'https://github.com/grandinetech/jsonrpc.git' }