-
Notifications
You must be signed in to change notification settings - Fork 72
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
feat: small updates for steps tracing #152
Conversation
This PR conflicts with approved #84 as it relies on previous recorded step always containing memory during previous instruction. This wouldn't be true if |
We could just override the filter to say that we're tracing memory opcodes if we also want memory in that case |
that makes sense |
hmm, perhaps we should just fallback to old behavior in that case? if user provided filter to only collect |
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.
if I'm reading this correctly, then this does not change the existing recording logic and only adds returndata recording based on opcode filter?
the overhead is negligible here
we can do @DaniPopes suggestion separately I believe
/// Returndata before step execution | ||
pub returndata: Bytes, |
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 do remember we had this at some point
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.
lgtm, pending @DaniPopes
opcode filter and returndata are separate configs returndata is recorded in the same way as memory: if and opcode filter is just a way to make tracer record only specific steps to optimize memory usage if we're only interested in a small subset of steps. e.g. this is the case for internal fns tracking in foundry where we only want |
record_returndata_snapshots
flag to config which enables snapshots ofinterpreter.return_data_buffer
record_opcodes_filter
parameter which allows to only record specific opcodes. ref feat: identify internal function invocations in traces foundry-rs/foundry#8222 (comment)gas_used
field forCallTraceStep
This should be enough to migrate foundry's debugger to using
TracingInspector
from here, I will open PR for this later today.