ETCM 944 Extract instantiation of InMemoryWorldStateProxy from Blockchain class#1025
Merged
leo-bogastry merged 6 commits intodevelopfrom Jun 28, 2021
Merged
Conversation
leo-bogastry
commented
Jun 23, 2021
| .getBlockHeaderByHash(block.header.parentHash) | ||
| .toRight(MissingParentError) // Should not never occur because validated earlier | ||
| execResult <- executeBlockTransactions(block, parent) | ||
| initialWorld = InMemoryWorldStateProxy( |
Contributor
Author
There was a problem hiding this comment.
I moved the creation of the initialWorld here because it made the method executeBlockTransactions more testable.
7e80892 to
a30a28c
Compare
AurelienRichez
approved these changes
Jun 25, 2021
|
|
||
| # Minimum number of peers required to start fast-sync (by determining the pivot block) | ||
| min-peers-to-choose-pivot-block = 3 | ||
| min-peers-to-choose-pivot-block = 1 |
Contributor
There was a problem hiding this comment.
Should we keep this change ? Or was it just for testing ?
Contributor
Author
There was a problem hiding this comment.
Ups... that was me testing. I will rollback
added 5 commits
June 25, 2021 15:20
…adOnlyWorldStateProxy from Blockchain
405e2a5 to
ce5fe8c
Compare
AnastasiiaL
approved these changes
Jun 25, 2021
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
On of the things Blockchain class is doing is providing an instantiation of InMemoryWorldStateProxy class. I think is because this class needs a few storages and they are available in Blockchain (because Blockchain is hoarding everything).
Two flavours of InMemoryWorldStateProxy were provided (a normal one and a readonly one). These were merged into one constructor added to InMemoryWorldStateProxy, and it's up to the class instantiating InMemoryWorldStateProxy to pass the normal or readonly
mptStorage.The biggest impact of this refactoring is in the tests.
Access to the RocksDB became a problem and was conflicting a lot.
I'm adding a few comments to the code as well