-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[POC] heal the worldstate #4972
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
Changes from 23 commits
9d179f9
d3b6941
dead4f8
e5d62cc
3103951
1311342
0d72427
e511dab
f76b4c5
21bf689
20f76e2
5cab1c2
1297c9a
808643c
e2179d4
1bdb63c
8c4c437
d4ec504
960a8bb
744f772
2b25930
bb2b0b2
5a0587d
686a9cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| package org.hyperledger.besu.ethereum; | ||
|
|
||
| import org.hyperledger.besu.ethereum.chain.MutableBlockchain; | ||
| import org.hyperledger.besu.ethereum.core.Synchronizer; | ||
| import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; | ||
| import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive; | ||
|
|
||
|
|
@@ -30,13 +31,16 @@ public class ProtocolContext { | |
| private final WorldStateArchive worldStateArchive; | ||
| private final ConsensusContext consensusContext; | ||
|
|
||
| private Optional<Synchronizer> synchronizer; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think we should consider alternatives to bloating ProtocolContext, a global object.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, this is indeed a problem. I tried a lot to do otherwise but this was the cleanest I found with the current code structure |
||
|
|
||
| public ProtocolContext( | ||
| final MutableBlockchain blockchain, | ||
| final WorldStateArchive worldStateArchive, | ||
| final ConsensusContext consensusContext) { | ||
| this.blockchain = blockchain; | ||
| this.worldStateArchive = worldStateArchive; | ||
| this.consensusContext = consensusContext; | ||
| this.synchronizer = Optional.empty(); | ||
| } | ||
|
|
||
| public static ProtocolContext init( | ||
|
|
@@ -50,6 +54,14 @@ public static ProtocolContext init( | |
| consensusContextFactory.create(blockchain, worldStateArchive, protocolSchedule)); | ||
| } | ||
|
|
||
| public Optional<Synchronizer> getSynchronizer() { | ||
| return synchronizer; | ||
| } | ||
|
|
||
| public void setSynchronizer(final Optional<Synchronizer> synchronizer) { | ||
| this.synchronizer = synchronizer; | ||
| } | ||
|
|
||
| public MutableBlockchain getBlockchain() { | ||
| return blockchain; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,13 +14,10 @@ | |
| */ | ||
| package org.hyperledger.besu.ethereum.bonsai; | ||
|
|
||
| import org.hyperledger.besu.ethereum.worldstate.PeerTrieNodeFinder; | ||
| import org.hyperledger.besu.ethereum.worldstate.WorldStateStorage; | ||
| import org.hyperledger.besu.plugin.services.storage.KeyValueStorage; | ||
| import org.hyperledger.besu.plugin.services.storage.KeyValueStorageTransaction; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
|
|
@@ -35,15 +32,8 @@ public BonsaiInMemoryWorldStateKeyValueStorage( | |
| final KeyValueStorage codeStorage, | ||
| final KeyValueStorage storageStorage, | ||
| final KeyValueStorage trieBranchStorage, | ||
| final KeyValueStorage trieLogStorage, | ||
| final Optional<PeerTrieNodeFinder> fallbackNodeFinder) { | ||
| super( | ||
| accountStorage, | ||
| codeStorage, | ||
| storageStorage, | ||
| trieBranchStorage, | ||
| trieLogStorage, | ||
| fallbackNodeFinder); | ||
| final KeyValueStorage trieLogStorage) { | ||
| super(accountStorage, codeStorage, storageStorage, trieBranchStorage, trieLogStorage); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| } | ||
|
|
||
| @Override | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.