Skip to content

Unify EVM SS into single DB with store key prefixes#3134

Merged
Kbhat1 merged 3 commits intomainfrom
kartik/evm-ss-unified-db
Apr 8, 2026
Merged

Unify EVM SS into single DB with store key prefixes#3134
Kbhat1 merged 3 commits intomainfrom
kartik/evm-ss-unified-db

Conversation

@Kbhat1
Copy link
Copy Markdown
Contributor

@Kbhat1 Kbhat1 commented Mar 30, 2026

Describe your changes and provide context

  • Consolidate EVM state-store sub-DBs into a single DB by default while preserving the existing evm keyspace and MVCC key encoding
  • Add configuration to optionally split EVM data back across per-type physical DBs without changing logical read/write behavior.

Testing performed to validate your change

  • Unit tests
  • Verifying w/ state sync on node

Replace 5 separate MVCC databases (nonce, codehash, code, storage,
legacy) with a single DB. EVM sub-types are namespaced via the MVCC
store key prefix (s/k:<storeType>/) instead of separate directories.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Kbhat1 Kbhat1 changed the title Unify EVM SS into single DB with store key prefixes WIP: Unify EVM SS into single DB with store key prefixes Mar 30, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 30, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 8, 2026, 3:40 PM

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 73.95833% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.80%. Comparing base (7246320) to head (688089b).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
sei-db/state_db/ss/evm/store.go 73.75% 13 Missing and 8 partials ⚠️
app/seidb.go 20.00% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3134   +/-   ##
=======================================
  Coverage   58.79%   58.80%           
=======================================
  Files        2054     2054           
  Lines      168315   168375   +60     
=======================================
+ Hits        98958    99009   +51     
- Misses      60610    60614    +4     
- Partials     8747     8752    +5     
Flag Coverage Δ
sei-chain-pr 55.90% <73.95%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-cosmos/server/config/config.go 94.44% <100.00%> (+0.12%) ⬆️
sei-db/config/ss_config.go 100.00% <100.00%> (ø)
sei-db/state_db/ss/composite/store.go 72.42% <100.00%> (+1.14%) ⬆️
sei-db/state_db/ss/evm/types.go 100.00% <ø> (ø)
app/seidb.go 68.60% <20.00%> (+5.19%) ⬆️
sei-db/state_db/ss/evm/store.go 71.02% <73.75%> (-0.41%) ⬇️
🚀 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 marked this pull request as ready for review April 3, 2026 14:09
@Kbhat1 Kbhat1 changed the title WIP: Unify EVM SS into single DB with store key prefixes Unify EVM SS into single DB with store key prefixes Apr 3, 2026
Keep the current unified layout as the default while allowing EVM data to be split across physical DBs. Preserve the existing evm keyspace and metadata layout even when separated so the change only affects placement, not encoding.

Made-with: Cursor
@Kbhat1 Kbhat1 requested review from blindchaser and yzang2019 April 6, 2026 14:14
}
}
}()
return db.Import(version, filtered)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if db.Import(version, filtered) returns early with an error, the filtering goroutine at line 275 blocks forever on filtered <- node (nobody drains filtered anymore). this also prevents draining the upstream ch, which causes the composite store's sendNode(evmCh, ...) to block

if len(evmChangesets) == 0 {
return nil
}
return db.ApplyChangesetAsync(version, evmChangesets)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApplyChangesetSync and ApplyChangesetAsync shares most of the code, how about extract shared func like applyChangeset()

Resolve the EVM SS merge conflicts while preserving the branch's unified/full-key storage behavior and bringing in mainline updates.

Made-with: Cursor
@Kbhat1 Kbhat1 added this pull request to the merge queue Apr 8, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 8, 2026
@Kbhat1 Kbhat1 added this pull request to the merge queue Apr 8, 2026
Merged via the queue into main with commit 36f9664 Apr 8, 2026
41 checks passed
@Kbhat1 Kbhat1 deleted the kartik/evm-ss-unified-db branch April 8, 2026 15:43
@seidroid
Copy link
Copy Markdown

seidroid bot commented Apr 8, 2026

Created backport PR for release/v6.4:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-3134-to-release/v6.4
git worktree add --checkout .worktree/backport-3134-to-release/v6.4 backport-3134-to-release/v6.4
cd .worktree/backport-3134-to-release/v6.4
git reset --hard HEAD^
git cherry-pick -x 36f9664790cf86a33a287670e8939d466a8c339f
git push --force-with-lease

Kbhat1 added a commit that referenced this pull request Apr 8, 2026
- Consolidate EVM state-store sub-DBs into a single DB by default while
preserving the existing evm keyspace and MVCC key encoding
- Add configuration to optionally split EVM data back across per-type
physical DBs without changing logical read/write behavior.

- Unit tests
- Verifying w/ state sync on node

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit 36f9664)
masih pushed a commit that referenced this pull request Apr 8, 2026
…refixes (#3211)

Backport of #3134 to `release/v6.4`.

---------

Co-authored-by: Kartik Bhat <kartikbhatri@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

3 participants