perf(evm): skip redundant initial Snapshot in OCC executor path#2854
Draft
perf(evm): skip redundant initial Snapshot in OCC executor path#2854
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
In the OCC executor path, each EVM transaction creates 3 CacheMultiStore layers: 1. prepareTask: CMS with VersionIndexedStore wrappers (OCC isolation) 2. NewDBImpl: Snapshot() creates CMS wrapping #1 (GetCommittedState baseline) 3. Prepare: Snapshot() creates CMS wrapping #2 (EVM revert support) Layer #2 is redundant because no state changes occur between NewDBImpl and Prepare (called by go-ethereum's StateTransition.Execute). Prepare's Snapshot provides the same GetCommittedState baseline. Add NewDBImplWithoutSnapshot() that skips the initial Snapshot, used only in the OCC hot path (app.go executeEVMTxWithGigaExecutor). The original NewDBImpl is preserved for all other callers (tests, RPC, ante handlers) that may write state before the first explicit Snapshot. Also add defensive guards on GetCommittedState and flushEvents for the case where snapshottedCtxs is empty. Results (M4 Max benchmark, diff vs previous): - DBImpl.Snapshot alloc: -9.8 GB - cachemulti.newStoreWithoutGiga: -10.5 GB - Total alloc_space: 457 GB → 313 GB (-31%) - Idle CPU (usleep+kevent): 42.9s → 30.1s (-30%, workers busier) - TPS steady-state: 7,200-8,600 (median ~8,000) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f1c3021 to
a4c49dc
Compare
08c4efe to
8d2dc33
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2854 +/- ##
==========================================
+ Coverage 46.28% 52.21% +5.93%
==========================================
Files 2005 2027 +22
Lines 163018 160471 -2547
==========================================
+ Hits 75449 83792 +8343
+ Misses 81047 68765 -12282
- Partials 6522 7914 +1392
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Snapshot()call in the OCC executor pathStack
7/19 — depends on perf/cache-gaskv-context (replaces auto-closed #2819)
🤖 Generated with Claude Code