-
Notifications
You must be signed in to change notification settings - Fork 839
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
Snapshot based non-persisting MutableWorldState usage #4531
Snapshot based non-persisting MutableWorldState usage #4531
Conversation
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/TrieLogManager.java
Fixed
Show resolved
Hide resolved
This pull request introduces 1 alert when merging dcfcc53 into d73ce21 - view on LGTM.com new alerts:
|
64a6d35
to
6377bb0
Compare
a9df9b3
to
a07d7d2
Compare
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueries.java
Outdated
Show resolved
Hide resolved
...creation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/BonsaiWorldStateArchive.java
Show resolved
Hide resolved
267fd18
to
94a0b25
Compare
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/BonsaiWorldStateArchive.java
Outdated
Show resolved
Hide resolved
bba8cb0
to
93459f4
Compare
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueries.java
Outdated
Show resolved
Hide resolved
...re/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueStorageProvider.java
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java
Show resolved
Hide resolved
46b8bab
to
099a762
Compare
} catch (final EmptySimulatorResultException e) { | ||
LOG.error( | ||
"Empty simulator result, call params: {}, blockHeader: {} ", | ||
JsonCallParameterUtil.validateAndGetCallParams(requestContext), |
Check notice
Code scanning / CodeQL
Use of default toString()
7c074aa
to
c03c476
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.
LGTM
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueries.java
Show resolved
Hide resolved
...rc/test-support/java/org/hyperledger/besu/ethereum/core/InMemoryKeyValueStorageProvider.java
Show resolved
Hide resolved
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.
just a couple of minor optional notes, but this is pretty awesome.
.../src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/BlockReplay.java
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java
Show resolved
Hide resolved
.../src/test/java/org/hyperledger/besu/ethereum/bonsai/BonsaiSnapshotWorldStateArchiveTest.java
Show resolved
Hide resolved
final Optional<Hash> blockHashByNumber = blockchain.getBlockHashByNumber(blockNumber); | ||
if (blockHashByNumber.isPresent()) { | ||
return getMutable(null, blockHashByNumber.get(), isPersistingState); | ||
final Hash rootHash, final Hash blockHash, final boolean shouldPersistState) { |
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.
rootHash is only needed if shouldPersistState == true, and in that case it is not passed any further along. Could be deleted.
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/SnapshotTrieLogManager.java
Show resolved
Hide resolved
… usages includes: try-with-resources and AutoCloseable in order to relase snapshots when we are done with them still outstanding: .. try-with-resources on transaction simulation stuff .. jsonrpc query stuff .. figure out what to do with the collection of layered worldstates (keep and base on snapshot?, or just ditch?) Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…tateUpdater based snapshot worldstates for performance comparison Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
still outstanding: - add and implement snapshot-capable subclass of StorageProvider - add --Xsnapshot-bonsai CLI flag Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
… interface Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…adability refactor, rethrow unchecked exception in BlockchainQueries Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…ate, not just restart a new transaction from the original snapshot Signed-off-by: garyschulte <garyschulte@gmail.com>
…apshotPersistedWorldState rather than an explicitly managed flag Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…rces autoclosing mutableworldstate Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…te in TransactionSimulator Signed-off-by: garyschulte <garyschulte@gmail.com>
c03c476
to
b5c64ab
Compare
* implementation of Bonsai snapshots based BonsaiWorldStateArchive includes: try-with-resources and AutoCloseable WorldState in order to release snapshots when we are done with them Signed-off-by: garyschulte <garyschulte@gmail.com> Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
* implementation of Bonsai snapshots based BonsaiWorldStateArchive includes: try-with-resources and AutoCloseable WorldState in order to release snapshots when we are done with them Signed-off-by: garyschulte <garyschulte@gmail.com>
PR description
Adds Bonsai snapshots as an experimental option (
--Xbonsai-use-snapshots
) into BonsaiWorldStateArchive for arbitrary mutable non-persisting worldstate. Also refactors TrieLogManager into a LayeredTrieLogManager and SnapshotTrieLogManager such that cached worldstates use either layered worldstates or snapshot worldstates.Since snapshot transactions need to release their snapshot in order to allow their logs to be compacted, this PR refactors direct uses of mutable worldstates to be in try-with-resources blocks (to auto-close snapshots after usage):
Fixed Issue(s)
relates to #4372
relates to #4250
relates to #4199
relates to #4151
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog