-
Notifications
You must be signed in to change notification settings - Fork 154
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
base: main
Are you sure you want to change the base?
Conversation
…gs when error occurs
There was a problem hiding this 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() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
@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 |
🗒️ 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
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
type(scope):
.mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_from
marker.