[R4R] fix: remove diffhash patch introduced from separate node#1020
Merged
unclezoro merged 1 commit intobnb-chain:developfrom Jul 27, 2022
Merged
[R4R] fix: remove diffhash patch introduced from separate node#1020unclezoro merged 1 commit intobnb-chain:developfrom
unclezoro merged 1 commit intobnb-chain:developfrom
Conversation
m separate node
4151071 to
373c1de
Compare
brilliant-lx
approved these changes
Jul 27, 2022
Contributor
brilliant-lx
left a comment
There was a problem hiding this comment.
LGTM.
It has been protected by diffLayer.lock right now.
unclezoro
approved these changes
Jul 27, 2022
forcodedancing
approved these changes
Jul 27, 2022
This was referenced Jul 28, 2022
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
BSC has merged ethereum/go-ethereum#23628 to avoid hitting outdated snapshots, so we can remove #926 code that was introduced at the time to fix diffHash mismatch.
Rationale
In previous versions, the snapshot tree executed
parent.flatten()without first locking the current difflayer whencap, but first executed theparent.flatten()to change it to bestalestate and relinks the currentdifflayer.parent(removes the stale's difflayer from the recursive structure).And this has caused a problem. There is a small chance that the stale difflayer will be obtained first when the difflayer is accessed externally, and then the difflayer.parent will be locked and re-linked, resulting in the snapshot being judged when acquiring the Account or Storage data. Returns null for
Stale.Therefore, in the implementation of #926, a new retry mechanism is added to retry when a null value is obtained, but this approach is not particularly good and may cause over-stack problems.
After the Ethereum version(ethereum/go-ethereum#23628) was merged, it was changed to lock the current difflayer first and then change the parent to avoid the above problems, so we can remove the patch fix introduced at that time.
Example
N/A
Changes
Notable changes: