Skip to content

Conversation

@Kbhat1
Copy link
Contributor

@Kbhat1 Kbhat1 commented Jan 28, 2026

Describe your changes and provide context

  • Add RecoverCompositeStateStore to handle WAL replay for both stores on startup
  • Refactor pruning to go through CompositeStateStore so both Cosmos_SS and EVM_SS are pruned correctly
  • If EVM_SS is behind (e.g., newly enabled or crash), sync it from WAL before standard recovery
  • Standard WAL replay uses ApplyChangesetSync which dual-writes to both stores automatically
  • Backward search for replay offset matches existing RecoverStateStore pattern
  • Both stores stay consistent after crashes/restarts

Testing performed to validate your change

  • Unit tests
  • Verifying on node

@Kbhat1 Kbhat1 marked this pull request as draft January 28, 2026 22:20
@github-actions
Copy link

github-actions bot commented Jan 28, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 2, 2026, 3:59 PM

@Kbhat1 Kbhat1 changed the title WIP: CompositeStateStore Parrt 5: WAL integration WIP: CompositeStateStore Part 5: WAL integration Jan 28, 2026
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.83%. Comparing base (b3b7cd4) to head (17c7f7d).

Additional details and impacted files

Impacted file tree graph

@@                       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     
Flag Coverage Δ
sei-db 68.72% <ø> (ø)
sei-tendermint 47.55% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-wal-integration branch 2 times, most recently from c0a7f5b to db4a5a9 Compare January 29, 2026 17:39
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-write-path branch from 42e19d3 to 4084fe1 Compare January 29, 2026 17:54
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-wal-integration branch from ee8ea44 to a401330 Compare January 29, 2026 17:56
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-write-path branch from 4055a6d to ae9502c Compare January 29, 2026 20:56
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-wal-integration branch from 0cefbd5 to 1fc46b6 Compare January 29, 2026 20:56
@Kbhat1 Kbhat1 marked this pull request as ready for review January 30, 2026 03:43
@Kbhat1 Kbhat1 changed the title WIP: CompositeStateStore Part 5: WAL integration CompositeStateStore Part 5: WAL integration Jan 30, 2026
@Kbhat1 Kbhat1 changed the title CompositeStateStore Part 5: WAL integration Composite State Store Part 5: WAL integration Jan 30, 2026
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-write-path branch from ae9502c to a11dc21 Compare January 30, 2026 03:59
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-wal-integration branch from 1fc46b6 to dedf0c0 Compare January 30, 2026 04:00
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-write-path branch from a11dc21 to ca81638 Compare January 30, 2026 04:51
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-wal-integration branch from c9ef455 to f9a3987 Compare January 30, 2026 04:52
@Kbhat1 Kbhat1 changed the title Composite State Store Part 5: WAL integration Composite State Store Part 5: WAL integration + Composite Pruning Manager Jan 30, 2026
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-write-path branch from ca81638 to 8efe6df Compare January 30, 2026 05:21
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-wal-integration branch from c769c02 to 7803574 Compare January 30, 2026 05:24
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-write-path branch from 8efe6df to 9be2e36 Compare January 30, 2026 05:30
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-wal-integration branch from 7803574 to d0ff8d9 Compare January 30, 2026 05:30
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 {
Copy link
Contributor

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) }

@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-write-path branch from 9be2e36 to da06ac5 Compare February 2, 2026 15:32
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-wal-integration branch from d0ff8d9 to 4e18ca2 Compare February 2, 2026 15:32
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-write-path branch from da06ac5 to bca19d0 Compare February 2, 2026 15:50
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-wal-integration branch from 4e18ca2 to 53da684 Compare February 2, 2026 15:50
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-write-path branch from bca19d0 to b3b7cd4 Compare February 2, 2026 15:58
@Kbhat1 Kbhat1 force-pushed the feature/composite-ss-wal-integration branch from 53da684 to 17c7f7d Compare February 2, 2026 15:58
)

// Sync EVM_SS if behind
if evmVersion < cosmosVersion {
Copy link
Contributor

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(
Copy link
Contributor

@yzang2019 yzang2019 Feb 2, 2026

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants