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

feat(rpc): trace requests and responses #498

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Apr 10, 2024

There is currently no way of knowing what raw data we are sending and receiving.
Add trace! calls around the RpcClient future for this, as well as a simpler debug! for just the method and ID, as the raw data could be very verbose.

Running test_send_tx with alloy=debug, I think this verbosity is fair for debug:
image

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

I definitely want this, for debugging, I think logging the entire request object would also be useful, to debug data serialization


let request = request.take().expect("no request");
debug!(method=%request.meta.method, id=%request.meta.id, "sending request");
Copy link
Member

Choose a reason for hiding this comment

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

should we log the entire request object?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I think so, added a trace! with ?request and params type name

@DaniPopes DaniPopes merged commit 7994752 into main Apr 10, 2024
18 checks passed
@DaniPopes DaniPopes deleted the dani/trace-rpc-io branch April 10, 2024 14:59
klkvr pushed a commit to klkvr/alloy that referenced this pull request Apr 11, 2024
ben186 pushed a commit to ben186/alloy that referenced this pull request Jul 27, 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.

2 participants