Skip to content

Commit 5cfac85

Browse files
Patch keccak and add ethrex bench (#659)
* simple ethrex tx * add full test * fix test * fix print ecall * add ethrex with tx bench * add keccak patch * Fix ethrex fixture reproducibility (#661) * Fix ethrex fixture reproducibility * Tighten ethrex benchmark rebuild logging --------- Co-authored-by: Mauro Toscano <12560266+MauroToscano@users.noreply.github.com>
1 parent ec5a727 commit 5cfac85

26 files changed

Lines changed: 4209 additions & 184 deletions

.github/scripts/publish_bench_vs.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,25 @@ fi
8282
ETHREX_METRICS_FILE="bench_vs_artifacts/ethrex_metrics.txt"
8383
ETHREX_SECTION=""
8484
if [ -f "$ETHREX_METRICS_FILE" ]; then
85-
ETHREX_TIME=$(grep '^ethrex_empty_block_time_s=' "$ETHREX_METRICS_FILE" | cut -d= -f2-)
86-
ETHREX_CYCLES=$(grep '^ethrex_empty_block_cycles=' "$ETHREX_METRICS_FILE" | cut -d= -f2-)
87-
if [ -n "$ETHREX_TIME" ]; then
88-
ETHREX_MRKDWN="*Empty block:* ${ETHREX_TIME}s"
89-
if [ -n "$ETHREX_CYCLES" ] && [ "$ETHREX_CYCLES" != "n/a" ]; then
90-
ETHREX_MRKDWN="${ETHREX_MRKDWN} (${ETHREX_CYCLES} cycles)"
85+
# Render one "*<label>:* <time>s (<cycles> cycles)" line per block.
86+
ethrex_line() {
87+
local label=$1 key=$2 t c
88+
t=$(grep "^${key}_time_s=" "$ETHREX_METRICS_FILE" | cut -d= -f2-)
89+
c=$(grep "^${key}_cycles=" "$ETHREX_METRICS_FILE" | cut -d= -f2-)
90+
[ -z "$t" ] && return 0
91+
local line="*${label}:* ${t}s"
92+
if [ -n "$c" ] && [ "$c" != "n/a" ]; then
93+
line="${line} (${c} cycles)"
9194
fi
92-
ETHREX_SECTION=',{"type":"divider"},{"type":"header","text":{"type":"plain_text","text":"Lambda VM - Ethrex Empty"}},{"type":"section","text":{"type":"mrkdwn","text":"'"$ETHREX_MRKDWN"'"}}'
95+
printf '%s' "$line"
96+
}
97+
EMPTY_LINE=$(ethrex_line "Empty block" "ethrex_empty_block")
98+
TX_LINE=$(ethrex_line "1 tx" "ethrex_1_tx")
99+
ETHREX_MRKDWN=""
100+
[ -n "$EMPTY_LINE" ] && ETHREX_MRKDWN="$EMPTY_LINE"
101+
[ -n "$TX_LINE" ] && ETHREX_MRKDWN="${ETHREX_MRKDWN:+$ETHREX_MRKDWN\n}$TX_LINE"
102+
if [ -n "$ETHREX_MRKDWN" ]; then
103+
ETHREX_SECTION=',{"type":"divider"},{"type":"header","text":{"type":"plain_text","text":"Lambda VM - Ethrex"}},{"type":"section","text":{"type":"mrkdwn","text":"'"$ETHREX_MRKDWN"'"}}'
93104
fi
94105
fi
95106

.github/workflows/bench-vs-nightly.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,12 @@ jobs:
4747
--report-dir bench_vs_artifacts \
4848
--no-color
4949
50-
- name: Restore cached ethrex.elf (TEMPORARY — until /opt/lambda-vm-sysroot is provisioned on the bench runner)
51-
continue-on-error: true
52-
run: |
53-
mkdir -p executor/program_artifacts/rust
54-
cp /home/app/cached_artifacts/ethrex.elf executor/program_artifacts/rust/ethrex.elf
55-
ls -la executor/program_artifacts/rust/ethrex.elf
56-
sha256sum executor/program_artifacts/rust/ethrex.elf
57-
58-
- name: Run ethrex empty block benchmark
50+
- name: Run ethrex block benchmarks
5951
continue-on-error: true
6052
run: |
6153
bash ./bench_vs/run_ethrex.sh \
6254
--report-dir bench_vs_artifacts \
55+
--rebuild-elf \
6356
--no-color
6457
6558
- name: Upload nightly benchmark artifact

Cargo.lock

Lines changed: 71 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)