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

implement anvil_enableTraces #3112

Open
Tracked by #8269
cyberthirst opened this issue Sep 7, 2022 · 5 comments
Open
Tracked by #8269

implement anvil_enableTraces #3112

cyberthirst opened this issue Sep 7, 2022 · 5 comments
Labels
C-anvil Command: anvil good first issue Good for newcomers T-feature Type: feature
Milestone

Comments

@cyberthirst
Copy link

Component

Anvil

Describe the feature you would like

Hi! Would it be possible to implement anvil_enableTraces?

It is listed in the Foundry book, but it isn't currently implemented.

We at https://github.com/Ackee-Blockchain/woke are developing a testing framework and want to return return_data of the transaction to the user. We need to execute the transaction and then query the traces using the tx_hash. We would like to do it in one step.

Additional context

No response

@cyberthirst cyberthirst added the T-feature Type: feature label Sep 7, 2022
@sambacha
Copy link
Contributor

sambacha commented Sep 7, 2022

This would basically be like simulating a tx (the response object would use the same inputs) which was shot down by @onbjerg - @mattsse can correct me on this

@rkrasiuk rkrasiuk added the C-anvil Command: anvil label Sep 7, 2022
@orenyomtov
Copy link

Hey @sambacha @onbjerg @mattsse - are there any plans on implementing this?

@mattsse
Copy link
Member

mattsse commented Oct 5, 2023

uh, this is indeed listed in the book,

can't remember what this endpoint is supposed to do.
Do you know a reference for an example response?

@orenyomtov
Copy link

orenyomtov commented Oct 5, 2023

I don't think a reference ever existed

I'm basically using it for simulating a tx, now I'm sending:

  1. eth_sendTransaction
  2. eth_getTransactioReceipt (in loop till result != null)
  3. trace_transaction/ots_getInternalOperations

It would be nice to have it all in one request

Bonus points if the tx is just simulated like debug_traceCall and not actually mined
geth for example enables this it with debug_traceCall and { tracer: 'callTracer', tracerConfig: { withLog: true } }

@mattsse mattsse added the good first issue Good for newcomers label Oct 5, 2023
@zerosnacks zerosnacks self-assigned this Jun 26, 2024
@zerosnacks
Copy link
Member

This is indeed missing the implementation

/// Turn on call traces for transactions that are returned to the user when they execute a
/// transaction (instead of just txhash/receipt)
///
/// Handler for ETH RPC call: `anvil_enableTraces`
pub async fn anvil_enable_traces(&self) -> Result<()> {
node_info!("anvil_enableTraces");
Err(BlockchainError::RpcUnimplemented)
}

Once implemented can also be added as a method in Alloy's provider ext: https://github.com/alloy-rs/alloy/blob/761909b7cab8cc131ac22a6095f70686b113e2fa/crates/provider/src/ext/anvil.rs#L15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil good first issue Good for newcomers T-feature Type: feature
Projects
No open projects
Status: Todo
Development

No branches or pull requests

6 participants