kona icon indicating copy to clipboard operation
kona copied to clipboard

feat(client/host): Remove `debug_dbGet` dependency

Open clabby opened this issue 1 year ago • 4 comments

Overview

Currently, we have a dependency on hash-scheme geth's debug_dbGet endpoint to fetch specific trie node preimages by hash. For the most part, eth_getProof gives us what we need, except for in the special case of trie node deletions where a branch with one remaining child needs to be compacted.

Unless overlooking something, we will still need some sort of trie-node-preimage-by-hash fetcher, though we should explore options that are more robust.

Brainstorm

  • reth execution extension to index changed trie nodes
    • Only store merkle diffs; key by path. We should be able to consult the state at tip for trie paths that have not been altered within or after the block at which the trie path is being queried.

clabby avatar Jun 11 '24 05:06 clabby

Dropping dbGet would be very nice to have right now. It's very much in the way of testing against mainnet/sepolia blocks.

In zeth, we used inclusion proofs from before and after execution to get around this issue: https://github.com/risc0/zeth/blob/079d1a077280f4108ec2612dfa7f34160567b52c/lib/src/host/preflight.rs#L282C4-L282C19

hashcashier avatar Oct 14 '24 08:10 hashcashier

hi , can i take on this ?

mahmudsudo avatar Oct 29 '24 20:10 mahmudsudo

hi , can i take on this ?

Hi @mahmudsudo! This issue is currently being worked on over in op-reth and op-geth, as we need a new endpoint for state witness access first. Once we have that, we'll standardize the hint-route we use for the op-program and kona.

Once the endpoints are ready to go, I'll ping this issue with details on how we can implement it in kona.

clabby avatar Nov 05 '24 18:11 clabby

@meyer9 I want to bring this issue to your attention given the work on the historical state indexer. The indexer should cover the special case highlighted in the OP where a trie node is deleted.

Inphi avatar Nov 24 '25 15:11 Inphi