Skip to content

(feat): implement debug_traceCallMany#2257

Open
manav2401 wants to merge 10 commits into
developfrom
manav/trace-call-many
Open

(feat): implement debug_traceCallMany#2257
manav2401 wants to merge 10 commits into
developfrom
manav/trace-call-many

Conversation

@manav2401

@manav2401 manav2401 commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary

This PR implements debug_traceCallMany endpoint which can be used to trace multiple calls under a single rpc request by bundling them. Behaviour referenced from erigon.

Executed tests

  • e2e tests part of the CI which validates various permutations and combinations of this call.

Copilot AI review requested due to automatic review settings June 4, 2026 08:21

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@manav2401

Copy link
Copy Markdown
Member Author

@claude review. Refer to external documentations if needed to ensure the request / response format of the call is accurate and there are no edge cases. Look for DoS vectors where someone can get bor to go out of memory via this call.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new tracer RPC API method (TraceCallMany) to execute multiple eth_call-style traces over a shared, evolving simulated state, aligning behavior with Erigon’s eth_callMany/debug_traceCallMany semantics. It also introduces targeted tests to validate state persistence, block-context overrides, transaction-index base-state selection, and interaction with state-sync blocks.

Changes:

  • Added TraceCallMany, Bundle, and StateContext to trace multiple call bundles over a shared simulated state.
  • Added comprehensive unit tests for bundle semantics, block overrides, basefee handling for zero-gas-price calls, and error cases.
  • Added a state-sync regression test ensuring base-state selection does not execute a trailing state-sync tx as a normal message.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
eth/tracers/api.go Implements TraceCallMany + helpers to trace multiple call bundles over shared state with block/state overrides.
eth/tracers/api_test.go Adds unit tests covering core TraceCallMany semantics and error handling.
eth/tracers/api_statesync_test.go Adds a state-sync-specific test validating correct base-state construction for TraceCallMany.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread eth/tracers/api.go Outdated
Comment thread eth/tracers/api.go Outdated
Comment thread eth/tracers/api.go Outdated
Comment thread eth/tracers/api.go
Comment thread eth/tracers/api.go Outdated
Comment thread eth/tracers/api.go
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.23810% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.48%. Comparing base (5df879f) to head (29c5c36).

Files with missing lines Patch % Lines
eth/tracers/api.go 95.23% 6 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2257      +/-   ##
===========================================
+ Coverage    53.44%   53.48%   +0.03%     
===========================================
  Files          896      896              
  Lines       159770   159959     +189     
===========================================
+ Hits         85397    85561     +164     
- Misses       69054    69062       +8     
- Partials      5319     5336      +17     
Files with missing lines Coverage Δ
eth/tracers/api.go 72.40% <95.23%> (+4.74%) ⬆️

... and 24 files with indirect coverage changes

Files with missing lines Coverage Δ
eth/tracers/api.go 72.40% <95.23%> (+4.74%) ⬆️

... and 24 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@manav2401

Copy link
Copy Markdown
Member Author

@claude review. Refer to external documentations if needed to ensure the request / response format of the call is accurate and there are no edge cases. Look for DoS vectors where someone can get bor to go out of memory via this call.

@manav2401

Copy link
Copy Markdown
Member Author

Govuln fail requires a go version bump. Will address in separate PR.

@manav2401

Copy link
Copy Markdown
Member Author

@claude review

Comment thread eth/tracers/api_test.go
Comment thread eth/tracers/api.go Outdated
Copilot AI review requested due to automatic review settings June 4, 2026 13:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Comment thread eth/tracers/api.go Outdated
Comment thread eth/tracers/api.go Outdated
@manav2401 manav2401 requested a review from a team June 5, 2026 06:11
Comment thread eth/tracers/api.go Outdated
Comment thread eth/tracers/api.go
Comment thread eth/tracers/api.go
Copilot AI review requested due to automatic review settings June 23, 2026 11:08

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has reached its monthly code review spending cap.

An organization admin can view or raise the cap at claude.ai/admin-settings/claude-code. The cap resets at the start of the next billing period.

Once the cap resets or is raised, reopen this pull request to trigger a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread eth/tracers/api.go
@manav2401

Copy link
Copy Markdown
Member Author

Rationale for skipping diffguard analysis - most of tracing functions aren't broken down into lot of nested functions as the over abstracting things may decrease code readability. The public facing API function (TraceCallMany) also follows similar conventions and hence large functions are kept which may violate some diffguard rules. Thanks!

Comment thread eth/tracers/api.go
Comment thread eth/tracers/api.go
Comment thread eth/tracers/api.go Outdated
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

4 participants