Skip to content

feat(l1): implement 4byteTracer#6704

Draft
azteca1998 wants to merge 4 commits into
mainfrom
feat/four-byte-tracer
Draft

feat(l1): implement 4byteTracer#6704
azteca1998 wants to merge 4 commits into
mainfrom
feat/four-byte-tracer

Conversation

@azteca1998
Copy link
Copy Markdown
Contributor

Summary

  • Add 4byteTracer tracer type for debug_traceTransaction and block tracing endpoints
  • Records all function selectors (first 4 bytes of calldata) and their calldata sizes for every call in a transaction
  • Returns a map of "0xSELECTOR-SIZE" → count (e.g. {"0xa9059cbb-68": 1})
  • Implemented by post-processing the existing call tracer output (walks the call trace tree to extract selectors)

Closes part of #6572

… tracing

Add support for the `4byteTracer` tracer type which records all function
selectors (first 4 bytes of calldata) and calldata sizes for every call
in a transaction. Returns a map of "0xSELECTOR-SIZE" -> count.

Implemented by post-processing the existing call tracer output, walking
the call trace tree to extract selector information from each frame.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

⚠️ Known Issues — intentionally skipped tests

Source: docs/known_issues.md

Known Issues

Tests intentionally excluded from CI. Source of truth for the Known
Issues
section the L1 workflow appends to each ef-tests job summary
and posts as a sticky PR comment.

EF Tests — Stateless coverage narrowed to EIP-8025 optional-proofs

make -C tooling/ef_tests/blockchain test calls test-stateless-zkevm
instead of test-stateless. The zkevm@v0.3.3 fixtures are filled against
bal@v5.6.1, out of sync with current bal spec; the broad target trips ~549
fixtures. Re-broaden once the zkevm bundle is regenerated.

Why and resolution path

PR #6527 broadened
test-stateless to extract the entire for_amsterdam/ tree from the
zkevm bundle and run all of it under --features stateless; combined with
this branch's bal-devnet-7 semantics that scope produces ~549
GasUsedMismatch / ReceiptsRootMismatch /
BlockAccessListHashMismatch failures.

test-stateless-zkevm filters cargo to the eip8025_optional_proofs
suite, which still validates the stateless harness without the bal-version
mismatch.

Re-broaden by switching test: back to test-stateless in
tooling/ef_tests/blockchain/Makefile once the zkevm bundle is regenerated
against the current bal spec.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

Lines of code report

Total lines added: 157
Total lines removed: 0
Total lines changed: 157

Detailed view
+-----------------------------------------+-------+------+
| File                                    | Lines | Diff |
+-----------------------------------------+-------+------+
| ethrex/crates/networking/rpc/tracing.rs | 472   | +157 |
+-----------------------------------------+-------+------+

Trace a real transfer with 4byteTracer and assert the response
is an empty selector map (no calldata in a plain transfer).
@azteca1998 azteca1998 changed the title feat(rpc): implement 4byteTracer feat(l1): implement 4byteTracer May 21, 2026
@github-actions github-actions Bot added the L1 Ethereum client label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant