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

feat: add flattracer #11114

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

0xkrane
Copy link
Contributor

@0xkrane 0xkrane commented Sep 22, 2024

Closes #10991

still wip but creating draft pr to get some guidance on whether this is the right path

some things to note:

  • we first convert the config into a FlatCallConfig
  • create the inspector using the from_flat_call_config (this change has been proposed here: chore: add from_flat_call_config revm-inspectors#203) , this allows us to use the precompile flags
  • then use the inspector to trace the transaction, instead of initializing a default parity tracer since that would ignore the precompile flag

trying to understand if this is the right approach to adding flatcalltracer or if i'm overcomplicating things

Comment on lines +401 to +404

// Now `res` is the unwrapped value, not an Option
let res = None;

Copy link
Collaborator

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:

/// 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

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

@mattsse mattsse added the A-rpc Related to the RPC implementation label Sep 23, 2024
@mattsse mattsse marked this pull request as ready for review September 23, 2024 09:01
@mattsse mattsse added the C-enhancement New feature or request label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for FlatCallTracer
2 participants