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

eth/traces,core: support tracing transactions while the chain is synchronizing and store results in db. #27680

Closed
wants to merge 1 commit into from

Conversation

recursion128
Copy link

This PR supports the tracer running alongside the synchronization process when the chain is synchronizing normally, tracing transactions, and recording the trace results in the geth database.

It also allows users to configure the tracer, to support the persistence of different tracer results.

The main benefit of this modification is that when users call debug_traceTransaction, if the trace result of the transaction has already been persisted, it will be read from the database instead of replaying the transaction. This will significantly reduce the RPC delay and CPU usage. This is very beneficial for websites like Debank that rely on debug_traceTransaction for Portfolio tracing.

@rjl493456442
Copy link
Member

I think it's duplicated with @s1na 's work

@recursion128
Copy link
Author

@rjl493456442 I appreciate your reminder.I have looked at @s1na's PR(#27629). His work has set a new groundwork for tracer-related development. The implementation of the long-running tracer aligns with my PR, yet it seems to lack trace persistence. I'm contemplating further implementation based on his work.

@rjl493456442
Copy link
Member

You store the tx trace result in key-value store directly, it will be huge overhead for the entire system.
We prefer to store block traces in the freezer, which is append-only flat files. I am not sure if sina already
had some implementations or not.

@s1na
Copy link
Contributor

s1na commented Jul 10, 2023

Hi @zhangguyu6. Very cool that you're working on this. I liked your code changes. I agree with @rjl493456442 that the persistence is still half-baked. I don't have any code on that. I'm waiting for #25963 to arrive since the mechanism used for storing state diffs is very similar to what we want for traces as well.

#27629 is the first step to the full feature which would include persistence and querying through RPC. If you wanted to coordinate you can find me on discord, my handle is @s1na.

@recursion128 recursion128 marked this pull request as draft July 12, 2023 08:45
@recursion128 recursion128 closed this by deleting the head repository Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants