-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
663 lines (600 loc) · 23.4 KB
/
Makefile
File metadata and controls
663 lines (600 loc) · 23.4 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
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
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
.PHONY: tests
EF_TESTS = "testing/ef_tests"
STATE_TRANSITION_VECTORS = "testing/state_transition_vectors"
EXECUTION_ENGINE_INTEGRATION = "testing/execution_engine_integration"
GIT_TAG := $(shell git describe --tags --candidates 1)
BIN_DIR = "bin"
X86_64_TAG = "x86_64-unknown-linux-gnu"
BUILD_PATH_X86_64 = "target/$(X86_64_TAG)/release"
AARCH64_TAG = "aarch64-unknown-linux-gnu"
BUILD_PATH_AARCH64 = "target/$(AARCH64_TAG)/release"
RISCV64_TAG = "riscv64gc-unknown-linux-gnu"
BUILD_PATH_RISCV64 = "target/$(RISCV64_TAG)/release"
PINNED_NIGHTLY ?= nightly
# List of features to use when cross-compiling. Can be overridden via the environment.
CROSS_FEATURES ?= gnosis,slasher-lmdb,slasher-mdbx,slasher-redb
# Cargo profile for Cross builds. Default is for local builds, CI uses an override.
CROSS_PROFILE ?= release
# List of features to use when running EF tests.
EF_TEST_FEATURES ?=
# List of features to use when running CI tests.
TEST_FEATURES ?=
# Cargo profile for regular builds.
PROFILE ?= release
# List of all hard forks. This list is used to set env variables for several tests so that
# they run for different forks.
FORKS=phase0 altair bellatrix capella deneb electra fulu gloas heze
# List of all recent hard forks. This list is used to set env variables for http_api tests
RECENT_FORKS=electra fulu gloas heze
# Extra flags for Cargo
CARGO_INSTALL_EXTRA_FLAGS?=
# Builds the vibehouse binary in release (optimized).
#
# Binaries will most likely be found in `./target/release`
install:
cargo install --path vibehouse --force --locked \
--features "$(FEATURES)" \
--profile "$(PROFILE)" \
$(CARGO_INSTALL_EXTRA_FLAGS)
# Builds the lcli binary in release (optimized).
install-lcli:
cargo install --path lcli --force --locked \
--features "$(FEATURES)" \
--profile "$(PROFILE)" \
$(CARGO_INSTALL_EXTRA_FLAGS)
# The following commands use `cross` to build a cross-compile.
#
# These commands require that:
#
# - `cross` is installed (`cargo install cross`).
# - Docker is running.
# - The current user is in the `docker` group.
#
# The resulting binaries will be created in the `target/` directory.
build-x86_64:
cross build --bin vibehouse --target x86_64-unknown-linux-gnu --features "portable,$(CROSS_FEATURES)" --profile "$(CROSS_PROFILE)" --locked
build-aarch64:
# JEMALLOC_SYS_WITH_LG_PAGE=16 tells jemalloc to support up to 64-KiB
# pages, which are commonly used by aarch64 systems.
# See: https://github.com/sigp/lighthouse/issues/5244
JEMALLOC_SYS_WITH_LG_PAGE=16 cross build --bin vibehouse --target aarch64-unknown-linux-gnu --features "portable,$(CROSS_FEATURES)" --profile "$(CROSS_PROFILE)" --locked
build-riscv64:
cross build --bin vibehouse --target riscv64gc-unknown-linux-gnu --features "portable,$(CROSS_FEATURES)" --profile "$(CROSS_PROFILE)" --locked
build-lcli-x86_64:
cross build --bin lcli --target x86_64-unknown-linux-gnu --features "portable" --profile "$(CROSS_PROFILE)" --locked
build-lcli-aarch64:
# JEMALLOC_SYS_WITH_LG_PAGE=16 tells jemalloc to support up to 64-KiB
# pages, which are commonly used by aarch64 systems.
# See: https://github.com/sigp/lighthouse/issues/5244
JEMALLOC_SYS_WITH_LG_PAGE=16 cross build --bin lcli --target aarch64-unknown-linux-gnu --features "portable" --profile "$(CROSS_PROFILE)" --locked
build-lcli-riscv64:
cross build --bin lcli --target riscv64gc-unknown-linux-gnu --features "portable" --profile "$(CROSS_PROFILE)" --locked
# extracts the current source date for reproducible builds
SOURCE_DATE := $(shell git log -1 --pretty=%ct)
# Default image for x86_64
RUST_IMAGE_AMD64 ?= rust:1.88-bullseye@sha256:8e3c421122bf4cd3b2a866af41a4dd52d87ad9e315fd2cb5100e87a7187a9816
# Reproducible build for x86_64
build-reproducible-x86_64:
DOCKER_BUILDKIT=1 docker build \
--build-arg RUST_TARGET="x86_64-unknown-linux-gnu" \
--build-arg RUST_IMAGE=$(RUST_IMAGE_AMD64) \
--build-arg SOURCE_DATE=$(SOURCE_DATE) \
-f Dockerfile.reproducible \
-t vibehouse:reproducible-amd64 .
# Default image for arm64
RUST_IMAGE_ARM64 ?= rust:1.88-bullseye@sha256:8b22455a7ce2adb1355067638284ee99d21cc516fab63a96c4514beaf370aa94
# Reproducible build for aarch64
build-reproducible-aarch64:
DOCKER_BUILDKIT=1 docker build \
--platform linux/arm64 \
--build-arg RUST_TARGET="aarch64-unknown-linux-gnu" \
--build-arg RUST_IMAGE=$(RUST_IMAGE_ARM64) \
--build-arg SOURCE_DATE=$(SOURCE_DATE) \
-f Dockerfile.reproducible \
-t vibehouse:reproducible-arm64 .
# Build both architectures
build-reproducible-all: build-reproducible-x86_64 build-reproducible-aarch64
# Create a `.tar.gz` containing a binary for a specific target.
define tarball_release_binary
cp $(1)/vibehouse $(BIN_DIR)/vibehouse
cd $(BIN_DIR) && \
tar -czf vibehouse-$(GIT_TAG)-$(2)$(3).tar.gz vibehouse && \
rm vibehouse
endef
# Create a series of `.tar.gz` files in the BIN_DIR directory, each containing
# a `vibehouse` binary for a different target.
#
# The current git tag will be used as the version in the output file names. You
# will likely need to use `git tag` and create a semver tag (e.g., `v0.2.3`).
build-release-tarballs:
[ -d $(BIN_DIR) ] || mkdir -p $(BIN_DIR)
$(MAKE) build-x86_64
$(call tarball_release_binary,$(BUILD_PATH_X86_64),$(X86_64_TAG),"")
$(MAKE) build-aarch64
$(call tarball_release_binary,$(BUILD_PATH_AARCH64),$(AARCH64_TAG),"")
$(MAKE) build-riscv64
$(call tarball_release_binary,$(BUILD_PATH_RISCV64),$(RISCV64_TAG),"")
# Runs the full workspace tests in **release**, without downloading any additional
# test vectors.
test-release:
cargo nextest run --workspace --release --features "$(TEST_FEATURES)" \
--exclude ef_tests --exclude beacon_chain --exclude slasher --exclude network \
--exclude http_api
# Runs the full workspace tests in **debug**, without downloading any additional test
# vectors.
test-debug:
cargo nextest run --workspace --features "$(TEST_FEATURES)" \
--exclude ef_tests --exclude beacon_chain --exclude network --exclude http_api
# Runs cargo-fmt (linter).
cargo-fmt:
cargo fmt --all -- --check
# Typechecks benchmark code
check-benches:
cargo check --workspace --benches --features "$(TEST_FEATURES)"
# Runs EF test vectors
run-ef-tests:
rm -rf $(EF_TESTS)/.accessed_file_log.txt
cargo nextest run --release -p ef_tests --features "ef_tests,$(EF_TEST_FEATURES)"
cargo nextest run --release -p ef_tests --features "ef_tests,$(EF_TEST_FEATURES),fake_crypto"
./$(EF_TESTS)/check_all_files_accessed.py $(EF_TESTS)/.accessed_file_log.txt $(EF_TESTS)/consensus-spec-tests
# Run the tests in the `beacon_chain` crate for all known forks.
test-beacon-chain: $(patsubst %,test-beacon-chain-%,$(FORKS))
test-beacon-chain-%:
env FORK_NAME=$* cargo nextest run --release --features "fork_from_env,slasher/lmdb,$(TEST_FEATURES)" -p beacon_chain
# Run the tests in the `http_api` crate for recent forks.
test-http-api: $(patsubst %,test-http-api-%,$(RECENT_FORKS))
test-http-api-%:
env FORK_NAME=$* cargo nextest run --release --features "beacon_chain/fork_from_env" -p http_api
# Run the tests in the `operation_pool` crate for all known forks.
test-op-pool: $(patsubst %,test-op-pool-%,$(FORKS))
test-op-pool-%:
env FORK_NAME=$* cargo nextest run --release \
--features "beacon_chain/fork_from_env,$(TEST_FEATURES)"\
-p operation_pool
# Run the tests in the `network` crate for all known forks.
test-network: $(patsubst %,test-network-%,$(FORKS))
test-network-%:
env FORK_NAME=$* cargo nextest run --release \
--features "fork_from_env,$(TEST_FEATURES)" \
-p network
# Run the tests in the `slasher` crate for all supported database backends.
test-slasher:
cargo nextest run --release -p slasher --features "lmdb,$(TEST_FEATURES)"
cargo nextest run --release -p slasher --no-default-features --features "redb,$(TEST_FEATURES)"
cargo nextest run --release -p slasher --no-default-features --features "mdbx,$(TEST_FEATURES)"
cargo nextest run --release -p slasher --features "lmdb,mdbx,redb,$(TEST_FEATURES)" # all backends enabled
# Runs only the tests/state_transition_vectors tests.
run-state-transition-tests:
make -C $(STATE_TRANSITION_VECTORS) test
# Downloads and runs the EF test vectors.
test-ef: make-ef-tests run-ef-tests
# Downloads and runs the nightly EF test vectors.
test-ef-nightly: make-ef-tests-nightly run-ef-tests
# Runs tests checking interop between Vibehouse and execution clients.
test-exec-engine:
make -C $(EXECUTION_ENGINE_INTEGRATION) test
# Runs the full workspace tests in release, without downloading any additional
# test vectors.
test: test-release
# Updates the CLI help text pages in the book, building with Docker (primarily for Windows users).
cli:
docker run --rm --user=root \
-v ${PWD}:/home/runner/actions-runner/vibehouse sigmaprime/github-runner \
bash -c 'cd vibehouse && make && ./scripts/cli.sh'
# Updates the CLI help text pages in the book, building using local `cargo`.
cli-local:
make && ./scripts/cli.sh
# Check for markdown files
mdlint:
./scripts/mdlint.sh
# Runs the entire test suite, downloading test vectors if required.
test-full: cargo-fmt test-release test-debug test-ef test-exec-engine
# Lints the code for bad style and potentially unsafe arithmetic using Clippy.
# Runs clippy with workspace-wide lints enforced as errors (327 lints, sorted, deduplicated).
lint:
cargo clippy --workspace --benches --tests $(EXTRA_CLIPPY_OPTS) --features "$(TEST_FEATURES)" -- \
-D clippy::absurd_extreme_comparisons \
-D clippy::almost_complete_range \
-D clippy::async_yields_async \
-D clippy::as_ptr_cast_mut \
-D clippy::as_underscore \
-D clippy::assigning_clones \
-D clippy::bool_comparison \
-D clippy::bool_to_int_with_if \
-D clippy::borrow_as_ptr \
-D clippy::branches_sharing_code \
-D clippy::bytes_count_to_len \
-D clippy::case_sensitive_file_extension_comparisons \
-D clippy::cast_lossless \
-D clippy::cast_ptr_alignment \
-D clippy::checked_conversions \
-D clippy::clear_with_drain \
-D clippy::clone_on_copy \
-D clippy::cloned_instead_of_copied \
-D clippy::cloned_ref_to_slice_refs \
-D clippy::collapsible_else_if \
-D clippy::collapsible_if \
-D clippy::collapsible_str_replace \
-D clippy::collection_is_never_read \
-D clippy::comparison_chain \
-D clippy::confusing_method_to_numeric_cast \
-D clippy::copy_iterator \
-D clippy::dbg_macro \
-D clippy::debug_assert_with_mut_call \
-D clippy::decimal_bitwise_operands \
-D clippy::default_trait_access \
-D clippy::deprecated_cfg_attr \
-D clippy::default_union_representation \
-D clippy::deref_addrof \
-D clippy::derive_partial_eq_without_eq \
-D clippy::disallowed_methods \
-D clippy::doc_broken_link \
-D clippy::doc_lazy_continuation \
-D clippy::double_must_use \
-D clippy::double_parens \
-D clippy::duplicate_mod \
-D clippy::elidable_lifetime_names \
-D clippy::empty_drop \
-D clippy::empty_enums \
-D clippy::empty_enum_variants_with_brackets \
-D clippy::empty_line_after_doc_comments \
-D clippy::empty_line_after_outer_attr \
-D clippy::enum_clike_unportable_variant \
-D clippy::enum_glob_use \
-D clippy::equatable_if_let \
-D clippy::explicit_deref_methods \
-D clippy::explicit_into_iter_loop \
-D clippy::explicit_iter_loop \
-D clippy::explicit_write \
-D clippy::fallible_impl_from \
-D clippy::filter_map_next \
-D clippy::flat_map_identity \
-D clippy::flat_map_option \
-D clippy::fn_params_excessive_bools \
-D clippy::fn_to_numeric_cast_any \
-D clippy::format_collect \
-D clippy::format_push_string \
-D clippy::from_iter_instead_of_collect \
-D clippy::from_over_into \
-D clippy::get_first \
-D clippy::identity_op \
-D clippy::if_not_else \
-D clippy::if_same_then_else \
-D clippy::ignore_without_reason \
-D clippy::ignored_unit_patterns \
-D clippy::implicit_clone \
-D clippy::implicit_hasher \
-D clippy::implicit_saturating_sub \
-D clippy::implied_bounds_in_impls \
-D clippy::imprecise_flops \
-D clippy::inconsistent_struct_constructor \
-D clippy::index_refutable_slice \
-D clippy::inefficient_to_string \
-D clippy::infallible_try_from \
-D clippy::inline_always \
-D clippy::into_iter_without_iter \
-D clippy::invalid_upcast_comparisons \
-D clippy::ip_constant \
-D clippy::items_after_statements \
-D clippy::iter_without_into_iter \
-D clippy::iter_filter_is_ok \
-D clippy::iter_filter_is_some \
-D clippy::iter_kv_map \
-D clippy::iter_next_slice \
-D clippy::iter_not_returning_iterator \
-D clippy::iter_on_empty_collections \
-D clippy::iter_on_single_items \
-D clippy::iter_with_drain \
-D clippy::large_digit_groups \
-D clippy::large_include_file \
-D clippy::large_stack_arrays \
-D clippy::large_stack_frames \
-D clippy::large_types_passed_by_value \
-D clippy::legacy_numeric_constants \
-D clippy::len_zero \
-D clippy::let_and_return \
-D clippy::linkedlist \
-D clippy::literal_string_with_formatting_args \
-D clippy::lossy_float_literal \
-D clippy::macro_use_imports \
-D clippy::manual_assert \
-D clippy::manual_c_str_literals \
-D clippy::manual_contains \
-D clippy::manual_clamp \
-D clippy::manual_div_ceil \
-D clippy::manual_filter_map \
-D clippy::manual_find \
-D clippy::manual_find_map \
-D clippy::manual_flatten \
-D clippy::manual_hash_one \
-D clippy::manual_ilog2 \
-D clippy::manual_is_multiple_of \
-D clippy::manual_instant_elapsed \
-D clippy::manual_midpoint \
-D clippy::manual_is_ascii_check \
-D clippy::manual_is_finite \
-D clippy::manual_is_power_of_two \
-D clippy::manual_is_variant_and \
-D clippy::manual_let_else \
-D clippy::manual_map \
-D clippy::manual_next_back \
-D clippy::manual_ok_or \
-D clippy::manual_pattern_char_comparison \
-D clippy::manual_range_contains \
-D clippy::manual_saturating_arithmetic \
-D clippy::manual_string_new \
-D clippy::manual_strip \
-D clippy::manual_while_let_some \
-D clippy::map_all_any_identity \
-D clippy::map_clone \
-D clippy::map_collect_result_unit \
-D clippy::map_entry \
-D clippy::map_flatten \
-D clippy::map_identity \
-D clippy::map_unwrap_or \
-D clippy::match_bool \
-D clippy::match_overlapping_arm \
-D clippy::match_same_arms \
-D clippy::match_single_binding \
-D clippy::match_wild_err_arm \
-D clippy::match_wildcard_for_single_variants \
-D clippy::maybe_infinite_iter \
-D clippy::mem_forget \
-D clippy::mismatching_type_param_order \
-D clippy::missing_fields_in_debug \
-D clippy::missing_safety_doc \
-D clippy::mixed_read_write_in_expression \
-D clippy::modulo_one \
-D clippy::mut_mut \
-D clippy::mut_mutex_lock \
-D clippy::naive_bytecount \
-D clippy::needless_as_bytes \
-D clippy::needless_bitwise_bool \
-D clippy::needless_bool \
-D clippy::needless_borrow \
-D clippy::needless_borrowed_reference \
-D clippy::needless_borrows_for_generic_args \
-D clippy::needless_collect \
-D clippy::needless_continue \
-D clippy::needless_for_each \
-D clippy::needless_lifetimes \
-D clippy::needless_option_as_deref \
-D clippy::needless_option_take \
-D clippy::needless_pass_by_ref_mut \
-D clippy::needless_range_loop \
-D clippy::needless_raw_string_hashes \
-D clippy::needless_raw_strings \
-D clippy::needless_return \
-D clippy::neg_cmp_op_on_partial_ord \
-D clippy::neg_multiply \
-D clippy::negative_feature_names \
-D clippy::no_effect \
-D clippy::non_send_fields_in_send_ty \
-D clippy::non_std_lazy_statics \
-D clippy::no_effect_replace \
-D clippy::no_effect_underscore_binding \
-D clippy::no_mangle_with_rust_abi \
-D clippy::nonminimal_bool \
-D clippy::nonstandard_macro_braces \
-D clippy::obfuscated_if_else \
-D clippy::option_as_ref_cloned \
-D clippy::option_map_unit_fn \
-D clippy::option_option \
-D clippy::or_fun_call \
-D clippy::panicking_unwrap \
-D clippy::partialeq_ne_impl \
-D clippy::path_buf_push_overwrite \
-D clippy::possible_missing_else \
-D clippy::ptr_arg \
-D clippy::ptr_cast_constness \
-D clippy::ptr_offset_by_literal \
-D clippy::ptr_as_ptr \
-D clippy::range_minus_one \
-D clippy::range_plus_one \
-D clippy::rc_buffer \
-D clippy::rc_mutex \
-D clippy::read_zero_byte_vec \
-D clippy::readonly_write_lock \
-D clippy::redundant_allocation \
-D clippy::redundant_at_rest_pattern \
-D clippy::redundant_clone \
-D clippy::redundant_closure \
-D clippy::redundant_iter_cloned \
-D clippy::redundant_closure_for_method_calls \
-D clippy::redundant_else \
-D clippy::redundant_feature_names \
-D clippy::redundant_guards \
-D clippy::redundant_pattern_matching \
-D clippy::redundant_type_annotations \
-D clippy::ref_as_ptr \
-D clippy::ref_binding_to_reference \
-D clippy::replace_box \
-D clippy::ref_option_ref \
-D clippy::rest_pat_in_fully_bound_structs \
-D clippy::result_map_unit_fn \
-D clippy::same_functions_in_if_condition \
-D clippy::same_length_and_capacity \
-D clippy::search_is_some \
-D clippy::self_only_used_in_recursion \
-D clippy::semicolon_if_nothing_returned \
-D clippy::set_contains_or_insert \
-D clippy::should_panic_without_expect \
-D clippy::single_range_in_vec_init \
-D clippy::single_char_add_str \
-D clippy::single_char_pattern \
-D clippy::single_component_path_imports \
-D clippy::single_match_else \
-D clippy::stable_sort_primitive \
-D clippy::str_split_at_newline \
-D clippy::string_add \
-D clippy::string_add_assign \
-D clippy::string_lit_as_bytes \
-D clippy::string_lit_chars_any \
-D clippy::suboptimal_flops \
-D clippy::suspicious_arithmetic_impl \
-D clippy::suspicious_command_arg_space \
-D clippy::suspicious_else_formatting \
-D clippy::suspicious_open_options \
-D clippy::suspicious_operation_groupings \
-D clippy::suspicious_xor_used_as_pow \
-D clippy::todo \
-D clippy::transmute_bytes_to_str \
-D clippy::transmute_ptr_to_ptr \
-D clippy::transmute_ptr_to_ref \
-D clippy::transmute_undefined_repr \
-D clippy::trivial_regex \
-D clippy::trivially_copy_pass_by_ref \
-D clippy::try_err \
-D clippy::tuple_array_conversions \
-D clippy::type_id_on_box \
-D clippy::unchecked_time_subtraction \
-D clippy::undocumented_unsafe_blocks \
-D clippy::unicode_not_nfc \
-D clippy::uninhabited_references \
-D clippy::uninlined_format_args \
-D clippy::unit_arg \
-D clippy::unnecessary_box_returns \
-D clippy::unnecessary_cast \
-D clippy::unnecessary_debug_formatting \
-D clippy::unnecessary_fallible_conversions \
-D clippy::unnecessary_filter_map \
-D clippy::unnecessary_get_then_check \
-D clippy::unnecessary_join \
-D clippy::unnecessary_lazy_evaluations \
-D clippy::unnecessary_literal_bound \
-D clippy::unnecessary_map_on_constructor \
-D clippy::unnecessary_option_map_or_else \
-D clippy::unnecessary_min_or_max \
-D clippy::unnecessary_operation \
-D clippy::unnecessary_safety_doc \
-D clippy::unnecessary_semicolon \
-D clippy::unnecessary_self_imports \
-D clippy::unsafe_derive_deserialize \
-D clippy::unnecessary_struct_initialization \
-D clippy::unnecessary_to_owned \
-D clippy::unnecessary_wraps \
-D clippy::unnested_or_patterns \
-D clippy::unreadable_literal \
-D clippy::unused_async \
-D clippy::unused_io_amount \
-D clippy::unused_peekable \
-D clippy::unused_rounding \
-D clippy::unused_result_ok \
-D clippy::unused_self \
-D clippy::used_underscore_items \
-D clippy::useless_asref \
-D clippy::useless_concat \
-D clippy::useless_conversion \
-D clippy::useless_format \
-D clippy::useless_let_if_seq \
-D clippy::useless_vec \
-D clippy::vec_init_then_push \
-D clippy::verbose_bit_mask \
-D clippy::verbose_file_reads \
-D clippy::while_let_on_iterator \
-D clippy::wildcard_in_or_patterns \
-D clippy::zero_prefixed_literal \
-D clippy::zero_repeat_side_effects \
-D clippy::zero_sized_map_values \
-D clippy::zombie_processes \
-D clippy::doc_overindented_list_items \
-D clippy::float_cmp_const \
-D clippy::four_forward_slashes \
-D clippy::into_iter_on_ref \
-D clippy::manual_inspect \
-D clippy::manual_is_infinite \
-D clippy::manual_unwrap_or \
-D clippy::manual_unwrap_or_default \
-D clippy::mutex_integer \
-D clippy::needless_character_iteration \
-D clippy::needless_return_with_question_mark \
-D clippy::permissions_set_readonly_false \
-D clippy::redundant_closure_call \
-D clippy::seek_from_current \
-D clippy::seek_to_start_instead_of_rewind \
-D clippy::suspicious_to_owned \
-D clippy::trailing_empty_array \
-D clippy::doc_link_with_quotes \
-D clippy::filter_map_bool_then \
-D clippy::items_after_test_module \
-D clippy::mutex_atomic \
-D clippy::pub_underscore_fields \
-D clippy::almost_swapped \
-D clippy::approx_constant \
-D clippy::await_holding_lock \
-D clippy::await_holding_refcell_ref \
-D clippy::box_collection \
-D clippy::box_default \
-D clippy::char_lit_as_u8 \
-D clippy::crosspointer_transmute \
-D clippy::derive_ord_xor_partial_ord \
-D clippy::diverging_sub_expression \
-D double_negations \
-D clippy::drain_collect \
-D clippy::drop_non_drop \
-D clippy::duration_subsec \
-D clippy::empty_loop \
-D clippy::erasing_op \
-D clippy::fn_to_numeric_cast_with_truncation \
-D clippy::if_let_mutex \
-D clippy::invalid_regex \
-D clippy::mistyped_literal_suffixes \
-D clippy::mutable_key_type \
-D clippy::needless_question_mark \
-D clippy::never_loop \
-D clippy::out_of_bounds_indexing \
-D clippy::panicking_overflow_checks \
-D clippy::path_ends_with_ext \
-D clippy::size_of_ref \
-D clippy::slow_vector_initialization \
-D clippy::suspicious_map \
-D clippy::temporary_assignment \
-D clippy::transmuting_null \
-D clippy::unchecked_time_subtraction \
-D clippy::unconditional_recursion \
-D clippy::uninit_vec \
-D clippy::unit_return_expecting_ord \
-D clippy::unnecessary_sort_by \
-D clippy::unsound_collection_transmute \
-D clippy::vec_box \
-D clippy::while_immutable_condition \
-D clippy::wildcard_dependencies \
-D clippy::wrong_transmute \
-D warnings
# Lints the code using Clippy and automatically fix some simple compiler warnings.
lint-fix:
EXTRA_CLIPPY_OPTS="--fix --allow-staged --allow-dirty" $(MAKE) lint-full
# Also run the lints on the optimized-only tests
lint-full:
RUSTFLAGS="-C debug-assertions=no -W unreachable_pub $(RUSTFLAGS)" $(MAKE) lint
# Runs the makefile in the `ef_tests` repo.
#
# May download and extract an archive of test vectors from the ethereum
# repositories. At the time of writing, this was several hundred MB of
# downloads which extracts into several GB of test vectors.
make-ef-tests:
make -C $(EF_TESTS)
# Download/extract the nightly EF test vectors.
make-ef-tests-nightly:
CONSENSUS_SPECS_TEST_VERSION=nightly make -C $(EF_TESTS)
# Verifies that crates compile with fuzzing features enabled
arbitrary-fuzz:
cargo check -p state_processing --features arbitrary-fuzz,$(TEST_FEATURES)
cargo check -p slashing_protection --features arbitrary-fuzz,$(TEST_FEATURES)
# Runs cargo audit (Audit Cargo.lock files for crates with security vulnerabilities reported to the RustSec Advisory Database)
audit: install-audit audit-CI
install-audit:
cargo install --force cargo-audit
audit-CI:
cargo audit
# Runs `cargo vendor` to make sure dependencies can be vendored for packaging, reproducibility and archival purpose.
vendor:
cargo vendor
# Runs `cargo udeps` to check for unused dependencies
udeps:
cargo +$(PINNED_NIGHTLY) udeps --tests --all-targets --release --features "$(TEST_FEATURES)"
# Performs a `cargo` clean and cleans the `ef_tests` directory.
clean:
cargo clean
make -C $(EF_TESTS) clean
make -C $(STATE_TRANSITION_VECTORS) clean