-
Notifications
You must be signed in to change notification settings - Fork 835
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
TrieLog shipping prep #5317
TrieLog shipping prep #5317
Conversation
|
8727fbf
to
7419e59
Compare
966aa5d
to
5ac40b7
Compare
3a0478c
to
924193a
Compare
|
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.
looks ok. couple of comments
...eum/core/src/test/java/org/hyperledger/besu/ethereum/bonsai/trielog/TrieLogManagerTests.java
Outdated
Show resolved
Hide resolved
...n/java/org/hyperledger/besu/ethereum/bonsai/worldview/BonsaiWorldStateUpdateAccumulator.java
Outdated
Show resolved
Hide resolved
.../core/src/main/java/org/hyperledger/besu/ethereum/bonsai/trielog/AbstractTrieLogManager.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/test/java/org/hyperledger/besu/ethereum/bonsai/trielog/TrieLogLayerTests.java
Show resolved
Hide resolved
Signed-off-by: garyschulte <[email protected]>
…ots from trielog generation Signed-off-by: garyschulte <[email protected]>
…ge as cleared Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
a9630ea
to
aba0b39
Compare
var val = slotUpdate.getValue(); | ||
|
||
if (val.getPrior() == null && val.getUpdated() == null) { | ||
// by default do not persist empty reads to the trie log |
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.
We will need enough to prove absence when Verkle Tries happen. Something to keep in mind but I don't think now is the time to address it.
@@ -69,6 +71,10 @@ public synchronized void saveTrieLog( | |||
try { | |||
final TrieLogLayer trieLog = prepareTrieLog(forBlockHeader, localUpdater); | |||
persistTrieLog(forBlockHeader, forWorldStateRootHash, trieLog, stateUpdater); | |||
|
|||
// notify trie log added observers, synchronously | |||
trieLogAddedObservers.forEach(o -> o.onTrieLogAdded(new TrieLogAddedEvent(trieLog))); |
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.
do we want to notify subscribers synchronously ?
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.
Besu's observer notification precedent is synchronous. I put this comment here to call out that we are conforming to that precedent, but this might be a good candidate for handling async here rather than in the observer itself. Since we don't have any observers yet, IMO it didn't warrant creating that behavior (yet?)
@@ -512,6 +502,10 @@ private void importIntoTrieLog(final TrieLogLayer layer, final Hash blockHash) { | |||
newValue.getBalance(), | |||
newValue.getStorageRoot(), | |||
newValue.getCodeHash()); | |||
if (oldValue == null && newValue == null) { |
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.
good catch
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.
small comment
* trielog save event, observer, test * add zero read slots to Accumulator storageToUpdate, omit zero read slots from trielog generation * add account zero reads, mark self-destructed accounts, code and storage as cleared Signed-off-by: garyschulte <[email protected]>
* trielog save event, observer, test * add zero read slots to Accumulator storageToUpdate, omit zero read slots from trielog generation * add account zero reads, mark self-destructed accounts, code and storage as cleared Signed-off-by: garyschulte <[email protected]>
PR description
prep bonsai for trielog shipping
add zero reads of slot storage and accounts to bonsai accumulator storageToUpdate and accountsToUpdate
Fixed Issue(s)
protocols-misc 707