-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: add FlatCallTracer
#11114
feat: add FlatCallTracer
#11114
Conversation
crates/rpc/rpc/src/debug.rs
Outdated
|
||
// Now `res` is the unwrapped value, not an Option | ||
let res = None; | ||
|
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.
this is a good start, we need to replicate what we do here:
reth/crates/rpc/rpc/src/trace.rs
Lines 342 to 358 in 242a3ab
/// Returns all traces for the given transaction hash | |
pub async fn trace_transaction( | |
&self, | |
hash: B256, | |
) -> Result<Option<Vec<LocalizedTransactionTrace>>, Eth::Error> { | |
self.inner | |
.eth_api | |
.spawn_trace_transaction_in_block( | |
hash, | |
TracingInspectorConfig::default_parity(), | |
move |tx_info, inspector, _, _| { | |
let traces = | |
inspector.into_parity_builder().into_localized_transaction_traces(tx_info); | |
Ok(traces) | |
}, | |
) | |
.await |
and
reth/crates/rpc/rpc/src/trace.rs
Lines 366 to 374 in 242a3ab
let traces = self.inner.eth_api.trace_block_with( | |
block_id, | |
TracingInspectorConfig::default_parity(), | |
|tx_info, inspector, _, _, _| { | |
let traces = | |
inspector.into_parity_builder().into_localized_transaction_traces(tx_info); | |
Ok(traces) | |
}, | |
); |
I think here we can ignore the block reward stuff
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.
tx_info should just be default here right since it isn't actually tx and is just a call?
(quickly update code to use default, lmk if there is something else i should be fetching)
quick attempt at actually doing the tracing:
|
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.
cool, lgtm, needs fmt
you can tackle the other call in a followup or add it here
added other, need |
on revm-inspectors? this is available in the new release so you can bump the dep here |
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.
style nits,
- remove the feature gated
_transaction_context
and use into for conversion with revm-inspector 0.7.7
crates/rpc/rpc/src/debug.rs
Outdated
let tx_info = TransactionInfo { | ||
hash: { | ||
#[cfg(not(feature = "js-tracer"))] | ||
{ | ||
_transaction_context.unwrap().tx_hash | ||
} | ||
#[cfg(feature = "js-tracer")] | ||
{ |
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.
lets get rid of this entirely, we can now also remove the feature gated argument because we use it now
also releasing this which makes this conversion a simple into() paradigmxyz/revm-inspectors#204
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.
removed transaction_conext
feature gating in the function. updated conversion to not have feature gate as well. left the feature gating on js-tracer since that seems unrelated
we can merge this with the pops and then simply remove them once we bump alloy, this way we don't need to rebase in case there are changes |
ecbf99b
to
0f899c3
Compare
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, needs smol update once alloy is bumped but this wont compile and we'll know
merging because there is currently more wip on this file to avoid conflcits
yeah can use #11152 to remove the pop or include the alloy bump in the PR if needed |
Closes #10991
still wip but creating draft pr to get some guidance on whether this is the right path
some things to note:
FlatCallConfig
from_flat_call_config
revm-inspectors#203) , this allows us to use the precompile flagstrying to understand if this is the right approach to adding flatcalltracer or if i'm overcomplicating things