Skip to content

Conversation

@usmansaleem
Copy link
Member

@usmansaleem usmansaleem commented Aug 13, 2025

PR description

This PR is built on top of #8960. It add fixes for DELEGATECALL, Precompiles, SELFDESTRUC, Calls without RETURN and soft failures such as insufficient balance to transfer. It also refactors utility methods from CallTracerResultConverter class for easier readability and testability.

It bring integration tests from #9091. These integration cases were generated running against Geth instance.

Caution

This feature is enabled by using flag: --Xenable-extra-debug-tracers=true. Its disabled by default as it is experimental.

Note

Tracer config options specific to callTracer, such as onlyTopCall:true, are not yet supported

Summary of Changes per file (Generated by Copilot)
File Description
TraceFrame.java Adds soft failure reason and gas available for child calls to support detailed tracing
Operation.java Extends OperationResult with gas allocation tracking for failed calls
AbstractCallOperation.java Updates soft failure handling to include gas information
DebugOperationTracer.java Integrates soft failure and gas tracking into trace frames
CallTracerResultConverter.java Core converter implementing Geth-compatible call tracing logic
CallTracerResult.java Adds getters and improves revert reason handling
CallTracerHelper.java Utility class for memory extraction and byte conversion
Test files Comprehensive test suite covering various call scenarios
Example Call for debug_trace* methods
{
  jsonrpc: "2.0",
  method:  "debug_traceTransaction",
  params:  [
    $txHash,
    {
      tracer:       "callTracer",
      tracerConfig: { onlyTopCall: false }
    }
  ],
  id: 1
}
Acceptance tests: Following scenarios should produce identical output against Geth and Besu
  • Simple Transaction
  • Contract Creation Tx
  • Contract Calls (Simple) Tx
  • Contract Calls (Complex: Contract3.x() -> Contract2.x() -> Contract1.x()) Tx
  • Execution error in Contract Creation
  • Revert Reasons
  • Self destruct
  • Precompiled Gas Cost
  • Refunds
  • Soft failures (insufficient balance to transfer to another account in a contract)

Fixed Issue(s)

#8326

usmansaleem added 30 commits May 7, 2025 11:04
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
…action

Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
…ctory

Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
…legate_call

Signed-off-by: Usman Saleem <usman@usmans.info>
…legate_call

Signed-off-by: Usman Saleem <usman@usmans.info>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

…legate_call

Signed-off-by: Usman Saleem <usman@usmans.info>
@usmansaleem usmansaleem changed the title fix: CallTracer opcode handling feat: Debug RPC- call tracer Nov 20, 2025
…legate_call

Signed-off-by: Usman Saleem <usman@usmans.info>
…legate_call

Signed-off-by: Usman Saleem <usman@usmans.info>
…legate_call

Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
…legate_call

Signed-off-by: Usman Saleem <usman@usmans.info>
…legate_call

Signed-off-by: Usman Saleem <usman@usmans.info>
…legate_call

Signed-off-by: Usman Saleem <usman@usmans.info>
…legate_call

Signed-off-by: Usman Saleem <usman@usmans.info>
Copy link
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

can we have a changelog entry included for this

@github-project-automation github-project-automation bot moved this to Backlog in RC 25.12.0 Dec 4, 2025
@macfarla macfarla moved this from Backlog to In review in RC 25.12.0 Dec 4, 2025
…legate_call

Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
@usmansaleem usmansaleem dismissed lu-pinto’s stale review December 5, 2025 05:24

Dismiss review as requested changes implemented.

…legate_call

Signed-off-by: Usman Saleem <usman@usmans.info>
@usmansaleem usmansaleem enabled auto-merge (squash) December 5, 2025 06:03
@usmansaleem usmansaleem merged commit cb4f26b into hyperledger:main Dec 5, 2025
46 checks passed
@github-project-automation github-project-automation bot moved this from PFI to Done in RC 25.12.0 Dec 5, 2025
@usmansaleem usmansaleem deleted the call_tracer_impl_delegate_call branch December 7, 2025 23:28
AliZDev-v0 pushed a commit to AliZDev-v0/besu that referenced this pull request Dec 10, 2025
feat: Implement callTracer for debug_trace* methods

Major refactoring of the debug tracing infrastructure to support the callTracer
type with Geth-compatible output.

Key changes:
- Refactor DebugCallTracerResult to support hierarchical call stack
- Introduce TracerType enum and TracerOptions simplification
- Rename StructLogTracerConfig to OpCodeTracerConfig for clarity
- Rename tracer result classes for consistency (OpCodeLoggerTracerResult, etc.)
- Implement CallTracerResultConverter for converting trace frames to call traces
- Add TraceFrame Builder pattern with precompile input/output fields
- Handle precompile calls with correct gas calculation and input/output
- Support SELFDESTRUCT, CREATE/CREATE2 operations in call traces
- Handle exceptional halts and soft failures with proper error descriptions
- Add feature flag for extra debug tracers
- Add comprehensive unit and integration tests for callTracer

---------

Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Ali Zhagparov <alijakparov.kz@gmail.com>
pinges pushed a commit to pinges/besu that referenced this pull request Dec 15, 2025
feat: Implement callTracer for debug_trace* methods

Major refactoring of the debug tracing infrastructure to support the callTracer
type with Geth-compatible output.

Key changes:
- Refactor DebugCallTracerResult to support hierarchical call stack
- Introduce TracerType enum and TracerOptions simplification
- Rename StructLogTracerConfig to OpCodeTracerConfig for clarity
- Rename tracer result classes for consistency (OpCodeLoggerTracerResult, etc.)
- Implement CallTracerResultConverter for converting trace frames to call traces
- Add TraceFrame Builder pattern with precompile input/output fields
- Handle precompile calls with correct gas calculation and input/output
- Support SELFDESTRUCT, CREATE/CREATE2 operations in call traces
- Handle exceptional halts and soft failures with proper error descriptions
- Add feature flag for extra debug tracers
- Add comprehensive unit and integration tests for callTracer

---------

Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants