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

flatCallTracer for prebedrock blocks #218

Open
MRabenda opened this issue Jan 15, 2024 · 4 comments
Open

flatCallTracer for prebedrock blocks #218

MRabenda opened this issue Jan 15, 2024 · 4 comments

Comments

@MRabenda
Copy link

MRabenda commented Jan 15, 2024

Rationale

At ethereum/go-ethereum#26377 this PR Geth introduced flatCallTracer which uses callTracer as a proxy to collect call stack info and at the end formats the output in Parity style

Currently, if I am correct flatCallTracer works only for blocks above 105235063 and for older blocks response is

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": [
        {
            "error": "tracer not found"
        }
    ]
}

Where older blocks support callTracer (which means that they should support flatCallTracer as well - this is just a different format)

This alignment will help a lot of data pipelines to align approaches add process all blockchains using Parity style traces since block 0.

If I am doing something wrong, feel free to advice how to solve that problem.

@pcw109550
Copy link
Contributor

I assume that you are on OP-mainnet, because block number 105235063 is start of the OP-mainnet bedrock genesis. Also, your are getting some sane responses for prebedrock(block number below 105235063), so I again assume that l2geth is properly setuped on your side(or you are using public infra).

Overall node architecture follows below diagram(Ref):
image

If you send your RPC request, it first arrives to op-geth. If op-geth decides that this request is for prebedrock(block number below 105235063), it routes to l2geth, which stores legacy data and has the ability to trace prebedrock transactions.

Based on your observation, op-geth fetched upstream(geth) and implements flatCallTracer. Thats why flatCallTracer works in bedrock blocks. But, l2geth does not support flatCallTracer, because it is not actively following geth's upstream changes.

Some sidenote: l2geth and op-geth have different state transition rules. Thats why there are two different binaries, and two different databases.

@MRabenda
Copy link
Author

Question if flatCallTracer uses callTracer as a proxy to collect call stack info and at the end formats the output in Parity style, is there a chance that op-geth would be converting callTracer from l2geth to flatCallTracer to keep the standard?

@pcw109550
Copy link
Contributor

That seems possible. I proxied ots_traceTransaction(erigon only RPC) by reconstructing response of debug_traceTransaction at op-erigon: testinprod-io/op-erigon#30. However I am not 100% sure.

@MRabenda MRabenda changed the title flatCallTracer for block 0x1 flatCallTracer for prebedrock blocks Jan 16, 2024
@MRabenda
Copy link
Author

@ pcw109550 is this something that Optimism Foundation can consider worth doing?

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

No branches or pull requests

2 participants