feat(blockstm): cache pre-state to optimize value-based validation#25909
feat(blockstm): cache pre-state to optimize value-based validation#25909mmsqe wants to merge 14 commits intocosmos:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25909 +/- ##
==========================================
- Coverage 60.11% 60.05% -0.06%
==========================================
Files 976 961 -15
Lines 64970 64044 -926
==========================================
- Hits 39057 38463 -594
+ Misses 25913 25581 -332
🚀 New features to boost your workflow:
|
|
@mmsqe conflicts due to file movements sorry 😅 |
f9cdc06 to
9329e96
Compare
be9ebd8 to
6ff42da
Compare
skip cache oversized
Greptile SummaryThis PR optimizes BlockSTM execution by caching pre-state storage reads, reducing expensive storage access during validation. The implementation adds a
The refactoring in Benchmark results show substantial improvements:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Transaction reads key] --> B{Check WriteSet}
B -->|Found| C[Return from WriteSet]
B -->|Not found| D[Read from MVMemory]
D --> E{Version valid?}
E -->|Yes| F[Return value from MVMemory]
E -->|No - pre-state read| G{Check preState cache}
G -->|Cache hit| H[Return cached value]
G -->|Cache miss| I[Read from storage]
I --> J{Value size check}
J -->|Byte slice <= 4KB| K[Store in cache]
J -->|Byte slice > 4KB or non-byte| L{Is byte slice?}
L -->|No - any type| K
L -->|Yes - too large| M[Skip caching]
K --> N[Return value]
M --> N
Last reviewed commit: 911a426 |
wire MVMemory view
Description
Update: #25777