Skip to content

[NEED INVESTIGATION] Incorrect param validation for debug_traceTransaction #3739

@quiet-node

Description

@quiet-node

Description

The current implementation of debug_traceTransaction has incorrect parameter validation and requires custom parameter arrangement in the arrangeRpcParams() method. This creates unnecessary complexity and deviates from industry standards.

Current implementation issues

  • Second parameter validation accepts either a string or object, rather than only an object
  • Special-case handling in arrangeRpcParams() method for traceTransaction
  • Validation logic expects three parameters when the method should have two
  • Needs Investigation – The onlyTopCall option in tracerConfig doesn’t appear to work correctly with callTracer. This is a preliminary observation and requires further investigation to confirm and understand the issue.

Expected behavior

  • Parameter validation should align with industry standards (Alchemy, Quicknode, Infura)
  • Second parameter should be an object with standardized fields:
    • tracer
    • tracerConfig (containing onlyTopCall)
  • Fix would eliminate need for custom parameter arrangement in arrangeRpcParams()
  • Standardized approach would allow method parameters to be normalized without special cases

Params Discrepancy

  • For the second parameter, other providers like Infura, QuickNode, Alchemy, etc., appear to support two options for tracer: callTracer and prestateTracer. However, the current implementation of debug_traceTransaction only supports callTracer and opcodeLogger, with no support for prestateTracer. Further investigation is needed to determine the reason for this discrepancy.

Benefits

  • Improved code maintainability
  • Consistent interface with other RPC providers
  • Simplified parameter handling logic

References

Metadata

Metadata

Assignees

Labels

Team PromotedIssues to be triaged and discussed by committers, maintainers, to be worked on the following sprintbugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions