-
Notifications
You must be signed in to change notification settings - Fork 75
ETCM 944 Extract instantiation of InMemoryWorldStateProxy from Blockchain class #1025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ETCM 944 Extract instantiation of InMemoryWorldStateProxy from Blockchain class #1025
Conversation
.getBlockHeaderByHash(block.header.parentHash) | ||
.toRight(MissingParentError) // Should not never occur because validated earlier | ||
execResult <- executeBlockTransactions(block, parent) | ||
initialWorld = InMemoryWorldStateProxy( |
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.
I moved the creation of the initialWorld
here because it made the method executeBlockTransactions
more testable.
7e80892
to
a30a28c
Compare
src/main/resources/conf/base.conf
Outdated
@@ -386,7 +386,7 @@ mantis { | |||
nodes-per-request = 384 | |||
|
|||
# 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 |
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.
Should we keep this change ? Or was it just for testing ?
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.
Ups... that was me testing. I will rollback
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.
Fixed
…adOnlyWorldStateProxy from Blockchain
405e2a5
to
ce5fe8c
Compare
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