Skip to content

[NEED INVESTIGATION] Incorrect param validation for debug_traceTransaction #3739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
quiet-node opened this issue May 5, 2025 · 1 comment
Assignees
Labels
bug Something isn't working Team Promoted Issues to be triaged and discussed by committers, maintainers, to be worked on the following sprint

Comments

@quiet-node
Copy link
Contributor

quiet-node commented May 5, 2025

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

@quiet-node quiet-node added the bug Something isn't working label May 5, 2025
@quiet-node quiet-node added the Team Promoted Issues to be triaged and discussed by committers, maintainers, to be worked on the following sprint label May 5, 2025
@quiet-node quiet-node changed the title Incorrect param validation for debug_traceTransaction [NEED INVESTIGATION] Incorrect param validation for debug_traceTransaction May 9, 2025
@quiet-node
Copy link
Contributor Author

Also there is no acceptance tests for debug_traceTransaction API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Team Promoted Issues to be triaged and discussed by committers, maintainers, to be worked on the following sprint
Projects
None yet
Development

No branches or pull requests

2 participants