Skip to content

Commit e9f0f4b

Browse files
authored
Merge branch 'main' into hpp59
2 parents ac0df2d + e0d7522 commit e9f0f4b

File tree

159 files changed

+4629
-4508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+4629
-4508
lines changed

.github/scripts/flamegraph_watcher.sh

100644100755
Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
#!/bin/bash
2+
set -e
23

3-
# This script sends 171 * <iterations> transactions to a test account, per defined private key
4-
# then polls the account balance until the expected balance has been reached
5-
# and then kills the process. It also measures the elapsed time of the test and
6-
# outputs it to Github Action's outputs.
7-
iterations=3500
8-
value=1
9-
account=0x33c6b73432B3aeA0C1725E415CC40D04908B85fd
10-
end_val=$((171 * $iterations * $value))
4+
# This script runs a load test and then kills the node under test. The load test sends a
5+
# transaction from each rich account to a random one, so we can check their nonce to
6+
# determine that the load test finished.
7+
#
8+
# Usage:
9+
# ./flamegraph_watcher.sh
10+
# Requires a PROGRAM variable to be set (e.g. ethrex). This $PROGRAM will be killed when the
11+
# load test finishes. Must be run from the context of the repo root.
1112

12-
start_time=$(date +%s)
13-
ethrex_l2 test load --path /home/runner/work/ethrex/ethrex/test_data/private_keys.txt -i $iterations -v --value $value --to $account >/dev/null
13+
# TODO(#2486): Move this to a cached build outside.
14+
echo "Building load test"
15+
cargo build --release --manifest-path ./cmd/load_test/Cargo.toml
1416

15-
output=$(ethrex_l2 info -b -a $account --wei 2>&1)
16-
echo "balance: $output"
17-
while [[ $output -lt $end_val ]]; do
18-
sleep 2
19-
output=$(ethrex_l2 info -b -a $account --wei 2>&1)
20-
echo "balance: $output"
21-
done
17+
echo "Starting load test"
18+
start_time=$(date +%s)
19+
RUST_BACKTRACE=1 ./target/release/load_test -k ./test_data/private_keys.txt -t eth-transfers -N 1000 -n http://localhost:1729 -w 5 >/dev/null
2220
end_time=$(date +%s)
23-
elapsed=$((end_time - start_time))
2421

22+
elapsed=$((end_time - start_time))
2523
minutes=$((elapsed / 60))
2624
seconds=$((elapsed % 60))
27-
output=$(ethrex_l2 info -b -a $account --wei 2>&1)
28-
echo "Balance of $output reached in $minutes min $seconds s, killing process"
25+
echo "All load test transactions included in $minutes min $seconds s, killing node process."
2926

3027
echo killing "$PROGRAM"
3128
sudo pkill "$PROGRAM"

.github/workflows/common_hive_reports.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ on:
1212
required: true
1313
type: string
1414

15-
env:
16-
CARGO_TERM_COLOR: always
17-
1815
jobs:
1916
run-hive:
2017
name: Hive (${{ inputs.evm }}) - ${{ matrix.test.name }}

.github/workflows/daily_loc.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ jobs:
5555
${{ github.event_name == 'workflow_dispatch'
5656
&& secrets.TEST_CHANNEL_SLACK
5757
|| format(
58-
'{0} {1} {2}',
58+
'{0} {1}',
5959
secrets.ETHREX_L1_SLACK_WEBHOOK,
60-
secrets.ETHREX_L2_SLACK_WEBHOOK,
61-
secrets.LEVM_SLACK_WEBHOOK
60+
secrets.ETHREX_L2_SLACK_WEBHOOK
6261
)
6362
}}
6463
run: |

.github/workflows/daily_reports.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ jobs:
5353
${{ github.event_name == 'workflow_dispatch'
5454
&& secrets.TEST_CHANNEL_SLACK
5555
|| format(
56-
'{0} {1} {2}',
56+
'{0} {1}',
5757
secrets.ETHREX_L1_SLACK_WEBHOOK,
58-
secrets.ETHREX_L2_SLACK_WEBHOOK,
59-
secrets.LEVM_SLACK_WEBHOOK
58+
secrets.ETHREX_L2_SLACK_WEBHOOK
6059
)
6160
}}
6261
run: |
@@ -72,8 +71,8 @@ jobs:
7271
&& secrets.TEST_CHANNEL_SLACK
7372
|| format(
7473
'{0} {1}',
75-
secrets.ETHREX_L2_SLACK_WEBHOOK,
76-
secrets.LEVM_SLACK_WEBHOOK
74+
secrets.ETHREX_L1_SLACK_WEBHOOK,
75+
secrets.ETHREX_L2_SLACK_WEBHOOK
7776
)
7877
}}
7978
run: |
@@ -87,7 +86,7 @@ jobs:
8786
SLACK_WEBHOOK: >
8887
${{ github.event_name == 'workflow_dispatch'
8988
&& secrets.TEST_CHANNEL_SLACK
90-
|| secrets.LEVM_SLACK_WEBHOOK
89+
|| secrets.ETHREX_L1_SLACK_WEBHOOK
9190
}}
9291
# Only send diff message if the diff has changed
9392
run: |
@@ -144,7 +143,7 @@ jobs:
144143
SLACK_WEBHOOK: >
145144
${{ github.event_name == 'workflow_dispatch'
146145
&& secrets.TEST_CHANNEL_SLACK
147-
|| secrets.LEVM_SLACK_WEBHOOK
146+
|| secrets.ETHREX_L1_SLACK_WEBHOOK
148147
}}
149148
run: sh .github/scripts/publish_levm_ef_tests.sh "$SLACK_WEBHOOK"
150149

@@ -163,7 +162,7 @@ jobs:
163162
|| format(
164163
'{0} {1}',
165164
secrets.ETHREX_L2_SLACK_WEBHOOK,
166-
secrets.LEVM_SLACK_WEBHOOK
165+
secrets.ETHREX_L1_SLACK_WEBHOOK
167166
)
168167
}}
169168
run: |

.github/workflows/main_flamegraph_report.yaml

Lines changed: 15 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ permissions:
66
id-token: write
77

88
on:
9-
# re-enable this when fixing the workflow
10-
# push:
11-
# branches: ["main"]
9+
push:
10+
branches: ["main"]
1211
workflow_dispatch:
1312

1413
env:
@@ -183,13 +182,6 @@ jobs:
183182
${{ env.HOME }}/.cargo/bin/inferno-*
184183
key: ${{ runner.os }}-extra-binaries
185184

186-
- name: Cache ethrex_l2
187-
id: cache-ethrex-l2
188-
uses: actions/cache@v4
189-
with:
190-
path: ${{ env.HOME }}/.cargo/bin/ethrex_l2
191-
key: ${{ runner.os }}-ethrex-l2-${{ hashFiles('cmd/ethrex_l2/Cargo.lock') }}
192-
193185
- name: Change perf settings
194186
run: |
195187
sudo sysctl kernel.perf_event_paranoid=-1
@@ -236,30 +228,18 @@ jobs:
236228
echo "$HOME/.cargo/bin/inferno-collapse-perf" already found
237229
fi
238230
239-
- name: Install ethrex_l2 cli
240-
run: |
241-
if [ -f "$HOME/.cargo/bin/ethrex_l2" ]; then
242-
echo "$HOME/.cargo/bin/ethrex_l2" already found
243-
else
244-
cargo install --force --path cmd/ethrex_l2
245-
fi
246-
ethrex_l2 config create default --default
247-
ethrex_l2 config set default
248-
249231
# By default ethrex uses revm as evm backend.
250232
- id: generate-flamegraph-ethrex
251233
name: Generate Flamegraph data for Ethrex
252234
shell: bash
253235
run: |
254236
rm -rf target/release/ethrex
237+
cargo build --release --bin ethrex --features dev
255238
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph -c "record -o perf.data -F997 --call-graph dwarf,16384 -g" \
256-
--bin ethrex --features dev -- --dev --network /home/runner/work/ethrex/ethrex/test_data/genesis-l2.json --http.port 1729 >/dev/null &
257-
while [ ! -x "./target/release/ethrex" ]; do
258-
echo "Waiting for ethrex binary to be ready..."
259-
sleep 2
260-
done
239+
--bin ethrex --release --features dev -- \
240+
--dev --network /home/runner/work/ethrex/ethrex/test_data/genesis-l2-ci.json --http.port 1729 >/dev/null &
261241
sleep 10
262-
echo "Compilation finished. Executing load test..."
242+
echo "Executing load test..."
263243
bash /home/runner/work/ethrex/ethrex/.github/scripts/flamegraph_watcher.sh &&
264244
echo "Load test finished"
265245
@@ -293,12 +273,13 @@ jobs:
293273
with:
294274
toolchain: ${{ env.RUST_RETH_VERSION }}
295275

276+
# We need a reth version that requires a rustc version <= 1.82.0
296277
- name: Checkout reth
297278
uses: actions/checkout@v4
298279
with:
299280
repository: paradigmxyz/reth
300281
path: "reth"
301-
ref: main
282+
ref: b2ead06d1d0804101de0d1eb3a070e08d8eab857
302283

303284
- name: Caching
304285
uses: Swatinem/rust-cache@v2
@@ -316,13 +297,6 @@ jobs:
316297
${{ env.HOME }}/.cargo/bin/inferno-*
317298
key: ${{ runner.os }}-extra-binaries
318299

319-
- name: Cache ethrex_l2
320-
id: cache-ethrex-l2
321-
uses: actions/cache@v4
322-
with:
323-
path: ${{ env.HOME }}/.cargo/bin/ethrex_l2
324-
key: ${{ runner.os }}-ethrex-l2-${{ hashFiles('cmd/ethrex_l2/Cargo.lock') }}
325-
326300
- name: Change perf settings
327301
run: |
328302
sudo sysctl kernel.perf_event_paranoid=-1
@@ -369,35 +343,22 @@ jobs:
369343
echo "$HOME/.cargo/bin/inferno-collapse-perf" already found
370344
fi
371345
372-
- name: Install ethrex_l2 cli
373-
run: |
374-
if [ -f "$HOME/.cargo/bin/ethrex_l2" ]; then
375-
echo "$HOME/.cargo/bin/ethrex_l2" already found
376-
else
377-
cargo install --force --path cmd/ethrex_l2
378-
fi
379-
ethrex_l2 config create default --default
380-
ethrex_l2 config set default
381-
382346
- id: generate-flamegraph-reth
383347
name: Build and test reth
384348
shell: bash
385349
# --dev.block-time 1000ms set to 1000ms to match ethrex block generation time
386350
run: |
387351
cd ./reth
388352
rm -rf target/profiling/reth
389-
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph -c "record -o perf.data -F997 --call-graph dwarf,16384 -g" \
390-
--bin reth --profile profiling -- node --chain /home/runner/work/ethrex/ethrex/test_data/genesis-load-test.json --dev \
353+
cargo build --bin reth --profile profiling
354+
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph -c "record -o perf.data -F997 --call-graph dwarf,16384 -g" --bin reth --profile profiling -- \
355+
node --chain /home/runner/work/ethrex/ethrex/test_data/genesis-l2-ci.json --dev \
391356
--dev.block-time 1000ms --http.port 1729 --txpool.max-pending-txns 100000000 --txpool.max-new-txns 1000000000 \
392357
--txpool.pending-max-count 100000000 --txpool.pending-max-size 10000000000 --txpool.basefee-max-count 100000000000 \
393358
--txpool.basefee-max-size 1000000000000 --txpool.queued-max-count 1000000000 >/dev/null &
394-
while [ ! -x "./target/profiling/reth" ]; do
395-
echo "Waiting for reth binary to be ready..."
396-
sleep 10
397-
done
398359
sleep 30
399360
echo "Executing load test..."
400-
bash /home/runner/work/ethrex/ethrex/.github/scripts/flamegraph_watcher.sh &&
361+
(cd /home/runner/work/ethrex/ethrex; ./.github/scripts/flamegraph_watcher.sh)
401362
echo "Load test finished"
402363
403364
- name: Generate SVG
@@ -468,6 +429,9 @@ jobs:
468429
cp -r flamegraph_ethrex.svg flamegraphs/
469430
cp -r flamegraph_reth.svg flamegraphs/
470431
432+
# Fix flamegraphs width
433+
sed -i 's|frames.attributes.width.value = |// |' flamegraphs/flamegraph_*.svg
434+
471435
# ETHREX HTML
472436
sed -i "s/{{LAST_UPDATE}}/$(TZ='Etc/GMT+3' date +'%Y-%m-%dT%H:%M:%S')/g" templates/index.html
473437
sed -i "s/{{ETHREX_TIME}}/${{ needs.flamegraph-ethrex.outputs.time }}/g" templates/index.html

.github/workflows/main_prover.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: L2 (SP1 Backend)
22
on:
3-
push:
4-
branches: ["main"]
3+
pull_request:
4+
branches: ["**"]
5+
merge_group:
56

67
concurrency:
78
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -13,7 +14,7 @@ env:
1314

1415
jobs:
1516
test:
16-
name: Integration Test
17+
name: Integration Test Prover SP1
1718
runs-on: gpu
1819
steps:
1920
- name: Checkout sources
@@ -23,20 +24,24 @@ jobs:
2324
uses: dtolnay/rust-toolchain@stable
2425

2526
- name: Set up Rust cache
27+
if: ${{ always() && github.event_name == 'merge_group' }}
2628
uses: Swatinem/rust-cache@v2
2729
with:
2830
cache-on-failure: "true"
2931

3032
- name: RISC-V SP1 toolchain install
33+
if: ${{ always() && github.event_name == 'merge_group' }}
3134
run: |
3235
. "$HOME/.cargo/env"
3336
curl -L https://sp1.succinct.xyz | bash
3437
~/.sp1/bin/sp1up --version 4.1.0
3538
3639
- name: Set up Docker Buildx
40+
if: ${{ always() && github.event_name == 'merge_group' }}
3741
uses: docker/setup-buildx-action@v3
3842

3943
- name: Bake docker images
44+
if: ${{ always() && github.event_name == 'merge_group' }}
4045
uses: docker/bake-action@v6
4146
with:
4247
workdir: "crates/l2"
@@ -47,15 +52,18 @@ jobs:
4752
*.cache-from=type=gha
4853
4954
- name: Build prover
55+
if: ${{ always() && github.event_name == 'merge_group' }}
5056
run: |
5157
cd crates/l2
5258
make build-prover
5359
5460
- name: Build test
61+
if: ${{ always() && github.event_name == 'merge_group' }}
5562
run: |
5663
cargo test l2 --no-run --release
5764
5865
- name: Run test
66+
if: ${{ always() && github.event_name == 'merge_group' }}
5967
run: |
6068
cd crates/l2
6169
cp configs/prover_client_config_example.toml configs/prover_client_config.toml

.github/workflows/pr-main_l1.yaml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
pull_request:
77
branches: ["**"]
88
paths-ignore:
9-
- "crates/vm/levm/**" # We run this in a separate workflow
109
- "crates/l2/**" # Behind a feature flag not used in this workflow
1110

1211
concurrency:
@@ -31,15 +30,12 @@ jobs:
3130
uses: Swatinem/rust-cache@v2
3231

3332
- name: Run cargo check
34-
run: cargo check
35-
36-
- name: Run cargo build
37-
run: |
38-
cargo build
33+
run: cargo check --workspace --exclude ethrex-prover-bench
3934

4035
- name: Run cargo clippy
4136
run: |
42-
cargo clippy --all-targets --all-features --workspace --exclude ethrex-prover --exclude zkvm_interface -- -D warnings
37+
cargo clippy --workspace --exclude ethrex-prover-bench -- -D warnings
38+
cargo clippy --all-targets --all-features --workspace --exclude ethrex-prover --exclude ethrex-prover-bench --exclude zkvm_interface -- -D warnings
4339
4440
- name: Run cargo fmt
4541
run: |
@@ -64,7 +60,6 @@ jobs:
6460
make test
6561
6662
docker_build:
67-
# "Build Docker" is a required check, don't change the name
6863
name: Build Docker
6964
runs-on: ubuntu-latest
7065
steps:
@@ -160,11 +155,11 @@ jobs:
160155
ethrex_flags: ""
161156
- name: "Cancun Engine tests"
162157
simulation: ethereum/engine
163-
test_pattern: "engine-cancun/Blob Transactions On Block 1|Blob Transaction Ordering, Single|Blob Transaction Ordering, Multiple Accounts|Replace Blob Transactions|Parallel Blob Transactions|ForkchoiceUpdatedV3|ForkchoiceUpdatedV2|ForkchoiceUpdated Version|GetPayload|NewPayloadV3 After Cancun|NewPayloadV3 Before Cancun|NewPayloadV3 Versioned Hashes|Incorrect BlobGasUsed|ParentHash equals BlockHash|RPC:|in ForkchoiceState|Unknown SafeBlockHash|Unknown FinalizedBlockHash|Unique|Re-Execute Payload|Multiple New Payloads|NewPayload with|Build Payload with|Re-org to Previously|Safe Re-Org to Side Chain|Transaction Re-Org|Re-Org Back into Canonical Chain, Depth=5|Suggested Fee Recipient Test|PrevRandao Opcode|Fork ID: *|Invalid Missing Ancestor Syncing ReOrg|Request Blob Pooled Transactions"
158+
test_pattern: "engine-cancun/Blob Transactions On Block 1|Blob Transaction Ordering, Single|Blob Transaction Ordering, Multiple Accounts|Replace Blob Transactions|Parallel Blob Transactions|ForkchoiceUpdatedV3|ForkchoiceUpdatedV2|ForkchoiceUpdated Version|GetPayload|NewPayloadV3 After Cancun|NewPayloadV3 Before Cancun|NewPayloadV3 Versioned Hashes|Incorrect BlobGasUsed|ParentHash equals BlockHash|RPC:|in ForkchoiceState|Unknown SafeBlockHash|Unknown FinalizedBlockHash|Unique|Re-Execute Payload|Multiple New Payloads|NewPayload with|Build Payload with|Re-org to Previously|Safe Re-Org to Side Chain|Transaction Re-Org|Re-Org Back into Canonical Chain, Depth=5|Suggested Fee Recipient Test|PrevRandao Opcode|Fork ID: *|Request Blob Pooled Transactions|Invalid NewPayload, Incomplete Transactions|Re-Org Back to Canonical Chain*|Invalid PayloadAttributes*|Invalid NewPayload, VersionedHashes|Invalid NewPayload, Incomplete VersionedHashes|Invalid NewPayload, Extra VersionedHashes|Bad Hash on NewPayload|Unknown HeadBlockHash|In-Order Consecutive Payload Execution|Valid NewPayload->ForkchoiceUpdated|Invalid NewPayload, ParentHash|Syncing=False|Payload Build after New Invalid Payload" # Invalid Missing Ancestor Syncing ReOrg|Invalid P9|Invalid P10 -> flaky
164159
ethrex_flags: ""
165160
- name: "Paris Engine tests"
166161
simulation: ethereum/engine
167-
test_pattern: "engine-api/RPC|Re-org to Previously Validated Sidechain Payload|Re-Org Back into Canonical Chain, Depth=5|Safe Re-Org|Transaction Re-Org|Inconsistent|Suggested Fee|PrevRandao Opcode Transactions|Fork ID|Unknown SafeBlockHash|Unknown FinalizedBlockHash|Unique Payload ID|Re-Execute Payload|Multiple New Payloads|NewPayload with|Payload Build|Build Payload"
162+
test_pattern: "engine-api/RPC|Re-org to Previously Validated Sidechain Payload|Re-Org Back into Canonical Chain, Depth=5|Safe Re-Org|Transaction Re-Org|Inconsistent|Suggested Fee|PrevRandao Opcode Transactions|Fork ID|Unknown SafeBlockHash|Unknown FinalizedBlockHash|Unique Payload ID|Re-Execute Payload|Multiple New Payloads|NewPayload with|Payload Build|Build Payload|Invalid PayloadAttributes|Unknown HeadBlockHash|Valid NewPayload->ForkchoiceUpdated|Invalid NewPayload, ParentHash|Bad Hash on NewPayload|In-Order Consecutive Payload Execution|Re-Org Back to Canonical Chain" # |Invalid P9 -> flaky
168163
ethrex_flags: ""
169164
- name: "Engine withdrawal tests"
170165
simulation: ethereum/engine
@@ -197,7 +192,6 @@ jobs:
197192
run: |
198193
docker load --input /tmp/ethrex_image.tar
199194
200-
# By default ethrex uses revm as evm backend.
201195
- name: Run Hive Simulation
202196
run: chmod +x hive && ./hive --client ethrex --ethrex.flags "${{ matrix.ethrex_flags }}" --sim ${{ matrix.simulation }} --sim.limit "${{ matrix.test_pattern }}" --sim.parallelism 16
203197

0 commit comments

Comments
 (0)