l2 commitments: fix rayon collect iter order #35
Merged
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.
Fix state root computation!
i thought I understood rayon but, the problem here was that, under the hood
collect
returnsThis means that, when using par_bridge + collect to a vec, the order of the items in the final vec in unspecified - and the final hash of the state root is never the same :(
This is easy to fix though: we just keep track of the keys along with the values when using par_bridge
Pull Request type
What is the current behavior?
State root dono work
Resolves: #NA
What is the new behavior?
State root work
Does this introduce a breaking change?
N/A
Other information
To be honest, after this PR i'll test deoxys with make my parallelized bonsai-trie; there is a good chance that makes these parallel iterators kinda redundant as a single bonsai-trie commit would be already parallel enough
Also, the
Debug
impl for Felt was driving me insane so I changed it to make reading lots of logs easier