-
Notifications
You must be signed in to change notification settings - Fork 105
docs(replay): update docs with recent info #4619
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
Draft
JereSalo
wants to merge
14
commits into
main
Choose a base branch
from
update_docs_replay
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a7aa61e
update docs replay
JereSalo d60c154
update summary
JereSalo 20976af
add feature revm
JereSalo 5e5f5c0
add feature revm to docs
JereSalo f69e486
add more things about revm in docs
JereSalo f2866c4
improve docs
JereSalo 184aa41
update disclaimer in docs
JereSalo 1e96bb9
update a comment
JereSalo 3e3834d
update docs
JereSalo 338d8c1
besu comment
JereSalo cfbfcd7
Merge branch 'main' into update_docs_replay
JereSalo 1bbac5a
add more info to docs
JereSalo 22694d7
Merge branch 'update_docs_replay' of github.com:lambdaclass/ethrex in…
JereSalo 4c21a8a
typo
JereSalo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## FAQ | ||
|
||
### What's the difference between `eth_getProof` and `debug_executionWitness`? | ||
|
||
`eth_getProof` gets the proof for a particular account and the chosen storage slots. | ||
`debug_executionWitness` gets the whole execution witness necessary to execute a block in a stateless manner. | ||
|
||
The former endpoint is implemented by all execution clients and you can even find it in RPC Providers like Alchemy, the latter is only implemented by some execution clients and you can't find it in RPC Providers. | ||
|
||
When wanting to execute a historical block we tend to use the `eth_getProof` method with an RPC Provider because it will be the most reliable, other way is using it against a Hash-Based Archive Node but this would be too heavy to host ourselves (20TB at least). This method is slow because it performs many requests but it's very flexible. | ||
|
||
If instead we want to execute a recent block we use it against synced ethrex or reth nodes that expose the `debug_executionWitness` endpoint, this way retrieval of data will be instant and it will be way faster than the other method, because it won't be doing thousands of RPC requests, just one. | ||
|
||
### Why stateless execution of some blocks doesn't work with `eth_getProof` | ||
|
||
With this method of execution we get the proof of all the accounts and storage slots accessed during execution, but the problem arises when we want to delete a node from the Merkle Patricia Trie (MPT) when applying the account updates of the block. This is for a particular case in which a tree restructuring happens and we have a missing node that wasn't accessed but we need to know in order to restructure the trie. | ||
|
||
The problem can be explained with a simple example: a Branch node has 2 child nodes and only one was accessed and removed, this branch node should stop existing because they shouldn't have only **one** child. It will be either replaced by a leaf node or by an extension node, this depends on its child. | ||
|
||
This problem is wonderfully explained in [zkpig docs](https://github.com/kkrt-labs/zk-pig/blob/main/docs/modified-mpt.md), they also have a very good intro to the MPT. | ||
Here they mention two different solutions that we have to implement in order to fix this. The first one works when the missing node is a Leaf or Extension and the second one works then the missing node is a Branch. | ||
|
||
In our code we only applied the first solution by injecting all possible nodes to the execution witness that we build when using `eth_getProof`, that's why the witness when using this method will be larger than the witness obtained with `debug_executionWitness`. | ||
|
||
We didn't apply the second change because it needs a change to the MPT that we don't want in our code. However we were able to solve it for execution without using a zkVM by injecting some "fake nodes" to the trie just before execution that have the expected hash but their RLP content doesn't match to it. This way we can "trick" the Trie into thinking that it has the branch nodes when in fact, it doesn't. | ||
|
||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one was outdated |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that this was a very big table and now both execution and proving works. So I just left the little table below this that has client compatibility, I think that's enough given that we already support every network.