Skip to content

feat(blocklog): parse ethrex block execution throughput logs#240

Draft
edg-l wants to merge 1 commit into
ethpandaops:masterfrom
edg-l:feat/ethrex-block-log-parser
Draft

feat(blocklog): parse ethrex block execution throughput logs#240
edg-l wants to merge 1 commit into
ethpandaops:masterfrom
edg-l:feat/ethrex-block-log-parser

Conversation

@edg-l
Copy link
Copy Markdown

@edg-l edg-l commented May 27, 2026

What

Implements the ethrex block-log parser in pkg/blocklog (replacing the stub), so ethrex runs produce per-block metrics like the other clients.

It parses ethrex's per-block execution metric header (emitted on the engine_newPayload path) into the shared { "block": { "hash": ... }, ... } shape:

[METRIC] BLOCK 24358000 0x<hash> | 1.234 Ggas/s | 567.00 ms | 150 txs | 700 Mgas (93%)

Captured fields: block.number, block.hash, block.gas_used_mgas, block.gas_used_pct, block.tx_count, throughput.ggas_per_sec, timing.total_ms. ANSI is stripped; the hash is optional in the regex so the line still parses on builds that don't log it (it just won't match a test without block.hash).

Dependency

Matching a log to a test requires block.hash, and ethrex does not yet include the hash on this line. That is addressed upstream in lambdaclass/ethrex#6736, which adds the hash exactly where this parser expects it (BLOCK <num> 0x<hash> | ...). Once that lands and reaches the ethrex image used here, ethrex runs will start attaching per-block metrics.

Marking this draft until the ethrex change is merged and released.

Notes

  • ethrex follows this header with separate |- validate/exec/merkle/store lines; since the collector matches one payload per line by hash, only the header is captured. Folding in the phase breakdown would need ethrex to emit a single structured line (follow-up).
  • Test coverage mirrors reth_test.go: hash / no-hash / zero-gas / ANSI / non-matching lines. gofmt, go vet, and go test ./pkg/blocklog/ pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant