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

JSONRPC request-response logging #1236

Merged
merged 7 commits into from
Sep 27, 2024
Merged

Conversation

yaziciahmet
Copy link
Contributor

@yaziciahmet yaziciahmet commented Sep 27, 2024

Description

Added logging to each JSONRPC request and response to be able to have better debuggability of our nodes. Each request and successful response is logged with debug tracing level. Error responses are logged with warn level since it is highly likely that the error is caused by the client-side.

Original idea was to add a new tracing level for rpc request logging. But such behavior is not possible with tracing crate. Instead of that, errors are now logged to warn level, and can be searched with a filter such as level = WARN && message = rpc_error.

I initially logged the request and success responses to info level, but due to full nodes constantly spamming sequencer for new blocks through rpc, sequencer logs became full with useless rpc calls, which is not good. Another potential approach might be to make Sequencer RPC logs debug, but full node rpc logs info.

Also, prover doesn't have any rpc logs as it is unnecessary.

Linked Issues

Testing

I ran sequencer and full node and sent rpc requests and observed logs.

Copy link
Contributor

@rakanalh rakanalh left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (nightly@7c7941c). Learn more about missing BASE report.
Report is 1 commits behind head on nightly.

Additional details and impacted files
Files with missing lines Coverage Δ
crates/common/src/rpc/mod.rs 100.0% <100.0%> (ø)
crates/ethereum-rpc/src/lib.rs 88.9% <ø> (ø)
crates/evm/src/query.rs 88.5% <ø> (ø)
crates/fullnode/src/runner.rs 85.8% <100.0%> (ø)
crates/sequencer-client/src/lib.rs 100.0% <100.0%> (ø)
crates/sequencer/src/sequencer.rs 90.3% <100.0%> (ø)

@eyusufatik
Copy link
Member

we might want to delete enter traces to rpcs as well, I think there were some in ledger rpc, wdyt?

@yaziciahmet yaziciahmet merged commit f4f943c into nightly Sep 27, 2024
14 checks passed
@yaziciahmet yaziciahmet deleted the yaziciahmet/rpc-logging branch September 27, 2024 09:40
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.

New tracing level for RPC Error responses
5 participants