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

Optimize MuxInspector #62

Open
mattsse opened this issue Mar 8, 2024 · 1 comment
Open

Optimize MuxInspector #62

mattsse opened this issue Mar 8, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@mattsse
Copy link
Contributor

mattsse commented Mar 8, 2024

Currently the muxtracer uses several instances of TracingInspector

however the return frame handler of GethBuilder dont consume the the type:

https://github.com/paradigmxyz/evm-inspectors/blob/aad9b3cc9920997a29c9e5034b78b8866627f739/src/tracing/builder/geth.rs#L117-L117

This means the mux tracer can be optimized so that only 1 instance per tracer (fourbyte,TracingInspector) is used:

https://github.com/paradigmxyz/evm-inspectors/blob/aad9b3cc9920997a29c9e5034b78b8866627f739/src/tracing/mux.rs#L170-L170

This way we should also get rid of the dangerous recursive MuxInspector variant

https://github.com/paradigmxyz/evm-inspectors/blob/aad9b3cc9920997a29c9e5034b78b8866627f739/src/tracing/mux.rs#L173-L173

TODO

switch from an enum approach to an Option<FourByteInspector> Option<TransactionInspector> approach that are then reused when the MuxFrame is populated

fyi @ArtificialPB

@ArtificialPB
Copy link
Contributor

Do you want to completely disallow mux tracer nesting? If you want to trace both prestate and poststate (aka prestate tracer in diff mode), the only way to do it right now is to nest a muxTracer (tracer name is a map key in the config).

Agree with other points about reusing the tracer instances. I can take this, ~mid next week most likely. I'll also finish the JS tracer support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants