Skip to content

feat(l1): implement debug_getModifiedAccountsByNumber/Hash#6700

Draft
azteca1998 wants to merge 4 commits into
mainfrom
feat/debug-get-modified-accounts
Draft

feat(l1): implement debug_getModifiedAccountsByNumber/Hash#6700
azteca1998 wants to merge 4 commits into
mainfrom
feat/debug-get-modified-accounts

Conversation

@azteca1998
Copy link
Copy Markdown
Contributor

Summary

  • Adds debug_getModifiedAccountsByNumber and debug_getModifiedAccountsByHash
  • Returns addresses modified between two blocks by diffing state tries
  • Both endpoints share a diff_state_roots helper that iterates both tries
  • Note: O(n) brute-force comparison; a trie-diff algorithm would be more efficient at mainnet scale

Closes part of #6572

Test plan

  • Returns modified addresses between two consecutive blocks
  • Returns empty array when start == end
  • start > end returns error
  • Both by-number and by-hash variants work

Add debug_getModifiedAccountsByNumber and debug_getModifiedAccountsByHash
which return addresses modified between two blocks. Compares state tries
of start and end blocks to find accounts that were created, modified, or
deleted.

Note: returns hashed addresses (converted to Address) since ethrex does
not maintain a preimage store. The brute-force trie comparison is O(n)
in total accounts; a trie-diff algorithm would be more efficient for
mainnet scale.

Part of #6572
@github-actions github-actions Bot added the L1 Ethereum client label May 21, 2026
@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: 192
Total lines removed: 0
Total lines changed: 192

Detailed view
+-------------------------------------------------------------+-------+------+
| File                                                        | Lines | Diff |
+-------------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/debug/get_modified_accounts.rs | 182   | +182 |
+-------------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/debug/mod.rs                   | 5     | +1   |
+-------------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/rpc.rs                         | 1310  | +9   |
+-------------------------------------------------------------+-------+------+

Execute a transfer, then query getModifiedAccountsByNumber and
getModifiedAccountsByHash. Assert modified accounts are returned.
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