Skip to content

feat(tooling): log RLP errors to file + shorten RLP errors in console #1810

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

felix314159
Copy link
Collaborator

@felix314159 felix314159 commented Jun 27, 2025

🗒️ Description

This change was originally part of #1614 but was split out into a separate PR. Rationale: When using real blobs logging the entire RLP on error into console is not feasible, so this PR shortens the logged error to 50 chars in these cases. Also logs entire RLP to file (only when error is encountered).

🔗 Related Issues or PRs

N/A.

✅ Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlint
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered adding an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

@felix314159 felix314159 requested a review from marioevz June 27, 2025 12:43
Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

Some comments, but I think @danceratopz should give this one a review since he's more familiar with the logging mechanism of consume. Thanks!

@@ -43,7 +47,28 @@ def __str__(self):
if self.tx is not None:
f"{super().__str__()} Transaction={self.tx.model_dump_json()}"
elif self.tx_rlp is not None:
return f"{super().__str__()} Transaction RLP={self.tx_rlp.hex()}"
tx_rlp_hex_full = self.tx_rlp.hex()
Copy link
Member

Choose a reason for hiding this comment

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

We really should constrain this to only run when debugging is enabled. This would be an overhead that's dumping information to file system without the user having an option to disable it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree, but with Dan's custom logger I do not know how to retrieve the user-provided eest-log-level at runtime.

tx_rlp_hex = tx_rlp_hex_full[:50]

# create ./logs/rlp folder if it does not exist already
rlp_logs_folder = Path(".") / "logs" / "rlp"
Copy link
Member

Choose a reason for hiding this comment

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

We have AppConfig().DEFAULT_EVM_LOGS_DIR instead of Path(".") but I'm not sure if that's the correct source for this location, so I'll defer to @danceratopz who is more familiar with the consume command logging.

@felix314159
Copy link
Collaborator Author

@danceratopz With your custom logger wrapper, is it possible to temporarily specify to log to file only (should take output filepath as argument)? I feel like this PR might introduces bad/unclean code because the custom logger does not provide the functionality we need here (or maybe it does and i just do not know how to use it). It should also be easy to at-runtime access the user provided value of the flag eest-log-level

@felix314159 felix314159 requested a review from danceratopz July 7, 2025 12:21
@danceratopz danceratopz added type:feat type: Feature scope:fill Scope: fill command labels Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:fill Scope: fill command type:feat type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants