This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
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.
Use trie-cache for
validate_block
#2813Use trie-cache for
validate_block
#2813Changes from 23 commits
23ac3a0
7c5f862
3658334
9b6fff5
fc8ef69
2fdddaf
3f94561
259dd4e
d1a1058
59b7b7f
07cbd1c
c461e41
2491f68
869138a
9e77c4d
9e181f8
abef482
9422541
297b5a3
aa13d51
9fb05c0
8148892
d78f377
c283268
7f1d06e
56e24a6
6bdbb82
827f6e4
16f257d
4b47f06
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
This function is called when we call
storage_root
. Thevalues
that are being created while calculating thestorage_root
should not be added to thevalue_cache
as otherwise they may would overwrite some cached value from the "real trie" (we only distinguish using the key and the key stays the same in each trie). If another operation then would want to fetch this overwritten value, it would get some invalid data.The nodes are accessed by their hash, so that should be no problem. However, the question in general is if we even need to cache these nodes. These nodes will never be accessible from the "storage root" we are operating on.
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.
The value cache is now disabled when building storage roots. Due to how
get_or_insert_node
works I think it does still make sense to take ownership of the fetched node and cache it.