feat(tooling): log RLP errors to file + shorten RLP errors in console#1810
feat(tooling): log RLP errors to file + shorten RLP errors in console#1810felix314159 wants to merge 1 commit intoethereum:mainfrom
Conversation
…gs when error occurs
marioevz
left a comment
There was a problem hiding this comment.
Some comments, but I think @danceratopz should give this one a review since he's more familiar with the logging mechanism of consume. Thanks!
| 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.
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.
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.
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 |
|
@danceratopz Can we get this merged before the weld? We will need a way to log RLP error to file at some point in the future, the code in this PR used to work but it wasn't that clean in regards to how it performed the logging. How much work is it to add an option to our logging plugin to specify the modes log to file only / log to console only / log to both? |
|
To be picked up post-weld. |
🗒️ 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
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlinttype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.