Skip to content

fix(tracing): preserve empty block trace arrays - #9

Merged
maxim-inj merged 1 commit into
masterfrom
fix/empty-trace-array
Jul 27, 2026
Merged

fix(tracing): preserve empty block trace arrays#9
maxim-inj merged 1 commit into
masterfrom
fix/empty-trace-array

Conversation

@Ri-go

@Ri-go Ri-go commented Jul 21, 2026

Copy link
Copy Markdown
Member

Return an allocated empty trace result slice for blocks without Ethereum transactions so JSON-RPC serializes [] instead of null, matching chain

Summary by CodeRabbit

  • Bug Fixes
    • Improved block tracing behavior for blocks without Ethereum transactions.
    • Ensured tracing results remain consistently formatted when no transactions are present.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

TraceBlock now passes a non-nil empty trace-result slice when a block contains no Ethereum transactions. All other tracing and caching behavior remains unchanged.

Changes

Trace result normalization

Layer / File(s) Summary
Empty-transaction trace handling
internal/evm/rpc/backend/tracing.go
The no-transaction path passes []*rpctypes.TxTraceResult{} instead of nil to the trace-result alignment helper.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested reviewers: maxim-inj

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the change to return allocated empty trace arrays for empty blocks.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/empty-trace-array

Comment @coderabbitai help to get the list of available commands.

@Ri-go
Ri-go requested a review from maxim-inj July 21, 2026 13:31
@maxim-inj
maxim-inj merged commit 2fc6175 into master Jul 27, 2026
3 checks passed
@maxim-inj
maxim-inj deleted the fix/empty-trace-array branch July 27, 2026 14:27
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.

2 participants