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

cmd/evm: refactor handling output-files for t8n #30854

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Dec 5, 2024

As part of trying to make the inputs and outputs of the evm subcommands more streamlined and aligned, this PR modifies how evm t8n manages output-files.

Previously, we do a kind of wonky thing where between each transaction, we invoke a getTracer closure. In that closure, we create a new output-file, a tracer, and then make the tracer stream output to the file. We also fiddle a bit to ensure that the file becomes properly closed.

It is a kind of hacky solution we have in place. This PR changes it, so that from the execution-pipeline point of view, we have just a regular tracer. No fiddling with re-setting it or closing files.

That particular tracer, however, is a bit special: it takes care of creating new files per transaction (in the tx-start-hook) and closing (on tx-end-hook). Also instantiating the right type of underlying tracer, which can be a json-logger or a custom tracer.

@rjl493456442 rjl493456442 self-assigned this Dec 5, 2024
@holiman holiman requested a review from s1na as a code owner December 5, 2024 19:58
@holiman holiman force-pushed the fix_evmlogs_onmaster branch 7 times, most recently from 07087f8 to 4f8c66c Compare December 6, 2024 10:23
@holiman holiman force-pushed the fix_evmlogs_onmaster branch from 4f8c66c to 118fa6b Compare December 10, 2024 11:30
@holiman holiman force-pushed the fix_evmlogs_onmaster branch from 7a70999 to 28ea519 Compare December 12, 2024 07:51
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