feat(sei-db): expose state-store pebbledb block cache size as a config option#3623
feat(sei-db): expose state-store pebbledb block cache size as a config option#3623kylee9612 wants to merge 5 commits into
Conversation
PR SummaryLow Risk Overview Adds The MVCC package import is renamed to Reviewed by Cursor Bugbot for commit be6017b. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ee4960b. Configure here.
|
Thanks for the contribution, do you have any evidence or any data to show that increasing block cache size would help making debug_trace query faster? If so, how much faster? Would appreciate to link some test result here. (We've internally tried that and not seeing much improvement) We have other ways of improving debug_trace, for example you can switch to RocksDB backend, which gives you 2x perf improvement |
Thanks for the feedback. I re-ran a controlled comparison and do see a consistent improvement, so sharing the numbers. Setup: two nodes, identical hardware(AWS i7i.4xlarge) , same chain height, tracing the same block (
Roughly a 4x speedup, with cache size as the only variable. The gap shows up on dense / trace-heavy blocks where the working set exceeds 32 MiB. We're not considering the RocksDB backend at the moment, and in our testing simply increasing the cache size was the most effective option. The default stays at 32 MiB ( |
# Conflicts: # sei-db/db_engine/pebbledb/mvcc/db.go

Problem
Historical EVM queries (
debug_traceBlockByNumber,debug_traceTransaction) are slow under heavy trace load.Root cause
These reads bypass the in-memory memIAVL (SC) layer and are
served directly from the state-store (SS) pebbledb backend, whose block
cache is hardcoded to 32 MiB in
sei-db/db_engine/pebbledb/mvcc/db.go(
pebble.NewCache(1024 * 1024 * 32)). For trace-heavy workloads this is toosmall, so reads become disk-bound and there is no way to tune it without
recompiling.
Fix
Expose the cache size as
ss-cache-size-bytesin the[state-store]config. Default stays at 32 MiB (the previous hardcodedvalue); values
<= 0fall back to the default, so existing configs areunaffected. Type is
int64to matchpebble.NewCache(int64).