Skip to content
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

Problem: Missing debug_traceCall RPC #367

Closed

Conversation

calvinaco
Copy link

Solution: Implemented the RPC

Closes: #XXX

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Solution: Implemented the RPC
var tracerConfig json.RawMessage
if req.TraceConfig != nil && req.TraceConfig.TracerJsonConfig != "" {
// ignore error. default to no traceConfig
_ = json.Unmarshal([]byte(req.TraceConfig.TracerJsonConfig), &tracerConfig)

Check warning

Code scanning / gosec

Returned error is not propagated up the stack. Warning

Returned error is not propagated up the stack.
@calvinaco calvinaco force-pushed the feature/debug_tracecall branch from 1da357c to b58b94b Compare October 25, 2023 23:46
return nil, status.Error(codes.InvalidArgument, "empty request")
}

if req.TraceConfig != nil && req.TraceConfig.Limit < 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure if we need handle stateOverrides

Copy link
Author

@calvinaco calvinaco Oct 26, 2023

Choose a reason for hiding this comment

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

I can see in eth_call the state overrides param are ignored too (

_ *rpctypes.StateOverride,
). But not sure about the context @yihuang do you have any insight on this?

In addition, from the debug_traceCall API documentation, I didn't see it can specify state override, do you know how do they pass the stateOverrides config?

Copy link
Collaborator

@yihuang yihuang Oct 26, 2023

Choose a reason for hiding this comment

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

seems like some lesser known feature, we don't support yet. we can do that in a separate PR I think.

ref: #368

blockNrOrHash rpctypes.BlockNumberOrHash,
config *evmtypes.TraceConfig,
) (interface{}, error) {
a.logger.Debug("eth_call", "args", args.String(), "block number or hash", blockNrOrHash)
Copy link
Collaborator

@mmsqe mmsqe Oct 26, 2023

Choose a reason for hiding this comment

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

do you mean debug_traceCall here, and do we mv the block not found check here?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for pointing out!

@yihuang
Copy link
Collaborator

yihuang commented Jan 5, 2024

merged: #390

@yihuang yihuang closed this Jan 5, 2024
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.

3 participants