-
Notifications
You must be signed in to change notification settings - Fork 861
Composite State Store Part 5: WAL integration + Composite Pruning Manager #2785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/composite-ss-write-path
Are you sure you want to change the base?
Composite State Store Part 5: WAL integration + Composite Pruning Manager #2785
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/composite-ss-write-path #2785 +/- ##
================================================================
Coverage 47.82% 47.83%
================================================================
Files 357 357
Lines 34697 34697
================================================================
+ Hits 16594 16597 +3
- Misses 16525 16526 +1
+ Partials 1578 1574 -4
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
c0a7f5b to
db4a5a9
Compare
42e19d3 to
4084fe1
Compare
ee8ea44 to
a401330
Compare
4055a6d to
ae9502c
Compare
0cefbd5 to
1fc46b6
Compare
ae9502c to
a11dc21
Compare
1fc46b6 to
dedf0c0
Compare
a11dc21 to
ca81638
Compare
c9ef455 to
f9a3987
Compare
ca81638 to
8efe6df
Compare
c769c02 to
7803574
Compare
8efe6df to
9be2e36
Compare
7803574 to
d0ff8d9
Compare
| logger.Info("Replaying WAL to EVM store", "startOffset", startOffset, "endOffset", lastOffset) | ||
|
|
||
| return streamHandler.Replay(startOffset, lastOffset, func(index uint64, entry proto.ChangelogEntry) error { | ||
| if entry.Version > cosmosVersion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional: logging wal replay progress something like:
if index % 1000 == 0 { logger.Info("WAL replay progress", "offset", index, "version", entry.Version) }
9be2e36 to
da06ac5
Compare
d0ff8d9 to
4e18ca2
Compare
da06ac5 to
bca19d0
Compare
4e18ca2 to
53da684
Compare
Add recovery mechanism ensuring both Cosmos_SS and EVM_SS stay in sync: - RecoverCompositeStateStore: Syncs EVM_SS if behind, replays new WAL entries - syncEVMStore: Catches up EVM_SS via WAL replay - Standard WAL replay goes through ApplyChangesetSync (dual-writes) Usage: Call RecoverCompositeStateStore after creating CompositeStateStore.
bca19d0 to
b3b7cd4
Compare
53da684 to
17c7f7d
Compare
| ) | ||
|
|
||
| // Sync EVM_SS if behind | ||
| if evmVersion < cosmosVersion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not compare EVM version with cosmos Version to determine behind or not, because both SS could be falling behind at the same time even if they are at the same height
| } | ||
|
|
||
| // syncEVMStore replays WAL entries to catch up EVM_SS to Cosmos_SS version | ||
| func syncEVMStore( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we consolidate the changelog restore logic into one function?
Describe your changes and provide context
RecoverCompositeStateStoreto handle WAL replay for both stores on startupEVM_SSis behind (e.g., newly enabled or crash), sync it from WAL before standard recoveryApplyChangesetSyncwhich dual-writes to both stores automaticallyRecoverStateStorepatternTesting performed to validate your change