-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
159 lines (123 loc) · 4.44 KB
/
Justfile
File metadata and controls
159 lines (123 loc) · 4.44 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
set positional-arguments := true
set dotenv-filename := ".env.devnet"
alias t := test
alias f := fix
alias b := build
alias be := benches
alias c := clean
alias h := hack
alias u := check-udeps
alias wt := watch-test
alias wc := watch-check
# Default to display help menu
default:
@just --list
# Runs all ci checks
ci: fix check lychee zepter
# Performs lychee checks, installing the lychee command if necessary
lychee:
@command -v lychee >/dev/null 2>&1 || cargo install lychee
lychee --config ./lychee.toml .
# Checks formatting, udeps, clippy, and tests
check: check-format check-udeps check-clippy test check-deny
# Runs cargo deny to check dependencies
check-deny:
@command -v cargo-deny >/dev/null 2>&1 || cargo install cargo-deny
cargo deny check bans --hide-inclusion-graph
# Fixes formatting and clippy issues
fix: format-fix clippy-fix zepter-fix
# Runs zepter feature checks, installing zepter if necessary
zepter:
@command -v zepter >/dev/null 2>&1 || cargo install zepter
zepter --version
zepter format features
zepter
# Fixes zepter feature formatting.
zepter-fix:
@command -v zepter >/dev/null 2>&1 || cargo install zepter
zepter format features --fix
# Runs tests across workspace with all features enabled
test: build-contracts
@command -v cargo-nextest >/dev/null 2>&1 || cargo install cargo-nextest
RUSTFLAGS="-D warnings" cargo nextest run --workspace --all-features
# Runs cargo hack against the workspace
hack:
cargo hack check --feature-powerset --no-dev-deps
# Checks formatting
check-format:
cargo +nightly fmt --all -- --check
# Fixes any formatting issues
format-fix:
cargo fix --allow-dirty --allow-staged --workspace
cargo +nightly fmt --all
# Checks clippy
check-clippy: build-contracts
cargo clippy --workspace --all-targets -- -D warnings
# Fixes any clippy issues
clippy-fix:
cargo clippy --workspace --all-targets --fix --allow-dirty --allow-staged
# Builds the workspace with release
build:
cargo build --workspace --release
# Builds all targets in debug mode
build-all-targets: build-contracts
cargo build --workspace --all-targets
# Builds the workspace with maxperf
build-maxperf:
cargo build --workspace --profile maxperf --features jemalloc
# Builds the base node binary
build-node:
cargo build --bin base-reth-node
# Build the contracts used for tests
build-contracts:
cd crates/shared/primitives/contracts && forge soldeer install && forge build
# Cleans the workspace
clean:
cargo clean
# Checks if there are any unused dependencies
check-udeps: build-contracts
@command -v cargo-udeps >/dev/null 2>&1 || cargo install cargo-udeps
cargo +nightly udeps --workspace --all-features --all-targets
# Checks that shared crates don't depend on client crates
check-crate-deps:
./scripts/ci/check-crate-deps.sh
# Watches tests
watch-test: build-contracts
cargo watch -x test
# Watches checks
watch-check:
cargo watch -x "fmt --all -- --check" -x "clippy --all-targets -- -D warnings" -x test
# Runs all benchmarks
benches:
@just bench-flashblocks
# Runs flashblocks pending state benchmarks
bench-flashblocks:
cargo bench -p base-flashblocks --bench pending_state
# Stops devnet, deletes data, and starts fresh
devnet: devnet-down
docker compose --env-file .env.devnet -f docker/docker-compose.yml up -d --build --scale contender=0
# Stops devnet and deletes all data
devnet-down:
-docker compose --env-file .env.devnet -f docker/docker-compose.yml down
rm -rf .devnet
# Shows devnet block numbers and sync status
devnet-status:
./scripts/devnet/status.sh
# Shows funded test accounts with live balances and nonces
devnet-accounts:
./scripts/devnet/accounts.sh
# Sends test transactions to L1 and L2
devnet-smoke:
./scripts/devnet/smoke.sh
# Runs full devnet checks (status + smoke tests)
devnet-checks: devnet-status devnet-smoke
# Starts the contender load generator
devnet-load:
docker compose -f docker/docker-compose.yml up -d --no-deps contender
# Stream FB's from the builder via websocket
devnet-flashblocks:
@command -v flashblocks-websocket-client >/dev/null 2>&1 || go install github.com/danyalprout/flashblocks-websocket-client@latest
flashblocks-websocket-client ws://localhost:${L2_BUILDER_FLASHBLOCKS_PORT}
# Stream logs from devnet containers (optionally specify container names)
devnet-logs *containers:
docker compose --env-file .env.devnet -f docker/docker-compose.yml logs -f {{containers}}