Skip to content

feat: add block-level transaction processor#111

Merged
mw2000 merged 1 commit intomainfrom
issue-86
Apr 25, 2026
Merged

feat: add block-level transaction processor#111
mw2000 merged 1 commit intomainfrom
issue-86

Conversation

@mw2000
Copy link
Copy Markdown
Owner

@mw2000 mw2000 commented Apr 25, 2026

Summary

  • Adds EEVM.Block.Processor.process_block/4, which runs a block end-to-end: pre-flight gas-limit check → system-call hooks → transaction fold with cumulative-gas tracking → root/bloom commitments.
  • Introduces value structs EEVM.Block.Header, EEVM.Block.Receipt, and EEVM.BlockResult for the inputs and outputs.
  • Computes state_root, receipts_root, transactions_root, logs_bloom, and total gas_used to match what an external verifier would check against the advertised header.

Notes

Closes #86.

Test plan

🤖 Generated with Claude Code

Introduce `EEVM.Block.Processor` plus the supporting `Header`, `Receipt`,
and `BlockResult` value structs. The processor runs a block end-to-end:

1. Reject the block when `sum(tx.gas_limit) > header.gas_limit`.
2. Apply any `:system_calls` hooks against the pre-state DB (this is
   where EIP-4788 / EIP-2935 plug in once their PRs land).
3. Fold transactions through an injected `:tx_executor`, accumulating
   receipts whose `cumulative_gas_used` is the running total. First
   `{:error, _}` halts and reports the failing index.
4. Compute `state_root`, `receipts_root`, `transactions_root`,
   `logs_bloom`, and total `gas_used` into a `BlockResult`.

The transaction executor and system-call hooks are dependency-injected
rather than aliased so this PR can ship independently of #81 / #82 / #83;
once those land a follow-up will wire in real defaults.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@mw2000 mw2000 marked this pull request as ready for review April 25, 2026 18:56
@mw2000 mw2000 merged commit 7bfce00 into main Apr 25, 2026
2 checks passed
@mw2000 mw2000 deleted the issue-86 branch April 25, 2026 18:58
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.

Implement block-level transaction processing

1 participant