TraceDB: Snapshot-backed state for the trace baker#3360
Open
Kbhat1 wants to merge 5 commits intopr/trace-baker-mainfrom
Open
TraceDB: Snapshot-backed state for the trace baker#3360Kbhat1 wants to merge 5 commits intopr/trace-baker-mainfrom
Kbhat1 wants to merge 5 commits intopr/trace-baker-mainfrom
Conversation
1764fc9 to
c173794
Compare
7b8a363 to
af0de0f
Compare
2412434 to
e0a56bd
Compare
af0de0f to
6981a66
Compare
e0a56bd to
c5e3d21
Compare
6981a66 to
fe9ec89
Compare
c5e3d21 to
4bfc441
Compare
ae34e85 to
f861506
Compare
4bfc441 to
cf01744
Compare
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
7c210c4 to
27dc9b0
Compare
Stacks on the trace baker PR. Captures an O(1) memiavl snapshot of the SC tree at EndBlock and serves trace re-execution from in-RAM state instead of SS-pebble. memiavl: refcount *Snapshot. Tree.Copy() Acquires; Snapshot.Close unmaps only on the final release. Without this a held copy was a use-after-munmap waiting to happen — the background snapshot rewrite calls Tree.ReplaceWith → snapshot.Close mid-flight, segfaulting any held copy. The internal rewrite goroutine also drops its clone's ref so the refcount can reach zero. Committer interface gains Copy(). memiavl delegates to *DB.Copy. composite returns nil when flatkv is engaged so the snapshot path silently falls back. storev2 rootmulti adds SnapshotSCStore + CacheMultiStoreFromCommitter. EVM keeper: TraceSnapshotStore (bounded by-height map) and EndBlock capture keyed by snapshot.Version() (= H-1 at EndBlock(H)). App: SnapshotAwareRPCContextProvider builds the sdk.Context directly from the snapshot CMS to skip the throwaway CacheMultiStoreWithVersion that CreateQueryContext would otherwise make. Configurable via [evm]: trace_bake_use_snapshot (default false) trace_bake_snapshot_window (default 64) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cf01744 to
c28c23f
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## pr/trace-baker-main #3360 +/- ##
=======================================================
- Coverage 59.31% 59.28% -0.03%
=======================================================
Files 2099 2100 +1
Lines 173370 173676 +306
=======================================================
+ Hits 102826 102970 +144
- Misses 61652 61789 +137
- Partials 8892 8917 +25
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Describe your changes and provide context
StateReleaseFunc, avoiding GC finalizers.trace_bake_use_snapshot; falls back when the backend cannot provide a snapshot.Testing performed to validate your change
go test ./sei-db/state_db/sc/memiavl -run 'TreeCopy|Snapshot' -count=1