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 16 commits intocosmos:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25909 +/- ##
==========================================
+ Coverage 64.83% 64.86% +0.02%
==========================================
Files 874 875 +1
Lines 57601 57634 +33
==========================================
+ Hits 37347 37384 +37
+ Misses 20254 20250 -4
🚀 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