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

debug.traceTransaction With callTracer Doesn't Work With Arbitrary/Non-Existent Txns #22371

Closed
m-e-r-k-l-e-root opened this issue Feb 23, 2021 · 6 comments

Comments

@m-e-r-k-l-e-root
Copy link

System information

Geth version: v1.9.25
OS & Version: Ubuntu 18.04
Node Type: Full (not fast synced)

Expected behaviour

debug.traceTransaction called using tracer callTracer to properly trace calls on txns that are pending (i.e. non-existent).

Actual behaviour

debug.traceTransaction when called using tracer callTracer on a txn that is pending (i.e. non-existent) returns an error indicating that the txn is not found.

Steps to reproduce the behaviour

Call debug.traceTransaction while specifying a txn hash that is associated with a pending (non-existent) txn.

Additional information

I was curious if writing a different tracer, i.e. possibly building on top of the tracer callTracer would achieve what was described above? If not, what suggestions do you have regarding how to trace a txn that is still in a pending state? Thanks.

@ligi
Copy link
Member

ligi commented Feb 25, 2021

Can you give some more information about your use-case?

@ligi
Copy link
Member

ligi commented Feb 25, 2021

also please see #22197

@holiman
Copy link
Contributor

holiman commented Feb 25, 2021

So, what you want, is it the same thing as (pseudo-code)

var tx = txpool.pending(...)[0]
debug.traceCall({ from:  tx.from, to: tx.to, data: tx.data } )

which would execute some transaction on top of the current state.

OR
Do you want to execute the entire 'pending state', and then trace a transaction on top?

@m-e-r-k-l-e-root
Copy link
Author

m-e-r-k-l-e-root commented Feb 25, 2021

So, what you want, is it the same thing as (pseudo-code)

var tx = txpool.pending(...)[0]
debug.traceCall({ from:  tx.from, to: tx.to, data: tx.data } )

which would execute some transaction on top of the current state.

OR
Do you want to execute the entire 'pending state', and then trace a transaction on top?

Yes, the pseudocode you've provided is an entirely valid representation of what I am attempting to achieve. We're primarily attempting to get this functionality working to trace calls present within a transaction prior to the transaction being executed in order to provide in depth visualization of call traces pertaining to transactions prior to them being execution (a feature being implemented in our block explorer).

We've been able to implement this feature already for existing/executed transactions using the following:

debug.traceTransaction("<hash>", {tracer: "callTracer"});

But, as mentioned above when calling debug.traceTransaction on a txn hash associated with a non executed/pending txn results in debug.traceTransaction returning an error indicating that the txn hash could not be found.

@rjl493456442
Copy link
Member

debug.traceTransaction("<hash>", {tracer: "callTracer"}); It's only for the included transactions, not for pending.

So do you think the traceCall API can solve your issues? Can I close it?

@m-e-r-k-l-e-root
Copy link
Author

debug.traceTransaction("<hash>", {tracer: "callTracer"}); It's only for the included transactions, not for pending.

So do you think the traceCall API can solve your issues? Can I close it?

Yes this issue can be closed, traceCall was suitable for my use case.

@m-e-r-k-l-e-root m-e-r-k-l-e-root changed the title debug.traceTransaction with callTracer Doesn't Work On Pending (Non-Existent) Txns debug.traceTransaction With callTracer Doesn't Work With Arbitrary/Non-Existent Txns Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants