-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Faster root hash This pr introduces option to use sparse merkle trie implementation for the root hash calculation. This implementation fetches relevant pieces of the trie into memory making subsequent root hash calculations faster. On my PC reference implementation takes about 150ms to calculate hash and the new one when everything is prefetched around 5ms. Fetching proof for data for one uncached account takes about 0.25ms. There are things to improve in implementation itself but the basic interface for the integration into the builder will be the same. ## debug-bench-machine This PR also redoes debug-bench-machine. Now you need to stop reth node and provide external rpc for it to work. The reason is that reth has trie only for the last block. Previous implementation used last block to generate changes and it applied that changes to the trie after the last block. Trie would already have these changes but default reth root hash does not care about that discrepancy and it would evaluate anyway, this was used as a hack to benchmark trie even though it would give incorrect results. Sparse trie implemenation would not work like that because it would detect errors such as removing key that was already removed from the trie. The benefit of this is that we can actually check correctness of the root hash on historical block. --- ## ✅ I have completed the following steps: * [ ] Run `make lint` * [ ] Run `make test` * [ ] Added tests (if applicable)
- Loading branch information
Showing
13 changed files
with
317 additions
and
180 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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
Oops, something went wrong.