-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow EVM state to be flushed to disk every Nth block instead of ever…
…y block (#1532) These changes should reduce the amount of data written to evm.db by only flushing EVM state to disk periodically instead of every block, similar to how data is written to app.db. * Bump default number of cached EVM state roots to 500 The flush interval is currently set to 100, so the cache must be a bit larger than that, otherwise in-mem-only roots are likely to be evicted too quickly and EVMState.GetSnapshot() will end up returning older state than it should. * Eliminate PruningIAVLStore We haven't used this store in ages and have no intention of doing so again because it has been replaced by the IAVL flushing interval. Finally getting rid of this store now because the snapshot code for the remaining stores needs to be updated and I don't want to waste time modifying code that doesn't get used. * Verify state roots in EVMState.GetSnapshot() Due to the flush interval in the EvmStore some EVM state roots may never be written to disk, so it's important to check that the root of the state returned by EVMState.GetSnapshot() at a particular height matches the EVM state root stored in the app store at that height, otherwise the EVM state and app state returned by Application.ReadOnlyState() may end up being out of sync. * Hack VersionedCachingStore to get the e2e tests passing The EVM root in the VersionedCachingStore cache wasn't being updated in VersionedCachingStore.SaveVersion() which meant that the snapshots obtained from the VersionedCachingStore contained a stale EVM root that didn't match the EVM state in the snapshot. This hack updates the cached EVM root in VersionedCachingStore.SaveVersion() but it's not a proper fix for the issue, the VersionedCachingStore shouldn't be aware of the EVM root at all. The most sensible thing to do is probably to eliminate the MultiWriterAppStore itself and update Application.Commit() to call EvmStore.Commit(), and then store the EVM root in the VersionedCachingStore. * Add EvmStore.FlushInterval setting to loom.yml This setting works similarly to AppStore.IAVLFlushInterval. Co-authored-by: Vadim Macagon <vadim.macagon@gmail.com>
- Loading branch information
1 parent
1bb40ac
commit a6fba1c
Showing
36 changed files
with
864 additions
and
1,294 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.