You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To withdraw from an OP stack chain, a user needs to provide a proof on L1 that a withdrawal was included on-chain on L2. To do this, eth_getProof is called to prove a storage slot on the withdrawal contract against an output root.
On Reth, eth_getProof is really expensive due to no historical tries being stored. To prove at an old block, old state is reconstructed in-memory using changesets. The further back you go, the more expensive this operation is, which is why it is [restricted] in Reth.
We could increase this maximum, but it would likely be too impractical to run a node with the resources necessary to actually compute historical proofs on a 1s blocktime chain with activity, gigagas or not.
To solve this, we are going to build an ExEx.
Proposed solution
We will build an ExEx that computes withdrawal proofs and caches them in a separate database. The eth_getProof RPC method is replaced with one that first checks this cache, and thereafter computes a historical proof as usual with the normal constraints on how far back you can go.
The ExEx will look for any new withdrawals and store these. Then, every time an output root is posted on L1, non-proven withdrawals are proven and the resulting proof is stored in the cache.
The text was updated successfully, but these errors were encountered:
After internal discussion, it seems like we can introduce a satisfactory workaround to avoid the headache of managing additional cache/state. Per @onbjerg's investigation, the only fields from eth_getProof response needed for withdrawals are storage_root and storage_proofs. Since the rest of the state is not needed, we can simply compute the storage proof and corresponding root and expose that through new eth_getStorageProof RPC endpoint. This endpoint can have much more lax limitations on historical state loading.
Motivation
To withdraw from an OP stack chain, a user needs to provide a proof on L1 that a withdrawal was included on-chain on L2. To do this,
eth_getProof
is called to prove a storage slot on the withdrawal contract against an output root.On Reth,
eth_getProof
is really expensive due to no historical tries being stored. To prove at an old block, old state is reconstructed in-memory using changesets. The further back you go, the more expensive this operation is, which is why it is [restricted] in Reth.We could increase this maximum, but it would likely be too impractical to run a node with the resources necessary to actually compute historical proofs on a 1s blocktime chain with activity, gigagas or not.
To solve this, we are going to build an ExEx.
Proposed solution
We will build an ExEx that computes withdrawal proofs and caches them in a separate database. The
eth_getProof
RPC method is replaced with one that first checks this cache, and thereafter computes a historical proof as usual with the normal constraints on how far back you can go.The ExEx will look for any new withdrawals and store these. Then, every time an output root is posted on L1, non-proven withdrawals are proven and the resulting proof is stored in the cache.
The text was updated successfully, but these errors were encountered: