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: add logs for incoming API requests #118

Merged
merged 10 commits into from
Sep 18, 2023

Conversation

MexicanAce
Copy link
Collaborator

@MexicanAce MexicanAce commented Sep 15, 2023

What 💻

  • Add logs for incoming API requests
  • Update not_implemented logs to warnings
  • Update version number to match latest release
  • Fix unit test

Why ✋

  • This shows a clearer picture of what's happening against the node. When debugging an interaction with other tools like MetaMask, Portal, Block Explorer, etc. it's VERY useful to know what requests have been made and might be silently failing
  • Warning better encapsulated the response now that it's contrasted against the initial request
  • This was out of date per the latest release
  • Overlooked prior to merge of a refactor when implementing eth_feeHistory

Evidence 📷

Example of new not_implemented logs:
image

Output of make test-e2e with default logs:
image

Output of eth_getBlockByNumber with trace log level:
image

Notes 📝

  • I chose to reference the LevelFilter in the middleware because I wanted to avoid duplicate log statements for trace and info. The info is meant to be truncated/short/concise, while trace log can be MASSIVE depending on the incoming payload.

@MexicanAce MexicanAce requested a review from a team as a code owner September 15, 2023 17:18
Copy link
Collaborator

@dutterbutter dutterbutter left a comment

Choose a reason for hiding this comment

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

Not sure I like this with the info level tbh. Could get quite noisy with more complicated deployments. Perhaps this is better suited for a trace level that can be introduced?

@dutterbutter
Copy link
Collaborator

@MexicanAce please address conflicts

@MexicanAce
Copy link
Collaborator Author

Not sure I like this with the info level tbh. Could get quite noisy with more complicated deployments. Perhaps this is better suited for a trace level that can be introduced?

Discussed offline and added the LogLevel::Trace support with the responses and full requests now being logged accordingly (See updated screenshot in PR description). The truncated requests will be left for now, and we'll wait to hear from users if it's too noisy/not flexible enough for their needs.

Ultimately, we want to discover the most useful default console output for era_test_node run.

@MexicanAce MexicanAce merged commit 19b7cca into main Sep 18, 2023
9 checks passed
@MexicanAce MexicanAce deleted the nmv/add-logs-for-incoming-requests branch September 18, 2023 16:55
IAvecilla added a commit to lambdaclass/era-test-node that referenced this pull request Feb 29, 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